/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the waf-2015-08-24.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.WAF.Model
{
///
/// Container for the parameters to the UpdateRateBasedRule operation.
///
///
/// 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.
///
///
///
/// Inserts or deletes Predicate objects in a rule and updates the RateLimit
/// in the rule.
///
///
///
/// Each Predicate
object identifies a predicate, such as a ByteMatchSet
/// or an IPSet, that specifies the web requests that you want to block or count.
/// The RateLimit
specifies the number of requests every five minutes that
/// triggers the rule.
///
///
///
/// If you add more than one predicate to a RateBasedRule
, a request must
/// match all the predicates and exceed the RateLimit
to be counted or blocked.
/// For example, suppose you add the following to a RateBasedRule
:
///
/// -
///
/// An
IPSet
that matches the IP address 192.0.2.44/32
///
/// -
///
/// A
ByteMatchSet
that matches BadBot
in the User-Agent
/// header
///
///
///
/// Further, you specify a RateLimit
of 1,000.
///
///
///
/// You then add the RateBasedRule
to a WebACL
and specify that
/// you want to block requests that satisfy the rule. For a request to be blocked, it
/// must come from the IP address 192.0.2.44 and the User-Agent
header
/// in the request must contain the value BadBot
. Further, requests that
/// match these two conditions much be received at a rate of more than 1,000 every five
/// minutes. If the rate drops below this limit, AWS WAF no longer blocks the requests.
///
///
///
/// As a second example, suppose you want to limit requests to a particular page on your
/// site. To do this, you could add the following to a RateBasedRule
:
///
/// -
///
/// A
ByteMatchSet
with FieldToMatch
of URI
///
/// -
///
/// A
PositionalConstraint
of STARTS_WITH
///
/// -
///
/// A
TargetString
of login
///
///
///
/// Further, you specify a RateLimit
of 1,000.
///
///
///
/// By adding this RateBasedRule
to a WebACL
, you could limit
/// requests to your login page without affecting the rest of your site.
///
///
public partial class UpdateRateBasedRuleRequest : AmazonWAFRequest
{
private string _changeToken;
private long? _rateLimit;
private string _ruleId;
private List _updates = new List();
///
/// Gets and sets the property ChangeToken.
///
/// The value returned by the most recent call to GetChangeToken.
///
///
[AWSProperty(Required=true, Min=1, Max=128)]
public string ChangeToken
{
get { return this._changeToken; }
set { this._changeToken = value; }
}
// Check to see if ChangeToken property is set
internal bool IsSetChangeToken()
{
return this._changeToken != null;
}
///
/// Gets and sets the property RateLimit.
///
/// The maximum number of requests, which have an identical value in the field specified
/// by the RateKey
, allowed in a five-minute period. If the number of requests
/// exceeds the RateLimit
and the other predicates specified in the rule
/// are also met, AWS WAF triggers the action that is specified for this rule.
///
///
[AWSProperty(Required=true, Min=100, Max=2000000000)]
public long RateLimit
{
get { return this._rateLimit.GetValueOrDefault(); }
set { this._rateLimit = value; }
}
// Check to see if RateLimit property is set
internal bool IsSetRateLimit()
{
return this._rateLimit.HasValue;
}
///
/// Gets and sets the property RuleId.
///
/// The RuleId
of the RateBasedRule
that you want to update.
/// RuleId
is returned by CreateRateBasedRule
and by ListRateBasedRules.
///
///
[AWSProperty(Required=true, Min=1, Max=128)]
public string RuleId
{
get { return this._ruleId; }
set { this._ruleId = value; }
}
// Check to see if RuleId property is set
internal bool IsSetRuleId()
{
return this._ruleId != null;
}
///
/// Gets and sets the property Updates.
///
/// An array of RuleUpdate
objects that you want to insert into or delete
/// from a RateBasedRule.
///
///
[AWSProperty(Required=true)]
public List Updates
{
get { return this._updates; }
set { this._updates = value; }
}
// Check to see if Updates property is set
internal bool IsSetUpdates()
{
return this._updates != null && this._updates.Count > 0;
}
}
}