Container for the parameters to the UpdateByteMatchSet operation. Inserts or deletes ByteMatchTuple objects (filters) in a ByteMatchSet. For each ByteMatchTuple object, you specify the following values:
  • Whether to insert or delete the object from the array. If you want to change a ByteMatchSetUpdate object, you delete the existing object and add a new one.

  • The part of a web request that you want AWS WAF to inspect, such as a query string or the value of the User-Agent header.

  • The bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to look for. For more information, including how you specify the values for the AWS WAF API and the AWS CLI or SDKs, see TargetString in the ByteMatchTuple data type.

  • Where to look, such as at the beginning or the end of a query string.

  • Whether to perform any conversions on the request, such as converting it to lowercase, before inspecting it for the specified string.

For example, you can add a ByteMatchSetUpdate object that matches web requests in which User-Agent headers contain the string BadBot. You can then configure AWS WAF to block those requests.

To create and configure a ByteMatchSet, perform the following steps:

  1. Create a ByteMatchSet. For more information, see CreateByteMatchSet.

  2. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateByteMatchSet request.

  3. Submit an UpdateByteMatchSet request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the value that you want AWS WAF to watch for.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.

Inheritance: AmazonWAFRegionalRequest
Ejemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.WAFRegional.Model.UpdateByteMatchSetRequest();

            if (cmdletContext.ByteMatchSetId != null)
            {
                request.ByteMatchSetId = cmdletContext.ByteMatchSetId;
            }
            if (cmdletContext.ChangeToken != null)
            {
                request.ChangeToken = cmdletContext.ChangeToken;
            }
            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);
        }
Ejemplo n.º 2
0
 private Amazon.WAFRegional.Model.UpdateByteMatchSetResponse CallAWSServiceOperation(IAmazonWAFRegional client, Amazon.WAFRegional.Model.UpdateByteMatchSetRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS WAF Regional", "UpdateByteMatchSet");
     try
     {
         #if DESKTOP
         return(client.UpdateByteMatchSet(request));
         #elif CORECLR
         return(client.UpdateByteMatchSetAsync(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;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateByteMatchSet operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateByteMatchSet 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<UpdateByteMatchSetResponse> UpdateByteMatchSetAsync(UpdateByteMatchSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateByteMatchSetRequestMarshaller();
            var unmarshaller = UpdateByteMatchSetResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateByteMatchSetRequest,UpdateByteMatchSetResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Inserts or deletes <a>ByteMatchTuple</a> objects (filters) in a <a>ByteMatchSet</a>.
 /// For each <code>ByteMatchTuple</code> object, you specify the following values: 
 /// 
 ///  <ul> <li> 
 /// <para>
 /// Whether to insert or delete the object from the array. If you want to change a <code>ByteMatchSetUpdate</code>
 /// object, you delete the existing object and add a new one.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// The part of a web request that you want AWS WAF to inspect, such as a query string
 /// or the value of the <code>User-Agent</code> header. 
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// The bytes (typically a string that corresponds with ASCII characters) that you want
 /// AWS WAF to look for. For more information, including how you specify the values for
 /// the AWS WAF API and the AWS CLI or SDKs, see <code>TargetString</code> in the <a>ByteMatchTuple</a>
 /// data type. 
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Where to look, such as at the beginning or the end of a query string.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Whether to perform any conversions on the request, such as converting it to lowercase,
 /// before inspecting it for the specified string.
 /// </para>
 ///  </li> </ul> 
 /// <para>
 /// For example, you can add a <code>ByteMatchSetUpdate</code> object that matches web
 /// requests in which <code>User-Agent</code> headers contain the string <code>BadBot</code>.
 /// You can then configure AWS WAF to block those requests.
 /// </para>
 ///  
 /// <para>
 /// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
 /// </para>
 ///  <ol> <li> 
 /// <para>
 /// Create a <code>ByteMatchSet.</code> For more information, see <a>CreateByteMatchSet</a>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of an <code>UpdateByteMatchSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit an <code>UpdateByteMatchSet</code> request to specify the part of the request
 /// that you want AWS WAF to inspect (for example, the header or the URI) and the value
 /// that you want AWS WAF to watch for.
 /// </para>
 ///  </li> </ol> 
 /// <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="byteMatchSetId">The <code>ByteMatchSetId</code> of the <a>ByteMatchSet</a> that you want to update. <code>ByteMatchSetId</code> is returned by <a>CreateByteMatchSet</a> and by <a>ListByteMatchSets</a>.</param>
 /// <param name="updates">An array of <code>ByteMatchSetUpdate</code> objects that you want to insert into or delete from a <a>ByteMatchSet</a>. For more information, see the applicable data types: <ul> <li>  <a>ByteMatchSetUpdate</a>: Contains <code>Action</code> and <code>ByteMatchTuple</code>  </li> <li>  <a>ByteMatchTuple</a>: Contains <code>FieldToMatch</code>, <code>PositionalConstraint</code>, <code>TargetString</code>, and <code>TextTransformation</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 UpdateByteMatchSet 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.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<UpdateByteMatchSetResponse> UpdateByteMatchSetAsync(string byteMatchSetId, List<ByteMatchSetUpdate> updates, string changeToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new UpdateByteMatchSetRequest();
     request.ByteMatchSetId = byteMatchSetId;
     request.Updates = updates;
     request.ChangeToken = changeToken;
     return UpdateByteMatchSetAsync(request, cancellationToken);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Inserts or deletes <a>ByteMatchTuple</a> objects (filters) in a <a>ByteMatchSet</a>.
        /// For each <code>ByteMatchTuple</code> object, you specify the following values: 
        /// 
        ///  <ul> <li> 
        /// <para>
        /// Whether to insert or delete the object from the array. If you want to change a <code>ByteMatchSetUpdate</code>
        /// object, you delete the existing object and add a new one.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// The part of a web request that you want AWS WAF to inspect, such as a query string
        /// or the value of the <code>User-Agent</code> header. 
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// The bytes (typically a string that corresponds with ASCII characters) that you want
        /// AWS WAF to look for. For more information, including how you specify the values for
        /// the AWS WAF API and the AWS CLI or SDKs, see <code>TargetString</code> in the <a>ByteMatchTuple</a>
        /// data type. 
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Where to look, such as at the beginning or the end of a query string.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Whether to perform any conversions on the request, such as converting it to lowercase,
        /// before inspecting it for the specified string.
        /// </para>
        ///  </li> </ul> 
        /// <para>
        /// For example, you can add a <code>ByteMatchSetUpdate</code> object that matches web
        /// requests in which <code>User-Agent</code> headers contain the string <code>BadBot</code>.
        /// You can then configure AWS WAF to block those requests.
        /// </para>
        ///  
        /// <para>
        /// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
        /// </para>
        ///  <ol> <li> 
        /// <para>
        /// Create a <code>ByteMatchSet.</code> For more information, see <a>CreateByteMatchSet</a>.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
        /// parameter of an <code>UpdateByteMatchSet</code> request.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Submit an <code>UpdateByteMatchSet</code> request to specify the part of the request
        /// that you want AWS WAF to inspect (for example, the header or the URI) and the value
        /// that you want AWS WAF to watch for.
        /// </para>
        ///  </li> </ol> 
        /// <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 UpdateByteMatchSet service method.</param>
        /// 
        /// <returns>The response from the UpdateByteMatchSet 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.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 UpdateByteMatchSetResponse UpdateByteMatchSet(UpdateByteMatchSetRequest request)
        {
            var marshaller = new UpdateByteMatchSetRequestMarshaller();
            var unmarshaller = UpdateByteMatchSetResponseUnmarshaller.Instance;

            return Invoke<UpdateByteMatchSetRequest,UpdateByteMatchSetResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Inserts or deletes <a>ByteMatchTuple</a> objects (filters) in a <a>ByteMatchSet</a>.
 /// For each <code>ByteMatchTuple</code> object, you specify the following values: 
 /// 
 ///  <ul> <li> 
 /// <para>
 /// Whether to insert or delete the object from the array. If you want to change a <code>ByteMatchSetUpdate</code>
 /// object, you delete the existing object and add a new one.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// The part of a web request that you want AWS WAF to inspect, such as a query string
 /// or the value of the <code>User-Agent</code> header. 
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// The bytes (typically a string that corresponds with ASCII characters) that you want
 /// AWS WAF to look for. For more information, including how you specify the values for
 /// the AWS WAF API and the AWS CLI or SDKs, see <code>TargetString</code> in the <a>ByteMatchTuple</a>
 /// data type. 
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Where to look, such as at the beginning or the end of a query string.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Whether to perform any conversions on the request, such as converting it to lowercase,
 /// before inspecting it for the specified string.
 /// </para>
 ///  </li> </ul> 
 /// <para>
 /// For example, you can add a <code>ByteMatchSetUpdate</code> object that matches web
 /// requests in which <code>User-Agent</code> headers contain the string <code>BadBot</code>.
 /// You can then configure AWS WAF to block those requests.
 /// </para>
 ///  
 /// <para>
 /// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
 /// </para>
 ///  <ol> <li> 
 /// <para>
 /// Create a <code>ByteMatchSet.</code> For more information, see <a>CreateByteMatchSet</a>.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
 /// parameter of an <code>UpdateByteMatchSet</code> request.
 /// </para>
 ///  </li> <li> 
 /// <para>
 /// Submit an <code>UpdateByteMatchSet</code> request to specify the part of the request
 /// that you want AWS WAF to inspect (for example, the header or the URI) and the value
 /// that you want AWS WAF to watch for.
 /// </para>
 ///  </li> </ol> 
 /// <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="byteMatchSetId">The <code>ByteMatchSetId</code> of the <a>ByteMatchSet</a> that you want to update. <code>ByteMatchSetId</code> is returned by <a>CreateByteMatchSet</a> and by <a>ListByteMatchSets</a>.</param>
 /// <param name="updates">An array of <code>ByteMatchSetUpdate</code> objects that you want to insert into or delete from a <a>ByteMatchSet</a>. For more information, see the applicable data types: <ul> <li>  <a>ByteMatchSetUpdate</a>: Contains <code>Action</code> and <code>ByteMatchTuple</code>  </li> <li>  <a>ByteMatchTuple</a>: Contains <code>FieldToMatch</code>, <code>PositionalConstraint</code>, <code>TargetString</code>, and <code>TextTransformation</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 UpdateByteMatchSet 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.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 UpdateByteMatchSetResponse UpdateByteMatchSet(string byteMatchSetId, List<ByteMatchSetUpdate> updates, string changeToken)
 {
     var request = new UpdateByteMatchSetRequest();
     request.ByteMatchSetId = byteMatchSetId;
     request.Updates = updates;
     request.ChangeToken = changeToken;
     return UpdateByteMatchSet(request);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateByteMatchSet operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateByteMatchSet 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 EndUpdateByteMatchSet
        ///         operation.</returns>
        public IAsyncResult BeginUpdateByteMatchSet(UpdateByteMatchSetRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateByteMatchSetRequestMarshaller();
            var unmarshaller = UpdateByteMatchSetResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateByteMatchSetRequest>(request, marshaller, unmarshaller,
                callback, state);
        }