/// <summary> /// Updates the configuration for each specified caching rule. /// /// Caching rules WAF policies allow you to selectively cache content on Oracle Cloud Infrastructure's edge servers, such as webpages or certain file types. For more information about /// caching rules, see Caching Rules. /// /// This operation can create, delete, update, and/or reorder caching rules depending on the structure of the request body. Caching rules can be updated by changing the properties of /// the caching rule object with the rule's key specified in the key field. Any existing caching rules that are not specified with a key in the list of access rules will be deleted upon update. /// /// The order the caching rules are specified in is important. The rules are processed in the order they are specified and the first matching rule will be used when processing a request. /// Use ListCachingRules to view a list of all available caching rules in a compartment. /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <UpdateCachingRulesResponse> UpdateCachingRules(UpdateCachingRulesRequest request) { var uri = new Uri($"{GetEndPoint(WaasServices.WaasPolicies, this.Region)}/{request.WaasPolicyId}/wafConfig/cachingRules"); var httpRequestHeaderParam = new HttpRequestHeaderParam() { OpcRetryToken = request.OpcRetryToken, OpcRequestId = request.OpcRequestId, IfMatch = request.IfMatch }; var webResponse = await this.RestClientAsync.Put(uri, request.UpdateWaasPolicyDetails, httpRequestHeaderParam); using (var stream = webResponse.GetResponseStream()) using (var reader = new StreamReader(stream)) { var response = reader.ReadToEnd(); return(new UpdateCachingRulesResponse() { OpcRequestId = webResponse.Headers.Get("opc-request-id"), OpcWorkRequestId = webResponse.Headers.Get("opc-work-request-id") }); } }