AWS SDK for C++

AWS SDK for C++ Version 1.11.607

Loading...
Searching...
No Matches
Rule.h
1
6#pragma once
7#include <aws/wafv2/WAFV2_EXPORTS.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/wafv2/model/Statement.h>
10#include <aws/wafv2/model/RuleAction.h>
11#include <aws/wafv2/model/OverrideAction.h>
12#include <aws/core/utils/memory/stl/AWSVector.h>
13#include <aws/wafv2/model/VisibilityConfig.h>
14#include <aws/wafv2/model/CaptchaConfig.h>
15#include <aws/wafv2/model/ChallengeConfig.h>
16#include <aws/wafv2/model/Label.h>
17#include <utility>
18
19namespace Aws
20{
21namespace Utils
22{
23namespace Json
24{
25 class JsonValue;
26 class JsonView;
27} // namespace Json
28} // namespace Utils
29namespace WAFV2
30{
31namespace Model
32{
33
42 class Rule
43 {
44 public:
45 AWS_WAFV2_API Rule() = default;
48 AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const;
49
50
52
58 inline const Aws::String& GetName() const { return m_name; }
59 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
60 template<typename NameT = Aws::String>
61 void SetName(NameT&& value) { m_nameHasBeenSet = true; m_name = std::forward<NameT>(value); }
62 template<typename NameT = Aws::String>
63 Rule& WithName(NameT&& value) { SetName(std::forward<NameT>(value)); return *this;}
65
67
73 inline int GetPriority() const { return m_priority; }
74 inline bool PriorityHasBeenSet() const { return m_priorityHasBeenSet; }
75 inline void SetPriority(int value) { m_priorityHasBeenSet = true; m_priority = value; }
76 inline Rule& WithPriority(int value) { SetPriority(value); return *this;}
78
80
84 inline const Statement& GetStatement() const { return m_statement; }
85 inline bool StatementHasBeenSet() const { return m_statementHasBeenSet; }
86 template<typename StatementT = Statement>
87 void SetStatement(StatementT&& value) { m_statementHasBeenSet = true; m_statement = std::forward<StatementT>(value); }
88 template<typename StatementT = Statement>
89 Rule& WithStatement(StatementT&& value) { SetStatement(std::forward<StatementT>(value)); return *this;}
91
93
106 inline const RuleAction& GetAction() const { return m_action; }
107 inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }
108 template<typename ActionT = RuleAction>
109 void SetAction(ActionT&& value) { m_actionHasBeenSet = true; m_action = std::forward<ActionT>(value); }
110 template<typename ActionT = RuleAction>
111 Rule& WithAction(ActionT&& value) { SetAction(std::forward<ActionT>(value)); return *this;}
113
115
127 inline const OverrideAction& GetOverrideAction() const { return m_overrideAction; }
128 inline bool OverrideActionHasBeenSet() const { return m_overrideActionHasBeenSet; }
129 template<typename OverrideActionT = OverrideAction>
130 void SetOverrideAction(OverrideActionT&& value) { m_overrideActionHasBeenSet = true; m_overrideAction = std::forward<OverrideActionT>(value); }
131 template<typename OverrideActionT = OverrideAction>
132 Rule& WithOverrideAction(OverrideActionT&& value) { SetOverrideAction(std::forward<OverrideActionT>(value)); return *this;}
134
136
155 inline const Aws::Vector<Label>& GetRuleLabels() const { return m_ruleLabels; }
156 inline bool RuleLabelsHasBeenSet() const { return m_ruleLabelsHasBeenSet; }
157 template<typename RuleLabelsT = Aws::Vector<Label>>
158 void SetRuleLabels(RuleLabelsT&& value) { m_ruleLabelsHasBeenSet = true; m_ruleLabels = std::forward<RuleLabelsT>(value); }
159 template<typename RuleLabelsT = Aws::Vector<Label>>
160 Rule& WithRuleLabels(RuleLabelsT&& value) { SetRuleLabels(std::forward<RuleLabelsT>(value)); return *this;}
161 template<typename RuleLabelsT = Label>
162 Rule& AddRuleLabels(RuleLabelsT&& value) { m_ruleLabelsHasBeenSet = true; m_ruleLabels.emplace_back(std::forward<RuleLabelsT>(value)); return *this; }
164
166
172 inline const VisibilityConfig& GetVisibilityConfig() const { return m_visibilityConfig; }
173 inline bool VisibilityConfigHasBeenSet() const { return m_visibilityConfigHasBeenSet; }
174 template<typename VisibilityConfigT = VisibilityConfig>
175 void SetVisibilityConfig(VisibilityConfigT&& value) { m_visibilityConfigHasBeenSet = true; m_visibilityConfig = std::forward<VisibilityConfigT>(value); }
176 template<typename VisibilityConfigT = VisibilityConfig>
177 Rule& WithVisibilityConfig(VisibilityConfigT&& value) { SetVisibilityConfig(std::forward<VisibilityConfigT>(value)); return *this;}
179
181
186 inline const CaptchaConfig& GetCaptchaConfig() const { return m_captchaConfig; }
187 inline bool CaptchaConfigHasBeenSet() const { return m_captchaConfigHasBeenSet; }
188 template<typename CaptchaConfigT = CaptchaConfig>
189 void SetCaptchaConfig(CaptchaConfigT&& value) { m_captchaConfigHasBeenSet = true; m_captchaConfig = std::forward<CaptchaConfigT>(value); }
190 template<typename CaptchaConfigT = CaptchaConfig>
191 Rule& WithCaptchaConfig(CaptchaConfigT&& value) { SetCaptchaConfig(std::forward<CaptchaConfigT>(value)); return *this;}
193
195
200 inline const ChallengeConfig& GetChallengeConfig() const { return m_challengeConfig; }
201 inline bool ChallengeConfigHasBeenSet() const { return m_challengeConfigHasBeenSet; }
202 template<typename ChallengeConfigT = ChallengeConfig>
203 void SetChallengeConfig(ChallengeConfigT&& value) { m_challengeConfigHasBeenSet = true; m_challengeConfig = std::forward<ChallengeConfigT>(value); }
204 template<typename ChallengeConfigT = ChallengeConfig>
205 Rule& WithChallengeConfig(ChallengeConfigT&& value) { SetChallengeConfig(std::forward<ChallengeConfigT>(value)); return *this;}
207 private:
208
209 Aws::String m_name;
210 bool m_nameHasBeenSet = false;
211
212 int m_priority{0};
213 bool m_priorityHasBeenSet = false;
214
215 Statement m_statement;
216 bool m_statementHasBeenSet = false;
217
218 RuleAction m_action;
219 bool m_actionHasBeenSet = false;
220
221 OverrideAction m_overrideAction;
222 bool m_overrideActionHasBeenSet = false;
223
224 Aws::Vector<Label> m_ruleLabels;
225 bool m_ruleLabelsHasBeenSet = false;
226
227 VisibilityConfig m_visibilityConfig;
228 bool m_visibilityConfigHasBeenSet = false;
229
230 CaptchaConfig m_captchaConfig;
231 bool m_captchaConfigHasBeenSet = false;
232
233 ChallengeConfig m_challengeConfig;
234 bool m_challengeConfigHasBeenSet = false;
235 };
236
237} // namespace Model
238} // namespace WAFV2
239} // namespace Aws
AWS_WAFV2_API Rule()=default
Rule & WithName(NameT &&value)
Definition Rule.h:63
void SetAction(ActionT &&value)
Definition Rule.h:109
Rule & WithStatement(StatementT &&value)
Definition Rule.h:89
const Aws::String & GetName() const
Definition Rule.h:58
bool NameHasBeenSet() const
Definition Rule.h:59
const Aws::Vector< Label > & GetRuleLabels() const
Definition Rule.h:155
Rule & WithCaptchaConfig(CaptchaConfigT &&value)
Definition Rule.h:191
const ChallengeConfig & GetChallengeConfig() const
Definition Rule.h:200
bool RuleLabelsHasBeenSet() const
Definition Rule.h:156
AWS_WAFV2_API Rule(Aws::Utils::Json::JsonView jsonValue)
Rule & WithChallengeConfig(ChallengeConfigT &&value)
Definition Rule.h:205
const OverrideAction & GetOverrideAction() const
Definition Rule.h:127
int GetPriority() const
Definition Rule.h:73
const Statement & GetStatement() const
Definition Rule.h:84
Rule & WithAction(ActionT &&value)
Definition Rule.h:111
Rule & WithPriority(int value)
Definition Rule.h:76
void SetChallengeConfig(ChallengeConfigT &&value)
Definition Rule.h:203
bool StatementHasBeenSet() const
Definition Rule.h:85
Rule & WithOverrideAction(OverrideActionT &&value)
Definition Rule.h:132
Rule & WithRuleLabels(RuleLabelsT &&value)
Definition Rule.h:160
bool VisibilityConfigHasBeenSet() const
Definition Rule.h:173
bool CaptchaConfigHasBeenSet() const
Definition Rule.h:187
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:87
const VisibilityConfig & GetVisibilityConfig() const
Definition Rule.h:172
void SetVisibilityConfig(VisibilityConfigT &&value)
Definition Rule.h:175
void SetName(NameT &&value)
Definition Rule.h:61
void SetCaptchaConfig(CaptchaConfigT &&value)
Definition Rule.h:189
const RuleAction & GetAction() const
Definition Rule.h:106
void SetRuleLabels(RuleLabelsT &&value)
Definition Rule.h:158
const CaptchaConfig & GetCaptchaConfig() const
Definition Rule.h:186
bool ActionHasBeenSet() const
Definition Rule.h:107
bool OverrideActionHasBeenSet() const
Definition Rule.h:128
Rule & WithVisibilityConfig(VisibilityConfigT &&value)
Definition Rule.h:177
void SetOverrideAction(OverrideActionT &&value)
Definition Rule.h:130
bool ChallengeConfigHasBeenSet() const
Definition Rule.h:201
AWS_WAFV2_API Aws::Utils::Json::JsonValue Jsonize() const
Rule & AddRuleLabels(RuleLabelsT &&value)
Definition Rule.h:162
std::shared_ptr< T > MakeShared(const char *allocationTag, ArgTypes &&... args)
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue