/* * 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.wafv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The set of IP addresses that are currently blocked for a RateBasedStatement. This is only available for
* rate-based rules that aggregate on just the IP address, with the AggregateKeyType
set to IP
* or FORWARDED_IP
.
*
* A rate-based rule applies its rule action to requests from IP addresses that are in the rule's managed keys list and * that match the rule's scope-down statement. When a rule has no scope-down statement, it applies the action to all * requests from the IP addresses that are in the list. The rule applies its rule action to rate limit the matching * requests. The action is usually Block but it can be any valid rule action except for Allow. *
** The maximum number of IP addresses that can be rate limited by a single rate-based rule instance is 10,000. If more * than 10,000 addresses exceed the rate limit, WAF limits those with the highest rates. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RateBasedStatementManagedKeysIPSet implements Serializable, Cloneable, StructuredPojo { /** *
* The version of the IP addresses, either IPV4
or IPV6
.
*
* The IP addresses that are currently blocked. *
*/ private java.util.List
* The version of the IP addresses, either IPV4
or IPV6
.
*
IPV4
or IPV6
.
* @see IPAddressVersion
*/
public void setIPAddressVersion(String iPAddressVersion) {
this.iPAddressVersion = iPAddressVersion;
}
/**
*
* The version of the IP addresses, either IPV4
or IPV6
.
*
IPV4
or IPV6
.
* @see IPAddressVersion
*/
public String getIPAddressVersion() {
return this.iPAddressVersion;
}
/**
*
* The version of the IP addresses, either IPV4
or IPV6
.
*
IPV4
or IPV6
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IPAddressVersion
*/
public RateBasedStatementManagedKeysIPSet withIPAddressVersion(String iPAddressVersion) {
setIPAddressVersion(iPAddressVersion);
return this;
}
/**
*
* The version of the IP addresses, either IPV4
or IPV6
.
*
IPV4
or IPV6
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IPAddressVersion
*/
public RateBasedStatementManagedKeysIPSet withIPAddressVersion(IPAddressVersion iPAddressVersion) {
this.iPAddressVersion = iPAddressVersion.toString();
return this;
}
/**
* * The IP addresses that are currently blocked. *
* * @return The IP addresses that are currently blocked. */ public java.util.List* The IP addresses that are currently blocked. *
* * @param addresses * The IP addresses that are currently blocked. */ public void setAddresses(java.util.Collection* The IP addresses that are currently blocked. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAddresses(java.util.Collection)} or {@link #withAddresses(java.util.Collection)} if you want to * override the existing values. *
* * @param addresses * The IP addresses that are currently blocked. * @return Returns a reference to this object so that method calls can be chained together. */ public RateBasedStatementManagedKeysIPSet withAddresses(String... addresses) { if (this.addresses == null) { setAddresses(new java.util.ArrayList* The IP addresses that are currently blocked. *
* * @param addresses * The IP addresses that are currently blocked. * @return Returns a reference to this object so that method calls can be chained together. */ public RateBasedStatementManagedKeysIPSet withAddresses(java.util.Collection