AWS SDK for C++

AWS SDK for C++ Version 1.11.931

Loading...
Searching...
No Matches
Rule.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/wafv2/WAFV2_EXPORTS.h>
10#include <aws/wafv2/model/CaptchaConfig.h>
11#include <aws/wafv2/model/ChallengeConfig.h>
12#include <aws/wafv2/model/Label.h>
13#include <aws/wafv2/model/OverrideAction.h>
14#include <aws/wafv2/model/RuleAction.h>
15#include <aws/wafv2/model/Statement.h>
16#include <aws/wafv2/model/VisibilityConfig.h>
17
18#include <utility>
19
20namespace Aws {
21namespace Utils {
22namespace Json {
23class JsonValue;
24class JsonView;
25} // namespace Json
26} // namespace Utils
27namespace WAFV2 {
28namespace Model {
29
38class Rule {
39 public:
40 AWS_WAFV2_API Rule() = default;
41 AWS_WAFV2_API Rule(Aws::Utils::Json::JsonView jsonValue);
42 AWS_WAFV2_API Rule& operator=(Aws::Utils::Json::JsonView jsonValue);
43 AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const;
44
46
52 inline const Aws::String& GetName() const { return m_name; }
53 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
54 template <typename NameT = Aws::String>
55 void SetName(NameT&& value) {
56 m_nameHasBeenSet = true;
57 m_name = std::forward<NameT>(value);
58 }
59 template <typename NameT = Aws::String>
60 Rule& WithName(NameT&& value) {
61 SetName(std::forward<NameT>(value));
62 return *this;
63 }
65
67
73 inline int GetPriority() const { return m_priority; }
74 inline bool PriorityHasBeenSet() const { return m_priorityHasBeenSet; }
75 inline void SetPriority(int value) {
76 m_priorityHasBeenSet = true;
77 m_priority = value;
78 }
79 inline Rule& WithPriority(int value) {
80 SetPriority(value);
81 return *this;
82 }
84
86
90 inline const Statement& GetStatement() const { return m_statement; }
91 inline bool StatementHasBeenSet() const { return m_statementHasBeenSet; }
92 template <typename StatementT = Statement>
93 void SetStatement(StatementT&& value) {
94 m_statementHasBeenSet = true;
95 m_statement = std::forward<StatementT>(value);
96 }
97 template <typename StatementT = Statement>
98 Rule& WithStatement(StatementT&& value) {
99 SetStatement(std::forward<StatementT>(value));
100 return *this;
101 }
103
105
118 inline const RuleAction& GetAction() const { return m_action; }
119 inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }
120 template <typename ActionT = RuleAction>
121 void SetAction(ActionT&& value) {
122 m_actionHasBeenSet = true;
123 m_action = std::forward<ActionT>(value);
124 }
125 template <typename ActionT = RuleAction>
126 Rule& WithAction(ActionT&& value) {
127 SetAction(std::forward<ActionT>(value));
128 return *this;
129 }
131
133
145 inline const OverrideAction& GetOverrideAction() const { return m_overrideAction; }
146 inline bool OverrideActionHasBeenSet() const { return m_overrideActionHasBeenSet; }
147 template <typename OverrideActionT = OverrideAction>
148 void SetOverrideAction(OverrideActionT&& value) {
149 m_overrideActionHasBeenSet = true;
150 m_overrideAction = std::forward<OverrideActionT>(value);
151 }
152 template <typename OverrideActionT = OverrideAction>
153 Rule& WithOverrideAction(OverrideActionT&& value) {
154 SetOverrideAction(std::forward<OverrideActionT>(value));
155 return *this;
156 }
158
160
179 inline const Aws::Vector<Label>& GetRuleLabels() const { return m_ruleLabels; }
180 inline bool RuleLabelsHasBeenSet() const { return m_ruleLabelsHasBeenSet; }
181 template <typename RuleLabelsT = Aws::Vector<Label>>
182 void SetRuleLabels(RuleLabelsT&& value) {
183 m_ruleLabelsHasBeenSet = true;
184 m_ruleLabels = std::forward<RuleLabelsT>(value);
185 }
186 template <typename RuleLabelsT = Aws::Vector<Label>>
187 Rule& WithRuleLabels(RuleLabelsT&& value) {
188 SetRuleLabels(std::forward<RuleLabelsT>(value));
189 return *this;
190 }
191 template <typename RuleLabelsT = Label>
192 Rule& AddRuleLabels(RuleLabelsT&& value) {
193 m_ruleLabelsHasBeenSet = true;
194 m_ruleLabels.emplace_back(std::forward<RuleLabelsT>(value));
195 return *this;
196 }
198
200
206 inline const VisibilityConfig& GetVisibilityConfig() const { return m_visibilityConfig; }
207 inline bool VisibilityConfigHasBeenSet() const { return m_visibilityConfigHasBeenSet; }
208 template <typename VisibilityConfigT = VisibilityConfig>
209 void SetVisibilityConfig(VisibilityConfigT&& value) {
210 m_visibilityConfigHasBeenSet = true;
211 m_visibilityConfig = std::forward<VisibilityConfigT>(value);
212 }
213 template <typename VisibilityConfigT = VisibilityConfig>
214 Rule& WithVisibilityConfig(VisibilityConfigT&& value) {
215 SetVisibilityConfig(std::forward<VisibilityConfigT>(value));
216 return *this;
217 }
219
221
226 inline const CaptchaConfig& GetCaptchaConfig() const { return m_captchaConfig; }
227 inline bool CaptchaConfigHasBeenSet() const { return m_captchaConfigHasBeenSet; }
228 template <typename CaptchaConfigT = CaptchaConfig>
229 void SetCaptchaConfig(CaptchaConfigT&& value) {
230 m_captchaConfigHasBeenSet = true;
231 m_captchaConfig = std::forward<CaptchaConfigT>(value);
232 }
233 template <typename CaptchaConfigT = CaptchaConfig>
234 Rule& WithCaptchaConfig(CaptchaConfigT&& value) {
235 SetCaptchaConfig(std::forward<CaptchaConfigT>(value));
236 return *this;
237 }
239
241
246 inline const ChallengeConfig& GetChallengeConfig() const { return m_challengeConfig; }
247 inline bool ChallengeConfigHasBeenSet() const { return m_challengeConfigHasBeenSet; }
248 template <typename ChallengeConfigT = ChallengeConfig>
249 void SetChallengeConfig(ChallengeConfigT&& value) {
250 m_challengeConfigHasBeenSet = true;
251 m_challengeConfig = std::forward<ChallengeConfigT>(value);
252 }
253 template <typename ChallengeConfigT = ChallengeConfig>
254 Rule& WithChallengeConfig(ChallengeConfigT&& value) {
255 SetChallengeConfig(std::forward<ChallengeConfigT>(value));
256 return *this;
257 }
259 private:
260 Aws::String m_name;
261
262 int m_priority{0};
263
264 Statement m_statement;
265
266 RuleAction m_action;
267
268 OverrideAction m_overrideAction;
269
270 Aws::Vector<Label> m_ruleLabels;
271
272 VisibilityConfig m_visibilityConfig;
273
274 CaptchaConfig m_captchaConfig;
275
276 ChallengeConfig m_challengeConfig;
277 bool m_nameHasBeenSet = false;
278 bool m_priorityHasBeenSet = false;
279 bool m_statementHasBeenSet = false;
280 bool m_actionHasBeenSet = false;
281 bool m_overrideActionHasBeenSet = false;
282 bool m_ruleLabelsHasBeenSet = false;
283 bool m_visibilityConfigHasBeenSet = false;
284 bool m_captchaConfigHasBeenSet = false;
285 bool m_challengeConfigHasBeenSet = false;
286};
287
288} // namespace Model
289} // namespace WAFV2
290} // namespace Aws
AWS_WAFV2_API Rule()=default
Rule & WithName(NameT &&value)
Definition Rule.h:60
void SetAction(ActionT &&value)
Definition Rule.h:121
Rule & WithStatement(StatementT &&value)
Definition Rule.h:98
const Aws::String & GetName() const
Definition Rule.h:52
bool NameHasBeenSet() const
Definition Rule.h:53
const Aws::Vector< Label > & GetRuleLabels() const
Definition Rule.h:179
Rule & WithCaptchaConfig(CaptchaConfigT &&value)
Definition Rule.h:234
const ChallengeConfig & GetChallengeConfig() const
Definition Rule.h:246
bool RuleLabelsHasBeenSet() const
Definition Rule.h:180
AWS_WAFV2_API Rule(Aws::Utils::Json::JsonView jsonValue)
Rule & WithChallengeConfig(ChallengeConfigT &&value)
Definition Rule.h:254
const OverrideAction & GetOverrideAction() const
Definition Rule.h:145
int GetPriority() const
Definition Rule.h:73
const Statement & GetStatement() const
Definition Rule.h:90
Rule & WithAction(ActionT &&value)
Definition Rule.h:126
Rule & WithPriority(int value)
Definition Rule.h:79
void SetChallengeConfig(ChallengeConfigT &&value)
Definition Rule.h:249
bool StatementHasBeenSet() const
Definition Rule.h:91
Rule & WithOverrideAction(OverrideActionT &&value)
Definition Rule.h:153
Rule & WithRuleLabels(RuleLabelsT &&value)
Definition Rule.h:187
bool VisibilityConfigHasBeenSet() const
Definition Rule.h:207
bool CaptchaConfigHasBeenSet() const
Definition Rule.h:227
bool PriorityHasBeenSet() const
Definition Rule.h:74
AWS_WAFV2_API Rule & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetPriority(int value)
Definition Rule.h:75
void SetStatement(StatementT &&value)
Definition Rule.h:93
const VisibilityConfig & GetVisibilityConfig() const
Definition Rule.h:206
void SetVisibilityConfig(VisibilityConfigT &&value)
Definition Rule.h:209
void SetName(NameT &&value)
Definition Rule.h:55
void SetCaptchaConfig(CaptchaConfigT &&value)
Definition Rule.h:229
const RuleAction & GetAction() const
Definition Rule.h:118
void SetRuleLabels(RuleLabelsT &&value)
Definition Rule.h:182
const CaptchaConfig & GetCaptchaConfig() const
Definition Rule.h:226
bool ActionHasBeenSet() const
Definition Rule.h:119
bool OverrideActionHasBeenSet() const
Definition Rule.h:146
Rule & WithVisibilityConfig(VisibilityConfigT &&value)
Definition Rule.h:214
void SetOverrideAction(OverrideActionT &&value)
Definition Rule.h:148
bool ChallengeConfigHasBeenSet() const
Definition Rule.h:247
AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const
Rule & AddRuleLabels(RuleLabelsT &&value)
Definition Rule.h:192
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue