1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/wafv2/WAFV2_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSString.h> 9 #include <aws/wafv2/model/FirewallManagerStatement.h> 10 #include <aws/wafv2/model/OverrideAction.h> 11 #include <aws/wafv2/model/VisibilityConfig.h> 12 #include <utility> 13 14 namespace Aws 15 { 16 namespace Utils 17 { 18 namespace Json 19 { 20 class JsonValue; 21 class JsonView; 22 } // namespace Json 23 } // namespace Utils 24 namespace WAFV2 25 { 26 namespace Model 27 { 28 29 /** 30 * <p>A rule group that's defined for an Firewall Manager WAF policy.</p><p><h3>See 31 * Also:</h3> <a 32 * href="http://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/FirewallManagerRuleGroup">AWS 33 * API Reference</a></p> 34 */ 35 class AWS_WAFV2_API FirewallManagerRuleGroup 36 { 37 public: 38 FirewallManagerRuleGroup(); 39 FirewallManagerRuleGroup(Aws::Utils::Json::JsonView jsonValue); 40 FirewallManagerRuleGroup& operator=(Aws::Utils::Json::JsonView jsonValue); 41 Aws::Utils::Json::JsonValue Jsonize() const; 42 43 44 /** 45 * <p>The name of the rule group. You cannot change the name of a rule group after 46 * you create it.</p> 47 */ GetName()48 inline const Aws::String& GetName() const{ return m_name; } 49 50 /** 51 * <p>The name of the rule group. You cannot change the name of a rule group after 52 * you create it.</p> 53 */ NameHasBeenSet()54 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } 55 56 /** 57 * <p>The name of the rule group. You cannot change the name of a rule group after 58 * you create it.</p> 59 */ SetName(const Aws::String & value)60 inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } 61 62 /** 63 * <p>The name of the rule group. You cannot change the name of a rule group after 64 * you create it.</p> 65 */ SetName(Aws::String && value)66 inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } 67 68 /** 69 * <p>The name of the rule group. You cannot change the name of a rule group after 70 * you create it.</p> 71 */ SetName(const char * value)72 inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } 73 74 /** 75 * <p>The name of the rule group. You cannot change the name of a rule group after 76 * you create it.</p> 77 */ WithName(const Aws::String & value)78 inline FirewallManagerRuleGroup& WithName(const Aws::String& value) { SetName(value); return *this;} 79 80 /** 81 * <p>The name of the rule group. You cannot change the name of a rule group after 82 * you create it.</p> 83 */ WithName(Aws::String && value)84 inline FirewallManagerRuleGroup& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} 85 86 /** 87 * <p>The name of the rule group. You cannot change the name of a rule group after 88 * you create it.</p> 89 */ WithName(const char * value)90 inline FirewallManagerRuleGroup& WithName(const char* value) { SetName(value); return *this;} 91 92 93 /** 94 * <p>If you define more than one rule group in the first or last Firewall Manager 95 * rule groups, WAF evaluates each request against the rule groups in order, 96 * starting from the lowest priority setting. The priorities don't need to be 97 * consecutive, but they must all be different.</p> 98 */ GetPriority()99 inline int GetPriority() const{ return m_priority; } 100 101 /** 102 * <p>If you define more than one rule group in the first or last Firewall Manager 103 * rule groups, WAF evaluates each request against the rule groups in order, 104 * starting from the lowest priority setting. The priorities don't need to be 105 * consecutive, but they must all be different.</p> 106 */ PriorityHasBeenSet()107 inline bool PriorityHasBeenSet() const { return m_priorityHasBeenSet; } 108 109 /** 110 * <p>If you define more than one rule group in the first or last Firewall Manager 111 * rule groups, WAF evaluates each request against the rule groups in order, 112 * starting from the lowest priority setting. The priorities don't need to be 113 * consecutive, but they must all be different.</p> 114 */ SetPriority(int value)115 inline void SetPriority(int value) { m_priorityHasBeenSet = true; m_priority = value; } 116 117 /** 118 * <p>If you define more than one rule group in the first or last Firewall Manager 119 * rule groups, WAF evaluates each request against the rule groups in order, 120 * starting from the lowest priority setting. The priorities don't need to be 121 * consecutive, but they must all be different.</p> 122 */ WithPriority(int value)123 inline FirewallManagerRuleGroup& WithPriority(int value) { SetPriority(value); return *this;} 124 125 126 /** 127 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 128 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 129 */ GetFirewallManagerStatement()130 inline const FirewallManagerStatement& GetFirewallManagerStatement() const{ return m_firewallManagerStatement; } 131 132 /** 133 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 134 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 135 */ FirewallManagerStatementHasBeenSet()136 inline bool FirewallManagerStatementHasBeenSet() const { return m_firewallManagerStatementHasBeenSet; } 137 138 /** 139 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 140 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 141 */ SetFirewallManagerStatement(const FirewallManagerStatement & value)142 inline void SetFirewallManagerStatement(const FirewallManagerStatement& value) { m_firewallManagerStatementHasBeenSet = true; m_firewallManagerStatement = value; } 143 144 /** 145 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 146 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 147 */ SetFirewallManagerStatement(FirewallManagerStatement && value)148 inline void SetFirewallManagerStatement(FirewallManagerStatement&& value) { m_firewallManagerStatementHasBeenSet = true; m_firewallManagerStatement = std::move(value); } 149 150 /** 151 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 152 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 153 */ WithFirewallManagerStatement(const FirewallManagerStatement & value)154 inline FirewallManagerRuleGroup& WithFirewallManagerStatement(const FirewallManagerStatement& value) { SetFirewallManagerStatement(value); return *this;} 155 156 /** 157 * <p>The processing guidance for an Firewall Manager rule. This is like a regular 158 * rule <a>Statement</a>, but it can only contain a rule group reference.</p> 159 */ WithFirewallManagerStatement(FirewallManagerStatement && value)160 inline FirewallManagerRuleGroup& WithFirewallManagerStatement(FirewallManagerStatement&& value) { SetFirewallManagerStatement(std::move(value)); return *this;} 161 162 163 /** 164 * <p>The override action to apply to the rules in a rule group. Used only for rule 165 * statements that reference a rule group, like 166 * <code>RuleGroupReferenceStatement</code> and 167 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 168 * to leave the rule actions in effect. Set it to count to only count matches, 169 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 170 * specify either this <code>OverrideAction</code> setting or the rule 171 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 172 * statement references a rule group, use this override action setting and not the 173 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 174 * rule group, use the rule action setting and not this rule override action 175 * setting. </p> </li> </ul> 176 */ GetOverrideAction()177 inline const OverrideAction& GetOverrideAction() const{ return m_overrideAction; } 178 179 /** 180 * <p>The override action to apply to the rules in a rule group. Used only for rule 181 * statements that reference a rule group, like 182 * <code>RuleGroupReferenceStatement</code> and 183 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 184 * to leave the rule actions in effect. Set it to count to only count matches, 185 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 186 * specify either this <code>OverrideAction</code> setting or the rule 187 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 188 * statement references a rule group, use this override action setting and not the 189 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 190 * rule group, use the rule action setting and not this rule override action 191 * setting. </p> </li> </ul> 192 */ OverrideActionHasBeenSet()193 inline bool OverrideActionHasBeenSet() const { return m_overrideActionHasBeenSet; } 194 195 /** 196 * <p>The override action to apply to the rules in a rule group. Used only for rule 197 * statements that reference a rule group, like 198 * <code>RuleGroupReferenceStatement</code> and 199 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 200 * to leave the rule actions in effect. Set it to count to only count matches, 201 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 202 * specify either this <code>OverrideAction</code> setting or the rule 203 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 204 * statement references a rule group, use this override action setting and not the 205 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 206 * rule group, use the rule action setting and not this rule override action 207 * setting. </p> </li> </ul> 208 */ SetOverrideAction(const OverrideAction & value)209 inline void SetOverrideAction(const OverrideAction& value) { m_overrideActionHasBeenSet = true; m_overrideAction = value; } 210 211 /** 212 * <p>The override action to apply to the rules in a rule group. Used only for rule 213 * statements that reference a rule group, like 214 * <code>RuleGroupReferenceStatement</code> and 215 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 216 * to leave the rule actions in effect. Set it to count to only count matches, 217 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 218 * specify either this <code>OverrideAction</code> setting or the rule 219 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 220 * statement references a rule group, use this override action setting and not the 221 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 222 * rule group, use the rule action setting and not this rule override action 223 * setting. </p> </li> </ul> 224 */ SetOverrideAction(OverrideAction && value)225 inline void SetOverrideAction(OverrideAction&& value) { m_overrideActionHasBeenSet = true; m_overrideAction = std::move(value); } 226 227 /** 228 * <p>The override action to apply to the rules in a rule group. Used only for rule 229 * statements that reference a rule group, like 230 * <code>RuleGroupReferenceStatement</code> and 231 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 232 * to leave the rule actions in effect. Set it to count to only count matches, 233 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 234 * specify either this <code>OverrideAction</code> setting or the rule 235 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 236 * statement references a rule group, use this override action setting and not the 237 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 238 * rule group, use the rule action setting and not this rule override action 239 * setting. </p> </li> </ul> 240 */ WithOverrideAction(const OverrideAction & value)241 inline FirewallManagerRuleGroup& WithOverrideAction(const OverrideAction& value) { SetOverrideAction(value); return *this;} 242 243 /** 244 * <p>The override action to apply to the rules in a rule group. Used only for rule 245 * statements that reference a rule group, like 246 * <code>RuleGroupReferenceStatement</code> and 247 * <code>ManagedRuleGroupStatement</code>. </p> <p>Set the override action to none 248 * to leave the rule actions in effect. Set it to count to only count matches, 249 * regardless of the rule action settings. </p> <p>In a <a>Rule</a>, you must 250 * specify either this <code>OverrideAction</code> setting or the rule 251 * <code>Action</code> setting, but not both:</p> <ul> <li> <p>If the rule 252 * statement references a rule group, use this override action setting and not the 253 * action setting. </p> </li> <li> <p>If the rule statement does not reference a 254 * rule group, use the rule action setting and not this rule override action 255 * setting. </p> </li> </ul> 256 */ WithOverrideAction(OverrideAction && value)257 inline FirewallManagerRuleGroup& WithOverrideAction(OverrideAction&& value) { SetOverrideAction(std::move(value)); return *this;} 258 259 260 /** 261 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 262 * collection. </p> 263 */ GetVisibilityConfig()264 inline const VisibilityConfig& GetVisibilityConfig() const{ return m_visibilityConfig; } 265 266 /** 267 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 268 * collection. </p> 269 */ VisibilityConfigHasBeenSet()270 inline bool VisibilityConfigHasBeenSet() const { return m_visibilityConfigHasBeenSet; } 271 272 /** 273 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 274 * collection. </p> 275 */ SetVisibilityConfig(const VisibilityConfig & value)276 inline void SetVisibilityConfig(const VisibilityConfig& value) { m_visibilityConfigHasBeenSet = true; m_visibilityConfig = value; } 277 278 /** 279 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 280 * collection. </p> 281 */ SetVisibilityConfig(VisibilityConfig && value)282 inline void SetVisibilityConfig(VisibilityConfig&& value) { m_visibilityConfigHasBeenSet = true; m_visibilityConfig = std::move(value); } 283 284 /** 285 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 286 * collection. </p> 287 */ WithVisibilityConfig(const VisibilityConfig & value)288 inline FirewallManagerRuleGroup& WithVisibilityConfig(const VisibilityConfig& value) { SetVisibilityConfig(value); return *this;} 289 290 /** 291 * <p>Defines and enables Amazon CloudWatch metrics and web request sample 292 * collection. </p> 293 */ WithVisibilityConfig(VisibilityConfig && value)294 inline FirewallManagerRuleGroup& WithVisibilityConfig(VisibilityConfig&& value) { SetVisibilityConfig(std::move(value)); return *this;} 295 296 private: 297 298 Aws::String m_name; 299 bool m_nameHasBeenSet; 300 301 int m_priority; 302 bool m_priorityHasBeenSet; 303 304 FirewallManagerStatement m_firewallManagerStatement; 305 bool m_firewallManagerStatementHasBeenSet; 306 307 OverrideAction m_overrideAction; 308 bool m_overrideActionHasBeenSet; 309 310 VisibilityConfig m_visibilityConfig; 311 bool m_visibilityConfigHasBeenSet; 312 }; 313 314 } // namespace Model 315 } // namespace WAFV2 316 } // namespace Aws 317