AWS SDK for C++

AWS SDK for C++ Version 1.11.747

Loading...
Searching...
No Matches
RateBasedRule.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/waf/WAF_EXPORTS.h>
10#include <aws/waf/model/Predicate.h>
11#include <aws/waf/model/RateKey.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Utils {
17namespace Json {
18class JsonValue;
19class JsonView;
20} // namespace Json
21} // namespace Utils
22namespace WAF {
23namespace Model {
24
49 public:
50 AWS_WAF_API RateBasedRule() = default;
54
56
65 inline const Aws::String& GetRuleId() const { return m_ruleId; }
66 inline bool RuleIdHasBeenSet() const { return m_ruleIdHasBeenSet; }
67 template <typename RuleIdT = Aws::String>
68 void SetRuleId(RuleIdT&& value) {
69 m_ruleIdHasBeenSet = true;
70 m_ruleId = std::forward<RuleIdT>(value);
71 }
72 template <typename RuleIdT = Aws::String>
73 RateBasedRule& WithRuleId(RuleIdT&& value) {
74 SetRuleId(std::forward<RuleIdT>(value));
75 return *this;
76 }
78
80
84 inline const Aws::String& GetName() const { return m_name; }
85 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
86 template <typename NameT = Aws::String>
87 void SetName(NameT&& value) {
88 m_nameHasBeenSet = true;
89 m_name = std::forward<NameT>(value);
90 }
91 template <typename NameT = Aws::String>
92 RateBasedRule& WithName(NameT&& value) {
93 SetName(std::forward<NameT>(value));
94 return *this;
95 }
97
99
107 inline const Aws::String& GetMetricName() const { return m_metricName; }
108 inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; }
109 template <typename MetricNameT = Aws::String>
110 void SetMetricName(MetricNameT&& value) {
111 m_metricNameHasBeenSet = true;
112 m_metricName = std::forward<MetricNameT>(value);
113 }
114 template <typename MetricNameT = Aws::String>
115 RateBasedRule& WithMetricName(MetricNameT&& value) {
116 SetMetricName(std::forward<MetricNameT>(value));
117 return *this;
118 }
120
122
128 inline const Aws::Vector<Predicate>& GetMatchPredicates() const { return m_matchPredicates; }
129 inline bool MatchPredicatesHasBeenSet() const { return m_matchPredicatesHasBeenSet; }
130 template <typename MatchPredicatesT = Aws::Vector<Predicate>>
131 void SetMatchPredicates(MatchPredicatesT&& value) {
132 m_matchPredicatesHasBeenSet = true;
133 m_matchPredicates = std::forward<MatchPredicatesT>(value);
134 }
135 template <typename MatchPredicatesT = Aws::Vector<Predicate>>
136 RateBasedRule& WithMatchPredicates(MatchPredicatesT&& value) {
137 SetMatchPredicates(std::forward<MatchPredicatesT>(value));
138 return *this;
139 }
140 template <typename MatchPredicatesT = Predicate>
141 RateBasedRule& AddMatchPredicates(MatchPredicatesT&& value) {
142 m_matchPredicatesHasBeenSet = true;
143 m_matchPredicates.emplace_back(std::forward<MatchPredicatesT>(value));
144 return *this;
145 }
147
149
156 inline RateKey GetRateKey() const { return m_rateKey; }
157 inline bool RateKeyHasBeenSet() const { return m_rateKeyHasBeenSet; }
158 inline void SetRateKey(RateKey value) {
159 m_rateKeyHasBeenSet = true;
160 m_rateKey = value;
161 }
163 SetRateKey(value);
164 return *this;
165 }
167
169
176 inline long long GetRateLimit() const { return m_rateLimit; }
177 inline bool RateLimitHasBeenSet() const { return m_rateLimitHasBeenSet; }
178 inline void SetRateLimit(long long value) {
179 m_rateLimitHasBeenSet = true;
180 m_rateLimit = value;
181 }
182 inline RateBasedRule& WithRateLimit(long long value) {
183 SetRateLimit(value);
184 return *this;
185 }
187 private:
188 Aws::String m_ruleId;
189
190 Aws::String m_name;
191
192 Aws::String m_metricName;
193
194 Aws::Vector<Predicate> m_matchPredicates;
195
196 RateKey m_rateKey{RateKey::NOT_SET};
197
198 long long m_rateLimit{0};
199 bool m_ruleIdHasBeenSet = false;
200 bool m_nameHasBeenSet = false;
201 bool m_metricNameHasBeenSet = false;
202 bool m_matchPredicatesHasBeenSet = false;
203 bool m_rateKeyHasBeenSet = false;
204 bool m_rateLimitHasBeenSet = false;
205};
206
207} // namespace Model
208} // namespace WAF
209} // namespace Aws
void SetRateKey(RateKey value)
RateBasedRule & WithRateKey(RateKey value)
RateBasedRule & WithName(NameT &&value)
RateBasedRule & WithMetricName(MetricNameT &&value)
const Aws::String & GetName() const
AWS_WAF_API RateBasedRule(Aws::Utils::Json::JsonView jsonValue)
AWS_WAF_API RateBasedRule()=default
RateBasedRule & AddMatchPredicates(MatchPredicatesT &&value)
void SetName(NameT &&value)
void SetRuleId(RuleIdT &&value)
AWS_WAF_API RateBasedRule & operator=(Aws::Utils::Json::JsonView jsonValue)
const Aws::Vector< Predicate > & GetMatchPredicates() const
void SetMatchPredicates(MatchPredicatesT &&value)
const Aws::String & GetRuleId() const
void SetMetricName(MetricNameT &&value)
RateBasedRule & WithRuleId(RuleIdT &&value)
RateBasedRule & WithMatchPredicates(MatchPredicatesT &&value)
RateBasedRule & WithRateLimit(long long value)
const Aws::String & GetMetricName() const
AWS_WAF_API Aws::Utils::Json::JsonValue Jsonize() const
void SetRateLimit(long long value)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue