/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace WAFV2 { namespace Model { /** */ class CreateRuleGroupRequest : public WAFV2Request { public: AWS_WAFV2_API CreateRuleGroupRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CreateRuleGroup"; } AWS_WAFV2_API Aws::String SerializePayload() const override; AWS_WAFV2_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline CreateRuleGroupRequest& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline CreateRuleGroupRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the rule group. You cannot change the name of a rule group after * you create it.

*/ inline CreateRuleGroupRequest& WithName(const char* value) { SetName(value); return *this;} /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline const Scope& GetScope() const{ return m_scope; } /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline bool ScopeHasBeenSet() const { return m_scopeHasBeenSet; } /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline void SetScope(const Scope& value) { m_scopeHasBeenSet = true; m_scope = value; } /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline void SetScope(Scope&& value) { m_scopeHasBeenSet = true; m_scope = std::move(value); } /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline CreateRuleGroupRequest& WithScope(const Scope& value) { SetScope(value); return *this;} /** *

Specifies whether this is for an Amazon CloudFront distribution or for a * regional application. A regional application can be an Application Load Balancer * (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito * user pool, an App Runner service, or an Amazon Web Services Verified Access * instance.

To work with CloudFront, you must also specify the Region US * East (N. Virginia) as follows:

  • CLI - Specify the Region when * you use the CloudFront scope: --scope=CLOUDFRONT * --region=us-east-1.

  • API and SDKs - For all calls, use * the Region endpoint us-east-1.

*/ inline CreateRuleGroupRequest& WithScope(Scope&& value) { SetScope(std::move(value)); return *this;} /** *

The web ACL capacity units (WCUs) required for this rule group.

When * you create your own rule group, you define this, and you cannot change it after * creation. When you add or modify the rules in a rule group, WAF enforces this * limit. You can check the capacity for a set of rules using * CheckCapacity.

WAF uses WCUs to calculate and control the * operating resources that are used to run your rules, rule groups, and web ACLs. * WAF calculates capacity differently for each rule type, to reflect the relative * cost of each rule. Simple rules that cost little to run use fewer WCUs than more * complex rules that use more processing power. Rule group capacity is fixed at * creation, which helps users plan their web ACL WCU usage when they use a rule * group. For more information, see WAF * web ACL capacity units (WCU) in the WAF Developer Guide.

*/ inline long long GetCapacity() const{ return m_capacity; } /** *

The web ACL capacity units (WCUs) required for this rule group.

When * you create your own rule group, you define this, and you cannot change it after * creation. When you add or modify the rules in a rule group, WAF enforces this * limit. You can check the capacity for a set of rules using * CheckCapacity.

WAF uses WCUs to calculate and control the * operating resources that are used to run your rules, rule groups, and web ACLs. * WAF calculates capacity differently for each rule type, to reflect the relative * cost of each rule. Simple rules that cost little to run use fewer WCUs than more * complex rules that use more processing power. Rule group capacity is fixed at * creation, which helps users plan their web ACL WCU usage when they use a rule * group. For more information, see WAF * web ACL capacity units (WCU) in the WAF Developer Guide.

*/ inline bool CapacityHasBeenSet() const { return m_capacityHasBeenSet; } /** *

The web ACL capacity units (WCUs) required for this rule group.

When * you create your own rule group, you define this, and you cannot change it after * creation. When you add or modify the rules in a rule group, WAF enforces this * limit. You can check the capacity for a set of rules using * CheckCapacity.

WAF uses WCUs to calculate and control the * operating resources that are used to run your rules, rule groups, and web ACLs. * WAF calculates capacity differently for each rule type, to reflect the relative * cost of each rule. Simple rules that cost little to run use fewer WCUs than more * complex rules that use more processing power. Rule group capacity is fixed at * creation, which helps users plan their web ACL WCU usage when they use a rule * group. For more information, see WAF * web ACL capacity units (WCU) in the WAF Developer Guide.

*/ inline void SetCapacity(long long value) { m_capacityHasBeenSet = true; m_capacity = value; } /** *

The web ACL capacity units (WCUs) required for this rule group.

When * you create your own rule group, you define this, and you cannot change it after * creation. When you add or modify the rules in a rule group, WAF enforces this * limit. You can check the capacity for a set of rules using * CheckCapacity.

WAF uses WCUs to calculate and control the * operating resources that are used to run your rules, rule groups, and web ACLs. * WAF calculates capacity differently for each rule type, to reflect the relative * cost of each rule. Simple rules that cost little to run use fewer WCUs than more * complex rules that use more processing power. Rule group capacity is fixed at * creation, which helps users plan their web ACL WCU usage when they use a rule * group. For more information, see WAF * web ACL capacity units (WCU) in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& WithCapacity(long long value) { SetCapacity(value); return *this;} /** *

A description of the rule group that helps with identification.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

A description of the rule group that helps with identification.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

A description of the rule group that helps with identification.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

A description of the rule group that helps with identification.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

A description of the rule group that helps with identification.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

A description of the rule group that helps with identification.

*/ inline CreateRuleGroupRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

A description of the rule group that helps with identification.

*/ inline CreateRuleGroupRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

A description of the rule group that helps with identification.

*/ inline CreateRuleGroupRequest& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline const Aws::Vector& GetRules() const{ return m_rules; } /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline bool RulesHasBeenSet() const { return m_rulesHasBeenSet; } /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline void SetRules(const Aws::Vector& value) { m_rulesHasBeenSet = true; m_rules = value; } /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline void SetRules(Aws::Vector&& value) { m_rulesHasBeenSet = true; m_rules = std::move(value); } /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline CreateRuleGroupRequest& WithRules(const Aws::Vector& value) { SetRules(value); return *this;} /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline CreateRuleGroupRequest& WithRules(Aws::Vector&& value) { SetRules(std::move(value)); return *this;} /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline CreateRuleGroupRequest& AddRules(const Rule& value) { m_rulesHasBeenSet = true; m_rules.push_back(value); return *this; } /** *

The Rule statements used to identify the web requests that you want to * allow, block, or count. Each rule includes one top-level statement that WAF uses * to identify matching web requests, and parameters that govern how WAF handles * them.

*/ inline CreateRuleGroupRequest& AddRules(Rule&& value) { m_rulesHasBeenSet = true; m_rules.push_back(std::move(value)); return *this; } /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline const VisibilityConfig& GetVisibilityConfig() const{ return m_visibilityConfig; } /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline bool VisibilityConfigHasBeenSet() const { return m_visibilityConfigHasBeenSet; } /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline void SetVisibilityConfig(const VisibilityConfig& value) { m_visibilityConfigHasBeenSet = true; m_visibilityConfig = value; } /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline void SetVisibilityConfig(VisibilityConfig&& value) { m_visibilityConfigHasBeenSet = true; m_visibilityConfig = std::move(value); } /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline CreateRuleGroupRequest& WithVisibilityConfig(const VisibilityConfig& value) { SetVisibilityConfig(value); return *this;} /** *

Defines and enables Amazon CloudWatch metrics and web request sample * collection.

*/ inline CreateRuleGroupRequest& WithVisibilityConfig(VisibilityConfig&& value) { SetVisibilityConfig(std::move(value)); return *this;} /** *

An array of key:value pairs to associate with the resource.

*/ inline const Aws::Vector& GetTags() const{ return m_tags; } /** *

An array of key:value pairs to associate with the resource.

*/ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** *

An array of key:value pairs to associate with the resource.

*/ inline void SetTags(const Aws::Vector& value) { m_tagsHasBeenSet = true; m_tags = value; } /** *

An array of key:value pairs to associate with the resource.

*/ inline void SetTags(Aws::Vector&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** *

An array of key:value pairs to associate with the resource.

*/ inline CreateRuleGroupRequest& WithTags(const Aws::Vector& value) { SetTags(value); return *this;} /** *

An array of key:value pairs to associate with the resource.

*/ inline CreateRuleGroupRequest& WithTags(Aws::Vector&& value) { SetTags(std::move(value)); return *this;} /** *

An array of key:value pairs to associate with the resource.

*/ inline CreateRuleGroupRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** *

An array of key:value pairs to associate with the resource.

*/ inline CreateRuleGroupRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline const Aws::Map& GetCustomResponseBodies() const{ return m_customResponseBodies; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline bool CustomResponseBodiesHasBeenSet() const { return m_customResponseBodiesHasBeenSet; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline void SetCustomResponseBodies(const Aws::Map& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies = value; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline void SetCustomResponseBodies(Aws::Map&& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies = std::move(value); } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& WithCustomResponseBodies(const Aws::Map& value) { SetCustomResponseBodies(value); return *this;} /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& WithCustomResponseBodies(Aws::Map&& value) { SetCustomResponseBodies(std::move(value)); return *this;} /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(const Aws::String& key, const CustomResponseBody& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(key, value); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(Aws::String&& key, const CustomResponseBody& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(std::move(key), value); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(const Aws::String& key, CustomResponseBody&& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(key, std::move(value)); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(Aws::String&& key, CustomResponseBody&& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(std::move(key), std::move(value)); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(const char* key, CustomResponseBody&& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(key, std::move(value)); return *this; } /** *

A map of custom response keys and content bodies. When you create a rule with * a block action, you can send a custom response to the web request. You define * these for the rule group, and then use them in the rules that you define in the * rule group.

For information about customizing web requests and * responses, see Customizing * web requests and responses in WAF in the WAF Developer Guide.

*

For information about the limits on count and size for custom request and * response settings, see WAF * quotas in the WAF Developer Guide.

*/ inline CreateRuleGroupRequest& AddCustomResponseBodies(const char* key, const CustomResponseBody& value) { m_customResponseBodiesHasBeenSet = true; m_customResponseBodies.emplace(key, value); return *this; } private: Aws::String m_name; bool m_nameHasBeenSet = false; Scope m_scope; bool m_scopeHasBeenSet = false; long long m_capacity; bool m_capacityHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; Aws::Vector m_rules; bool m_rulesHasBeenSet = false; VisibilityConfig m_visibilityConfig; bool m_visibilityConfigHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; Aws::Map m_customResponseBodies; bool m_customResponseBodiesHasBeenSet = false; }; } // namespace Model } // namespace WAFV2 } // namespace Aws