/* * 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.securityhub.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* contains details about a rate-based rule for Regional resources. A rate-based rule provides settings to indicate when * to allow, block, or count a request. Rate-based rules include the number of requests that arrive over a specified * period of time. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsWafRegionalRateBasedRuleDetails implements Serializable, Cloneable, StructuredPojo { /** ** The name of the metrics for the rate-based rule. *
*/ private String metricName; /** ** The name of the rate-based rule. *
*/ private String name; /** ** The field that WAF uses to determine whether requests are likely arriving from single source and are subject to * rate monitoring. *
*/ private String rateKey; /** *
* The maximum number of requests that have an identical value for the field specified in RateKey
that
* are allowed within a five-minute period. If the number of requests exceeds RateLimit
and the other
* predicates specified in the rule are met, WAF triggers the action for the rule.
*
* The unique identifier for the rate-based rule. *
*/ private String ruleId; /** ** The predicates to include in the rate-based rule. *
*/ private java.util.List* The name of the metrics for the rate-based rule. *
* * @param metricName * The name of the metrics for the rate-based rule. */ public void setMetricName(String metricName) { this.metricName = metricName; } /** ** The name of the metrics for the rate-based rule. *
* * @return The name of the metrics for the rate-based rule. */ public String getMetricName() { return this.metricName; } /** ** The name of the metrics for the rate-based rule. *
* * @param metricName * The name of the metrics for the rate-based rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withMetricName(String metricName) { setMetricName(metricName); return this; } /** ** The name of the rate-based rule. *
* * @param name * The name of the rate-based rule. */ public void setName(String name) { this.name = name; } /** ** The name of the rate-based rule. *
* * @return The name of the rate-based rule. */ public String getName() { return this.name; } /** ** The name of the rate-based rule. *
* * @param name * The name of the rate-based rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withName(String name) { setName(name); return this; } /** ** The field that WAF uses to determine whether requests are likely arriving from single source and are subject to * rate monitoring. *
* * @param rateKey * The field that WAF uses to determine whether requests are likely arriving from single source and are * subject to rate monitoring. */ public void setRateKey(String rateKey) { this.rateKey = rateKey; } /** ** The field that WAF uses to determine whether requests are likely arriving from single source and are subject to * rate monitoring. *
* * @return The field that WAF uses to determine whether requests are likely arriving from single source and are * subject to rate monitoring. */ public String getRateKey() { return this.rateKey; } /** ** The field that WAF uses to determine whether requests are likely arriving from single source and are subject to * rate monitoring. *
* * @param rateKey * The field that WAF uses to determine whether requests are likely arriving from single source and are * subject to rate monitoring. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withRateKey(String rateKey) { setRateKey(rateKey); return this; } /** *
* The maximum number of requests that have an identical value for the field specified in RateKey
that
* are allowed within a five-minute period. If the number of requests exceeds RateLimit
and the other
* predicates specified in the rule are met, WAF triggers the action for the rule.
*
RateKey
that are allowed within a five-minute period. If the number of requests exceeds
* RateLimit
and the other predicates specified in the rule are met, WAF triggers the action for
* the rule.
*/
public void setRateLimit(Long rateLimit) {
this.rateLimit = rateLimit;
}
/**
*
* The maximum number of requests that have an identical value for the field specified in RateKey
that
* are allowed within a five-minute period. If the number of requests exceeds RateLimit
and the other
* predicates specified in the rule are met, WAF triggers the action for the rule.
*
RateKey
that are allowed within a five-minute period. If the number of requests exceeds
* RateLimit
and the other predicates specified in the rule are met, WAF triggers the action
* for the rule.
*/
public Long getRateLimit() {
return this.rateLimit;
}
/**
*
* The maximum number of requests that have an identical value for the field specified in RateKey
that
* are allowed within a five-minute period. If the number of requests exceeds RateLimit
and the other
* predicates specified in the rule are met, WAF triggers the action for the rule.
*
RateKey
that are allowed within a five-minute period. If the number of requests exceeds
* RateLimit
and the other predicates specified in the rule are met, WAF triggers the action for
* the rule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsWafRegionalRateBasedRuleDetails withRateLimit(Long rateLimit) {
setRateLimit(rateLimit);
return this;
}
/**
* * The unique identifier for the rate-based rule. *
* * @param ruleId * The unique identifier for the rate-based rule. */ public void setRuleId(String ruleId) { this.ruleId = ruleId; } /** ** The unique identifier for the rate-based rule. *
* * @return The unique identifier for the rate-based rule. */ public String getRuleId() { return this.ruleId; } /** ** The unique identifier for the rate-based rule. *
* * @param ruleId * The unique identifier for the rate-based rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withRuleId(String ruleId) { setRuleId(ruleId); return this; } /** ** The predicates to include in the rate-based rule. *
* * @return The predicates to include in the rate-based rule. */ public java.util.List* The predicates to include in the rate-based rule. *
* * @param matchPredicates * The predicates to include in the rate-based rule. */ public void setMatchPredicates(java.util.Collection* The predicates to include in the rate-based rule. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setMatchPredicates(java.util.Collection)} or {@link #withMatchPredicates(java.util.Collection)} if you * want to override the existing values. *
* * @param matchPredicates * The predicates to include in the rate-based rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withMatchPredicates(AwsWafRegionalRateBasedRuleMatchPredicate... matchPredicates) { if (this.matchPredicates == null) { setMatchPredicates(new java.util.ArrayList* The predicates to include in the rate-based rule. *
* * @param matchPredicates * The predicates to include in the rate-based rule. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafRegionalRateBasedRuleDetails withMatchPredicates(java.util.Collection