/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.waf; import javax.annotation.Generated; import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.waf.model.*; /** * Interface for accessing WAF. *

* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from * {@link com.amazonaws.services.waf.AbstractAWSWAF} instead. *

*

* *

* This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the * developer guide. *

*

* For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the * latest version, AWS WAF has a single set of endpoints for regional and global use. *

* *

* This is the AWS WAF Classic API Reference for using AWS WAF Classic with Amazon CloudFront. The AWS WAF * Classic actions and data types listed in the reference are available for protecting Amazon CloudFront distributions. * You can use these actions and data types via the endpoint waf.amazonaws.com. This guide is for developers who * need detailed information about the AWS WAF Classic API actions, data types, and errors. For detailed information * about AWS WAF Classic features and an overview of how to use the AWS WAF Classic API, see the AWS WAF Classic in the * developer guide. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public interface AWSWAF { /** * The region metadata service name for computing region endpoints. You can use this value to retrieve metadata * (such as supported regions) of the service. * * @see RegionUtils#getRegionsForService(String) */ String ENDPOINT_PREFIX = "waf"; /** * Overrides the default endpoint for this client ("https://waf.amazonaws.com/"). Callers can use this method to * control which AWS region they want to work with. *

* Callers can pass in just the endpoint (ex: "waf.amazonaws.com/") or a full URL, including the protocol (ex: * "https://waf.amazonaws.com/"). If the protocol is not specified here, the default protocol from this client's * {@link ClientConfiguration} will be used, which by default is HTTPS. *

* For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available * endpoints for all AWS services, see: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection- * choose-endpoint *

* This method is not threadsafe. An endpoint should be configured when the client is created and before any * service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in * transit or retrying. * * @param endpoint * The endpoint (ex: "waf.amazonaws.com/") or a full URL, including the protocol (ex: * "https://waf.amazonaws.com/") of the region specific AWS endpoint this client will communicate with. * @deprecated use {@link AwsClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)} for * example: * {@code builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));} */ @Deprecated void setEndpoint(String endpoint); /** * An alternative to {@link AWSWAF#setEndpoint(String)}, sets the regional endpoint for this client's service calls. * Callers can use this method to control which AWS region they want to work with. *

* By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the * {@link ClientConfiguration} supplied at construction. *

* This method is not threadsafe. A region should be configured when the client is created and before any service * requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit * or retrying. * * @param region * The region this client will communicate with. See {@link Region#getRegion(com.amazonaws.regions.Regions)} * for accessing a given region. Must not be null and must be a region where the service is available. * * @see Region#getRegion(com.amazonaws.regions.Regions) * @see Region#createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration) * @see Region#isServiceSupported(String) * @deprecated use {@link AwsClientBuilder#setRegion(String)} */ @Deprecated void setRegion(Region region); /** * *

* This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the * developer guide. *

*

* For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With * the latest version, AWS WAF has a single set of endpoints for regional and global use. *

* *

* Creates a ByteMatchSet. You then use UpdateByteMatchSet to identify the part of a web request * that you want AWS WAF to inspect, such as the values of the User-Agent header or the query string. * For example, you can create a ByteMatchSet that matches any requests with User-Agent * headers that contain the string BadBot. You can then configure AWS WAF to reject those requests. *

*

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

*
    *
  1. *

    * Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of a * CreateByteMatchSet request. *

    *
  2. *
  3. *

    * Submit a CreateByteMatchSet request. *

    *
  4. *
  5. *

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

    *
  6. *
  7. *

    * 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. *

    *
  8. *
*

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

* * @param createByteMatchSetRequest * @return Result of the CreateByteMatchSet operation returned by the service. * @throws WAFDisallowedNameException * The name specified is invalid. * @throws WAFInternalErrorException * The operation failed because of a system problem, even though the request was valid. Retry your request. * @throws WAFInvalidAccountException * The operation failed because you tried to create, update, or delete an object by using an invalid account * identifier. * @throws WAFInvalidParameterException * The operation failed because AWS WAF didn't recognize a parameter in the request. For example:

*