/** * 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 Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace ElasticLoadBalancingv2 { namespace Model { /** *

Information about a condition for a rule.

Each rule can optionally * include up to one of each of the following conditions: * http-request-method, host-header, * path-pattern, and source-ip. Each rule can also * optionally include one or more of each of the following conditions: * http-header and query-string. Note that the value for * a condition cannot be empty.

See Also:

AWS * API Reference

*/ class RuleCondition { public: AWS_ELASTICLOADBALANCINGV2_API RuleCondition(); AWS_ELASTICLOADBALANCINGV2_API RuleCondition(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCINGV2_API RuleCondition& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_ELASTICLOADBALANCINGV2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_ELASTICLOADBALANCINGV2_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline const Aws::String& GetField() const{ return m_field; } /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline bool FieldHasBeenSet() const { return m_fieldHasBeenSet; } /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline void SetField(const Aws::String& value) { m_fieldHasBeenSet = true; m_field = value; } /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline void SetField(Aws::String&& value) { m_fieldHasBeenSet = true; m_field = std::move(value); } /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline void SetField(const char* value) { m_fieldHasBeenSet = true; m_field.assign(value); } /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline RuleCondition& WithField(const Aws::String& value) { SetField(value); return *this;} /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline RuleCondition& WithField(Aws::String&& value) { SetField(std::move(value)); return *this;} /** *

The field in the HTTP request. The following are the possible values:

*
  • http-header

  • * http-request-method

  • host-header *

  • path-pattern

  • * query-string

  • source-ip

  • *
*/ inline RuleCondition& WithField(const char* value) { SetField(value); return *this;} /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline const Aws::Vector& GetValues() const{ return m_values; } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline bool ValuesHasBeenSet() const { return m_valuesHasBeenSet; } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline void SetValues(const Aws::Vector& value) { m_valuesHasBeenSet = true; m_values = value; } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline void SetValues(Aws::Vector&& value) { m_valuesHasBeenSet = true; m_values = std::move(value); } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline RuleCondition& WithValues(const Aws::Vector& value) { SetValues(value); return *this;} /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline RuleCondition& WithValues(Aws::Vector&& value) { SetValues(std::move(value)); return *this;} /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline RuleCondition& AddValues(const Aws::String& value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline RuleCondition& AddValues(Aws::String&& value) { m_valuesHasBeenSet = true; m_values.push_back(std::move(value)); return *this; } /** *

The condition value. Specify only when Field is * host-header or path-pattern. Alternatively, to specify * multiple host names or multiple path patterns, use HostHeaderConfig * or PathPatternConfig.

If Field is * host-header and you are not using HostHeaderConfig, * you can specify a single host name (for example, my.example.com) in * Values. A host name is case insensitive, can be up to 128 * characters in length, and can contain any of the following characters.

    *
  • A-Z, a-z, 0-9

  • - .

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *

If Field is path-pattern and you are not * using PathPatternConfig, you can specify a single path pattern (for * example, /img/ *) in Values. A path pattern is case-sensitive, can * be up to 128 characters in length, and can contain any of the following * characters.

  • A-Z, a-z, 0-9

  • _ - . $ / ~ " ' @ : * +

  • & (using &)

  • * (matches 0 or * more characters)

  • ? (matches exactly 1 character)

  • *
*/ inline RuleCondition& AddValues(const char* value) { m_valuesHasBeenSet = true; m_values.push_back(value); return *this; } /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline const HostHeaderConditionConfig& GetHostHeaderConfig() const{ return m_hostHeaderConfig; } /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline bool HostHeaderConfigHasBeenSet() const { return m_hostHeaderConfigHasBeenSet; } /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline void SetHostHeaderConfig(const HostHeaderConditionConfig& value) { m_hostHeaderConfigHasBeenSet = true; m_hostHeaderConfig = value; } /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline void SetHostHeaderConfig(HostHeaderConditionConfig&& value) { m_hostHeaderConfigHasBeenSet = true; m_hostHeaderConfig = std::move(value); } /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline RuleCondition& WithHostHeaderConfig(const HostHeaderConditionConfig& value) { SetHostHeaderConfig(value); return *this;} /** *

Information for a host header condition. Specify only when Field * is host-header.

*/ inline RuleCondition& WithHostHeaderConfig(HostHeaderConditionConfig&& value) { SetHostHeaderConfig(std::move(value)); return *this;} /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline const PathPatternConditionConfig& GetPathPatternConfig() const{ return m_pathPatternConfig; } /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline bool PathPatternConfigHasBeenSet() const { return m_pathPatternConfigHasBeenSet; } /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline void SetPathPatternConfig(const PathPatternConditionConfig& value) { m_pathPatternConfigHasBeenSet = true; m_pathPatternConfig = value; } /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline void SetPathPatternConfig(PathPatternConditionConfig&& value) { m_pathPatternConfigHasBeenSet = true; m_pathPatternConfig = std::move(value); } /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline RuleCondition& WithPathPatternConfig(const PathPatternConditionConfig& value) { SetPathPatternConfig(value); return *this;} /** *

Information for a path pattern condition. Specify only when * Field is path-pattern.

*/ inline RuleCondition& WithPathPatternConfig(PathPatternConditionConfig&& value) { SetPathPatternConfig(std::move(value)); return *this;} /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline const HttpHeaderConditionConfig& GetHttpHeaderConfig() const{ return m_httpHeaderConfig; } /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline bool HttpHeaderConfigHasBeenSet() const { return m_httpHeaderConfigHasBeenSet; } /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline void SetHttpHeaderConfig(const HttpHeaderConditionConfig& value) { m_httpHeaderConfigHasBeenSet = true; m_httpHeaderConfig = value; } /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline void SetHttpHeaderConfig(HttpHeaderConditionConfig&& value) { m_httpHeaderConfigHasBeenSet = true; m_httpHeaderConfig = std::move(value); } /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline RuleCondition& WithHttpHeaderConfig(const HttpHeaderConditionConfig& value) { SetHttpHeaderConfig(value); return *this;} /** *

Information for an HTTP header condition. Specify only when * Field is http-header.

*/ inline RuleCondition& WithHttpHeaderConfig(HttpHeaderConditionConfig&& value) { SetHttpHeaderConfig(std::move(value)); return *this;} /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline const QueryStringConditionConfig& GetQueryStringConfig() const{ return m_queryStringConfig; } /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline bool QueryStringConfigHasBeenSet() const { return m_queryStringConfigHasBeenSet; } /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline void SetQueryStringConfig(const QueryStringConditionConfig& value) { m_queryStringConfigHasBeenSet = true; m_queryStringConfig = value; } /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline void SetQueryStringConfig(QueryStringConditionConfig&& value) { m_queryStringConfigHasBeenSet = true; m_queryStringConfig = std::move(value); } /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline RuleCondition& WithQueryStringConfig(const QueryStringConditionConfig& value) { SetQueryStringConfig(value); return *this;} /** *

Information for a query string condition. Specify only when * Field is query-string.

*/ inline RuleCondition& WithQueryStringConfig(QueryStringConditionConfig&& value) { SetQueryStringConfig(std::move(value)); return *this;} /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline const HttpRequestMethodConditionConfig& GetHttpRequestMethodConfig() const{ return m_httpRequestMethodConfig; } /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline bool HttpRequestMethodConfigHasBeenSet() const { return m_httpRequestMethodConfigHasBeenSet; } /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline void SetHttpRequestMethodConfig(const HttpRequestMethodConditionConfig& value) { m_httpRequestMethodConfigHasBeenSet = true; m_httpRequestMethodConfig = value; } /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline void SetHttpRequestMethodConfig(HttpRequestMethodConditionConfig&& value) { m_httpRequestMethodConfigHasBeenSet = true; m_httpRequestMethodConfig = std::move(value); } /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline RuleCondition& WithHttpRequestMethodConfig(const HttpRequestMethodConditionConfig& value) { SetHttpRequestMethodConfig(value); return *this;} /** *

Information for an HTTP method condition. Specify only when * Field is http-request-method.

*/ inline RuleCondition& WithHttpRequestMethodConfig(HttpRequestMethodConditionConfig&& value) { SetHttpRequestMethodConfig(std::move(value)); return *this;} /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline const SourceIpConditionConfig& GetSourceIpConfig() const{ return m_sourceIpConfig; } /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline bool SourceIpConfigHasBeenSet() const { return m_sourceIpConfigHasBeenSet; } /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline void SetSourceIpConfig(const SourceIpConditionConfig& value) { m_sourceIpConfigHasBeenSet = true; m_sourceIpConfig = value; } /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline void SetSourceIpConfig(SourceIpConditionConfig&& value) { m_sourceIpConfigHasBeenSet = true; m_sourceIpConfig = std::move(value); } /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline RuleCondition& WithSourceIpConfig(const SourceIpConditionConfig& value) { SetSourceIpConfig(value); return *this;} /** *

Information for a source IP condition. Specify only when Field * is source-ip.

*/ inline RuleCondition& WithSourceIpConfig(SourceIpConditionConfig&& value) { SetSourceIpConfig(std::move(value)); return *this;} private: Aws::String m_field; bool m_fieldHasBeenSet = false; Aws::Vector m_values; bool m_valuesHasBeenSet = false; HostHeaderConditionConfig m_hostHeaderConfig; bool m_hostHeaderConfigHasBeenSet = false; PathPatternConditionConfig m_pathPatternConfig; bool m_pathPatternConfigHasBeenSet = false; HttpHeaderConditionConfig m_httpHeaderConfig; bool m_httpHeaderConfigHasBeenSet = false; QueryStringConditionConfig m_queryStringConfig; bool m_queryStringConfigHasBeenSet = false; HttpRequestMethodConditionConfig m_httpRequestMethodConfig; bool m_httpRequestMethodConfigHasBeenSet = false; SourceIpConditionConfig m_sourceIpConfig; bool m_sourceIpConfigHasBeenSet = false; }; } // namespace Model } // namespace ElasticLoadBalancingv2 } // namespace Aws