/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #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.

A combination of * ByteMatchSet, IPSet, and/or SqlInjectionMatchSet objects * that identify the web requests that you want to allow, block, or count. For * example, you might create a Rule that includes the following * predicates:

  • An IPSet that causes AWS WAF to search * for web requests that originate from the IP address 192.0.2.44

    *
  • A ByteMatchSet that causes AWS WAF to search for web * requests for which the value of the User-Agent header is * BadBot.

To match the settings in this * Rule, a request must originate from 192.0.2.44 AND * include a User-Agent header for which the value is * BadBot.

See Also:

AWS API * Reference

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

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline const Aws::String& GetRuleId() const{ return m_ruleId; } /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline bool RuleIdHasBeenSet() const { return m_ruleIdHasBeenSet; } /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline void SetRuleId(const Aws::String& value) { m_ruleIdHasBeenSet = true; m_ruleId = value; } /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline void SetRuleId(Aws::String&& value) { m_ruleIdHasBeenSet = true; m_ruleId = std::move(value); } /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline void SetRuleId(const char* value) { m_ruleIdHasBeenSet = true; m_ruleId.assign(value); } /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline Rule& WithRuleId(const Aws::String& value) { SetRuleId(value); return *this;} /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline Rule& WithRuleId(Aws::String&& value) { SetRuleId(std::move(value)); return *this;} /** *

A unique identifier for a Rule. You use RuleId to * get more information about a Rule (see GetRule), update a * Rule (see UpdateRule), insert a Rule into a * WebACL or delete a one from a WebACL (see * UpdateWebACL), or delete a Rule from AWS WAF (see * DeleteRule).

RuleId is returned by CreateRule * and by ListRules.

*/ inline Rule& WithRuleId(const char* value) { SetRuleId(value); return *this;} /** *

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

The friendly name or description for the Rule. You can't change * the name of a Rule after you create it.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

A friendly name or description for the metrics for this Rule. * 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 Rule.

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

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline const Aws::Vector& GetPredicates() const{ return m_predicates; } /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline bool PredicatesHasBeenSet() const { return m_predicatesHasBeenSet; } /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline void SetPredicates(const Aws::Vector& value) { m_predicatesHasBeenSet = true; m_predicates = value; } /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline void SetPredicates(Aws::Vector&& value) { m_predicatesHasBeenSet = true; m_predicates = std::move(value); } /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline Rule& WithPredicates(const Aws::Vector& value) { SetPredicates(value); return *this;} /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline Rule& WithPredicates(Aws::Vector&& value) { SetPredicates(std::move(value)); return *this;} /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline Rule& AddPredicates(const Predicate& value) { m_predicatesHasBeenSet = true; m_predicates.push_back(value); return *this; } /** *

The Predicates object contains one Predicate * element for each ByteMatchSet, IPSet, or * SqlInjectionMatchSet object that you want to include in a * Rule.

*/ inline Rule& AddPredicates(Predicate&& value) { m_predicatesHasBeenSet = true; m_predicates.push_back(std::move(value)); return *this; } private: Aws::String m_ruleId; bool m_ruleIdHasBeenSet = false; Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_metricName; bool m_metricNameHasBeenSet = false; Aws::Vector m_predicates; bool m_predicatesHasBeenSet = false; }; } // namespace Model } // namespace WAF } // namespace Aws