public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WAFRegional.Model.UpdateRuleRequest(); if (cmdletContext.ChangeToken != null) { request.ChangeToken = cmdletContext.ChangeToken; } if (cmdletContext.RuleId != null) { request.RuleId = cmdletContext.RuleId; } if (cmdletContext.Update != null) { request.Updates = cmdletContext.Update; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRule operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRule operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateRuleResponse> UpdateRuleAsync(UpdateRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateRuleRequestMarshaller(); var unmarshaller = UpdateRuleResponseUnmarshaller.Instance; return InvokeAsync<UpdateRuleRequest,UpdateRuleResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Inserts or deletes <a>Predicate</a> objects in a <code>Rule</code>. Each <code>Predicate</code> /// object identifies a predicate, such as a <a>ByteMatchSet</a> or an <a>IPSet</a>, that /// specifies the web requests that you want to allow, block, or count. If you add more /// than one predicate to a <code>Rule</code>, a request must match all of the specifications /// to be allowed, blocked, or counted. For example, suppose you add the following to /// a <code>Rule</code>: /// /// <ul> <li> /// <para> /// A <code>ByteMatchSet</code> that matches the value <code>BadBot</code> in the <code>User-Agent</code> /// header /// </para> /// </li> <li> /// <para> /// An <code>IPSet</code> that matches the IP address <code>192.0.2.44</code> /// </para> /// </li> </ul> /// <para> /// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want /// to block requests that satisfy the <code>Rule</code>. For a request to be blocked, /// the <code>User-Agent</code> header in the request must contain the value <code>BadBot</code> /// <i>and</i> the request must originate from the IP address 192.0.2.44. /// </para> /// /// <para> /// To create and configure a <code>Rule</code>, perform the following steps: /// </para> /// <ol> <li> /// <para> /// Create and update the predicates that you want to include in the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create the <code>Rule</code>. See <a>CreateRule</a>. /// </para> /// </li> <li> /// <para> /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> /// parameter of an <a>UpdateRule</a> request. /// </para> /// </li> <li> /// <para> /// Submit an <code>UpdateRule</code> request to add predicates to the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. See <a>CreateWebACL</a>. /// </para> /// </li> </ol> /// <para> /// If you want to replace one <code>ByteMatchSet</code> or <code>IPSet</code> with another, /// you delete the existing one and add the new one. /// </para> /// /// <para> /// For more information about how to use the AWS WAF API to allow or block HTTP requests, /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer /// Guide</a>. /// </para> /// </summary> /// <param name="ruleId">The <code>RuleId</code> of the <code>Rule</code> that you want to update. <code>RuleId</code> is returned by <code>CreateRule</code> and by <a>ListRules</a>.</param> /// <param name="updates">An array of <code>RuleUpdate</code> objects that you want to insert into or delete from a <a>Rule</a>. For more information, see the applicable data types: <ul> <li> <a>RuleUpdate</a>: Contains <code>Action</code> and <code>Predicate</code> </li> <li> <a>Predicate</a>: Contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code> </li> <li> <a>FieldToMatch</a>: Contains <code>Data</code> and <code>Type</code> </li> </ul></param> /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateRule service method, as returned by WAFRegional.</returns> /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidOperationException"> /// The operation failed because there was nothing to do. For example: /// /// <ul> <li> /// <para> /// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code> /// isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't /// in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>, /// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code> /// already exists in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to an <code>IPSet</code>, but the IP address already /// exists in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but /// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException"> /// The operation failed because AWS WAF didn't recognize a parameter in the request. /// For example: /// /// <ul> <li> /// <para> /// You specified an invalid parameter name. /// </para> /// </li> <li> /// <para> /// You specified an invalid value. /// </para> /// </li> <li> /// <para> /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>, /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>. /// </para> /// </li> <li> /// <para> /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code> /// other than HEADER, QUERY_STRING, or URI. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code> /// but no value for <code>Data</code>. /// </para> /// </li> <li> /// <para> /// Your request references an ARN that is malformed, or corresponds to a resource with /// which a web ACL cannot be associated. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException"> /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code> /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a> /// in the <i>AWS WAF Developer Guide</i>. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentContainerException"> /// The operation failed because you tried to add an object to or delete an object from /// another object that doesn't exist. For example: /// /// <ul> <li> /// <para> /// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code> /// from a <code>Rule</code> that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to or delete an IP address from an <code>IPSet</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code> /// from a <code>ByteMatchSet</code> that doesn't exist. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: /// /// <ul> <li> /// <para> /// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public Task<UpdateRuleResponse> UpdateRuleAsync(string ruleId, List<RuleUpdate> updates, string changeToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new UpdateRuleRequest(); request.RuleId = ruleId; request.Updates = updates; request.ChangeToken = changeToken; return UpdateRuleAsync(request, cancellationToken); }
/// <summary> /// Inserts or deletes <a>Predicate</a> objects in a <code>Rule</code>. Each <code>Predicate</code> /// object identifies a predicate, such as a <a>ByteMatchSet</a> or an <a>IPSet</a>, that /// specifies the web requests that you want to allow, block, or count. If you add more /// than one predicate to a <code>Rule</code>, a request must match all of the specifications /// to be allowed, blocked, or counted. For example, suppose you add the following to /// a <code>Rule</code>: /// /// <ul> <li> /// <para> /// A <code>ByteMatchSet</code> that matches the value <code>BadBot</code> in the <code>User-Agent</code> /// header /// </para> /// </li> <li> /// <para> /// An <code>IPSet</code> that matches the IP address <code>192.0.2.44</code> /// </para> /// </li> </ul> /// <para> /// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want /// to block requests that satisfy the <code>Rule</code>. For a request to be blocked, /// the <code>User-Agent</code> header in the request must contain the value <code>BadBot</code> /// <i>and</i> the request must originate from the IP address 192.0.2.44. /// </para> /// /// <para> /// To create and configure a <code>Rule</code>, perform the following steps: /// </para> /// <ol> <li> /// <para> /// Create and update the predicates that you want to include in the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create the <code>Rule</code>. See <a>CreateRule</a>. /// </para> /// </li> <li> /// <para> /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> /// parameter of an <a>UpdateRule</a> request. /// </para> /// </li> <li> /// <para> /// Submit an <code>UpdateRule</code> request to add predicates to the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. See <a>CreateWebACL</a>. /// </para> /// </li> </ol> /// <para> /// If you want to replace one <code>ByteMatchSet</code> or <code>IPSet</code> with another, /// you delete the existing one and add the new one. /// </para> /// /// <para> /// For more information about how to use the AWS WAF API to allow or block HTTP requests, /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer /// Guide</a>. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRule service method.</param> /// /// <returns>The response from the UpdateRule service method, as returned by WAFRegional.</returns> /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidOperationException"> /// The operation failed because there was nothing to do. For example: /// /// <ul> <li> /// <para> /// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code> /// isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't /// in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>, /// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code> /// already exists in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to an <code>IPSet</code>, but the IP address already /// exists in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but /// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException"> /// The operation failed because AWS WAF didn't recognize a parameter in the request. /// For example: /// /// <ul> <li> /// <para> /// You specified an invalid parameter name. /// </para> /// </li> <li> /// <para> /// You specified an invalid value. /// </para> /// </li> <li> /// <para> /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>, /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>. /// </para> /// </li> <li> /// <para> /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code> /// other than HEADER, QUERY_STRING, or URI. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code> /// but no value for <code>Data</code>. /// </para> /// </li> <li> /// <para> /// Your request references an ARN that is malformed, or corresponds to a resource with /// which a web ACL cannot be associated. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException"> /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code> /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a> /// in the <i>AWS WAF Developer Guide</i>. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentContainerException"> /// The operation failed because you tried to add an object to or delete an object from /// another object that doesn't exist. For example: /// /// <ul> <li> /// <para> /// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code> /// from a <code>Rule</code> that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to or delete an IP address from an <code>IPSet</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code> /// from a <code>ByteMatchSet</code> that doesn't exist. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: /// /// <ul> <li> /// <para> /// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public UpdateRuleResponse UpdateRule(UpdateRuleRequest request) { var marshaller = new UpdateRuleRequestMarshaller(); var unmarshaller = UpdateRuleResponseUnmarshaller.Instance; return Invoke<UpdateRuleRequest,UpdateRuleResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Inserts or deletes <a>Predicate</a> objects in a <code>Rule</code>. Each <code>Predicate</code> /// object identifies a predicate, such as a <a>ByteMatchSet</a> or an <a>IPSet</a>, that /// specifies the web requests that you want to allow, block, or count. If you add more /// than one predicate to a <code>Rule</code>, a request must match all of the specifications /// to be allowed, blocked, or counted. For example, suppose you add the following to /// a <code>Rule</code>: /// /// <ul> <li> /// <para> /// A <code>ByteMatchSet</code> that matches the value <code>BadBot</code> in the <code>User-Agent</code> /// header /// </para> /// </li> <li> /// <para> /// An <code>IPSet</code> that matches the IP address <code>192.0.2.44</code> /// </para> /// </li> </ul> /// <para> /// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want /// to block requests that satisfy the <code>Rule</code>. For a request to be blocked, /// the <code>User-Agent</code> header in the request must contain the value <code>BadBot</code> /// <i>and</i> the request must originate from the IP address 192.0.2.44. /// </para> /// /// <para> /// To create and configure a <code>Rule</code>, perform the following steps: /// </para> /// <ol> <li> /// <para> /// Create and update the predicates that you want to include in the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create the <code>Rule</code>. See <a>CreateRule</a>. /// </para> /// </li> <li> /// <para> /// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> /// parameter of an <a>UpdateRule</a> request. /// </para> /// </li> <li> /// <para> /// Submit an <code>UpdateRule</code> request to add predicates to the <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. See <a>CreateWebACL</a>. /// </para> /// </li> </ol> /// <para> /// If you want to replace one <code>ByteMatchSet</code> or <code>IPSet</code> with another, /// you delete the existing one and add the new one. /// </para> /// /// <para> /// For more information about how to use the AWS WAF API to allow or block HTTP requests, /// see the <a href="http://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer /// Guide</a>. /// </para> /// </summary> /// <param name="ruleId">The <code>RuleId</code> of the <code>Rule</code> that you want to update. <code>RuleId</code> is returned by <code>CreateRule</code> and by <a>ListRules</a>.</param> /// <param name="updates">An array of <code>RuleUpdate</code> objects that you want to insert into or delete from a <a>Rule</a>. For more information, see the applicable data types: <ul> <li> <a>RuleUpdate</a>: Contains <code>Action</code> and <code>Predicate</code> </li> <li> <a>Predicate</a>: Contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code> </li> <li> <a>FieldToMatch</a>: Contains <code>Data</code> and <code>Type</code> </li> </ul></param> /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param> /// /// <returns>The response from the UpdateRule service method, as returned by WAFRegional.</returns> /// <exception cref="Amazon.WAFRegional.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidOperationException"> /// The operation failed because there was nothing to do. For example: /// /// <ul> <li> /// <para> /// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code> /// isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't /// in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>, /// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code> /// already exists in the specified <code>WebACL</code>. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to an <code>IPSet</code>, but the IP address already /// exists in the specified <code>IPSet</code>. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but /// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFInvalidParameterException"> /// The operation failed because AWS WAF didn't recognize a parameter in the request. /// For example: /// /// <ul> <li> /// <para> /// You specified an invalid parameter name. /// </para> /// </li> <li> /// <para> /// You specified an invalid value. /// </para> /// </li> <li> /// <para> /// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>, /// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>. /// </para> /// </li> <li> /// <para> /// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code> /// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code> /// other than HEADER, QUERY_STRING, or URI. /// </para> /// </li> <li> /// <para> /// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code> /// but no value for <code>Data</code>. /// </para> /// </li> <li> /// <para> /// Your request references an ARN that is malformed, or corresponds to a resource with /// which a web ACL cannot be associated. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFLimitsExceededException"> /// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code> /// objects that you can create for an AWS account. For more information, see <a href="http://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a> /// in the <i>AWS WAF Developer Guide</i>. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentContainerException"> /// The operation failed because you tried to add an object to or delete an object from /// another object that doesn't exist. For example: /// /// <ul> <li> /// <para> /// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code> /// from a <code>Rule</code> that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add an IP address to or delete an IP address from an <code>IPSet</code> /// that doesn't exist. /// </para> /// </li> <li> /// <para> /// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code> /// from a <code>ByteMatchSet</code> that doesn't exist. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: /// /// <ul> <li> /// <para> /// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>. /// </para> /// </li> <li> /// <para> /// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>. /// </para> /// </li> </ul> /// </exception> /// <exception cref="Amazon.WAFRegional.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public UpdateRuleResponse UpdateRule(string ruleId, List<RuleUpdate> updates, string changeToken) { var request = new UpdateRuleRequest(); request.RuleId = ruleId; request.Updates = updates; request.ChangeToken = changeToken; return UpdateRule(request); }
private Amazon.WAFRegional.Model.UpdateRuleResponse CallAWSServiceOperation(IAmazonWAFRegional client, Amazon.WAFRegional.Model.UpdateRuleRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS WAF Regional", "UpdateRule"); try { #if DESKTOP return(client.UpdateRule(request)); #elif CORECLR return(client.UpdateRuleAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Initiates the asynchronous execution of the UpdateRule operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRule operation on AmazonWAFRegionalClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRule /// operation.</returns> public IAsyncResult BeginUpdateRule(UpdateRuleRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateRuleRequestMarshaller(); var unmarshaller = UpdateRuleResponseUnmarshaller.Instance; return BeginInvoke<UpdateRuleRequest>(request, marshaller, unmarshaller, callback, state); }