/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace WAF { namespace Model { /** *

This is AWS WAF Classic documentation. For more information, * see AWS * WAF Classic in the developer guide.

For the latest version of AWS * WAF, use the AWS WAFV2 API and see the AWS * WAF Developer Guide. With the latest version, AWS WAF has a single set of * endpoints for regional and global use.

Contains the * Rules that identify the requests that you want to allow, block, or * count. In a WebACL, you also specify a default action * (ALLOW or BLOCK), and the action for each * Rule that you add to a WebACL, for example, block * requests from specified IP addresses or block requests from specified referrers. * You also associate the WebACL with a CloudFront distribution to * identify the requests that you want AWS WAF to filter. If you add more than one * Rule to a WebACL, a request needs to match only one of * the specifications to be allowed, blocked, or counted. For more information, see * UpdateWebACL.

See Also:

AWS API * Reference

*/ class WebACL { public: AWS_WAF_API WebACL(); AWS_WAF_API WebACL(Aws::Utils::Json::JsonView jsonValue); AWS_WAF_API WebACL& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_WAF_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline const Aws::String& GetWebACLId() const{ return m_webACLId; } /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline bool WebACLIdHasBeenSet() const { return m_webACLIdHasBeenSet; } /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline void SetWebACLId(const Aws::String& value) { m_webACLIdHasBeenSet = true; m_webACLId = value; } /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline void SetWebACLId(Aws::String&& value) { m_webACLIdHasBeenSet = true; m_webACLId = std::move(value); } /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline void SetWebACLId(const char* value) { m_webACLIdHasBeenSet = true; m_webACLId.assign(value); } /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline WebACL& WithWebACLId(const Aws::String& value) { SetWebACLId(value); return *this;} /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline WebACL& WithWebACLId(Aws::String&& value) { SetWebACLId(std::move(value)); return *this;} /** *

A unique identifier for a WebACL. You use WebACLId * to get information about a WebACL (see GetWebACL), update a * WebACL (see UpdateWebACL), and delete a WebACL * from AWS WAF (see DeleteWebACL).

WebACLId is * returned by CreateWebACL and by ListWebACLs.

*/ inline WebACL& WithWebACLId(const char* value) { SetWebACLId(value); return *this;} /** *

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description of the WebACL. You can't change * the name of a WebACL after you create it.

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

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline const Aws::String& GetMetricName() const{ return m_metricName; } /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; } /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline void SetMetricName(const Aws::String& value) { m_metricNameHasBeenSet = true; m_metricName = value; } /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline void SetMetricName(Aws::String&& value) { m_metricNameHasBeenSet = true; m_metricName = std::move(value); } /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline void SetMetricName(const char* value) { m_metricNameHasBeenSet = true; m_metricName.assign(value); } /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline WebACL& WithMetricName(const Aws::String& value) { SetMetricName(value); return *this;} /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline WebACL& WithMetricName(Aws::String&& value) { SetMetricName(std::move(value)); return *this;} /** *

A friendly name or description for the metrics for this WebACL. * The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum * length 128 and minimum length one. It can't contain whitespace or metric names * reserved for AWS WAF, including "All" and "Default_Action." You can't change * MetricName after you create the WebACL.

*/ inline WebACL& WithMetricName(const char* value) { SetMetricName(value); return *this;} /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline const WafAction& GetDefaultAction() const{ return m_defaultAction; } /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline bool DefaultActionHasBeenSet() const { return m_defaultActionHasBeenSet; } /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline void SetDefaultAction(const WafAction& value) { m_defaultActionHasBeenSet = true; m_defaultAction = value; } /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline void SetDefaultAction(WafAction&& value) { m_defaultActionHasBeenSet = true; m_defaultAction = std::move(value); } /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline WebACL& WithDefaultAction(const WafAction& value) { SetDefaultAction(value); return *this;} /** *

The action to perform if none of the Rules contained in the * WebACL match. The action is specified by the WafAction * object.

*/ inline WebACL& WithDefaultAction(WafAction&& value) { SetDefaultAction(std::move(value)); return *this;} /** *

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

An array that contains the action for each Rule in a * WebACL, the priority of the Rule, and the ID of the * Rule.

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

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline const Aws::String& GetWebACLArn() const{ return m_webACLArn; } /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline bool WebACLArnHasBeenSet() const { return m_webACLArnHasBeenSet; } /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline void SetWebACLArn(const Aws::String& value) { m_webACLArnHasBeenSet = true; m_webACLArn = value; } /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline void SetWebACLArn(Aws::String&& value) { m_webACLArnHasBeenSet = true; m_webACLArn = std::move(value); } /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline void SetWebACLArn(const char* value) { m_webACLArnHasBeenSet = true; m_webACLArn.assign(value); } /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline WebACL& WithWebACLArn(const Aws::String& value) { SetWebACLArn(value); return *this;} /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline WebACL& WithWebACLArn(Aws::String&& value) { SetWebACLArn(std::move(value)); return *this;} /** *

Tha Amazon Resource Name (ARN) of the web ACL.

*/ inline WebACL& WithWebACLArn(const char* value) { SetWebACLArn(value); return *this;} private: Aws::String m_webACLId; bool m_webACLIdHasBeenSet = false; Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_metricName; bool m_metricNameHasBeenSet = false; WafAction m_defaultAction; bool m_defaultActionHasBeenSet = false; Aws::Vector m_rules; bool m_rulesHasBeenSet = false; Aws::String m_webACLArn; bool m_webACLArnHasBeenSet = false; }; } // namespace Model } // namespace WAF } // namespace Aws