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

An origin.

An origin is the location where content is stored, and from * which CloudFront gets content to serve to viewers. To specify an origin:

*
  • Use the S3OriginConfig type to specify an Amazon S3 * bucket that is not configured with static website hosting.

    *
  • Use the CustomOriginConfig type to specify various * other kinds of content containers or HTTP servers, including:

    • *

      An Amazon S3 bucket that is configured with static website hosting

    • *
    • An Elastic Load Balancing load balancer

    • An AWS * Elemental MediaPackage origin

    • An AWS Elemental MediaStore * container

    • Any other HTTP server, running on an Amazon EC2 * instance or any other kind of host

For the * current maximum number of origins that you can specify per distribution, see General * Quotas on Web Distributions in the Amazon CloudFront Developer Guide * (quotas were formerly referred to as limits).

See Also:

AWS * API Reference

*/ class AWS_CLOUDFRONT_API Origin { public: Origin(); Origin(const Aws::Utils::Xml::XmlNode& xmlNode); Origin& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline const Aws::String& GetId() const{ return m_id; } /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline bool IdHasBeenSet() const { return m_idHasBeenSet; } /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; } /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); } /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); } /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline Origin& WithId(const Aws::String& value) { SetId(value); return *this;} /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline Origin& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;} /** *

A unique identifier for the origin. This value must be unique within the * distribution.

Use this value to specify the TargetOriginId * in a CacheBehavior or DefaultCacheBehavior.

*/ inline Origin& WithId(const char* value) { SetId(value); return *this;} /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline const Aws::String& GetDomainName() const{ return m_domainName; } /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline bool DomainNameHasBeenSet() const { return m_domainNameHasBeenSet; } /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline void SetDomainName(const Aws::String& value) { m_domainNameHasBeenSet = true; m_domainName = value; } /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline void SetDomainName(Aws::String&& value) { m_domainNameHasBeenSet = true; m_domainName = std::move(value); } /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline void SetDomainName(const char* value) { m_domainNameHasBeenSet = true; m_domainName.assign(value); } /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithDomainName(const Aws::String& value) { SetDomainName(value); return *this;} /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithDomainName(Aws::String&& value) { SetDomainName(std::move(value)); return *this;} /** *

The domain name for the origin.

For more information, see Origin * Domain Name in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithDomainName(const char* value) { SetDomainName(value); return *this;} /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline const Aws::String& GetOriginPath() const{ return m_originPath; } /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline bool OriginPathHasBeenSet() const { return m_originPathHasBeenSet; } /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline void SetOriginPath(const Aws::String& value) { m_originPathHasBeenSet = true; m_originPath = value; } /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline void SetOriginPath(Aws::String&& value) { m_originPathHasBeenSet = true; m_originPath = std::move(value); } /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline void SetOriginPath(const char* value) { m_originPathHasBeenSet = true; m_originPath.assign(value); } /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithOriginPath(const Aws::String& value) { SetOriginPath(value); return *this;} /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithOriginPath(Aws::String&& value) { SetOriginPath(std::move(value)); return *this;} /** *

An optional path that CloudFront appends to the origin domain name when * CloudFront requests content from the origin.

For more information, see Origin * Path in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithOriginPath(const char* value) { SetOriginPath(value); return *this;} /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline const CustomHeaders& GetCustomHeaders() const{ return m_customHeaders; } /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline bool CustomHeadersHasBeenSet() const { return m_customHeadersHasBeenSet; } /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline void SetCustomHeaders(const CustomHeaders& value) { m_customHeadersHasBeenSet = true; m_customHeaders = value; } /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline void SetCustomHeaders(CustomHeaders&& value) { m_customHeadersHasBeenSet = true; m_customHeaders = std::move(value); } /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline Origin& WithCustomHeaders(const CustomHeaders& value) { SetCustomHeaders(value); return *this;} /** *

A list of HTTP header names and values that CloudFront adds to requests it * sends to the origin.

For more information, see Adding * Custom Headers to Origin Requests in the Amazon CloudFront Developer * Guide.

*/ inline Origin& WithCustomHeaders(CustomHeaders&& value) { SetCustomHeaders(std::move(value)); return *this;} /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline const S3OriginConfig& GetS3OriginConfig() const{ return m_s3OriginConfig; } /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline bool S3OriginConfigHasBeenSet() const { return m_s3OriginConfigHasBeenSet; } /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline void SetS3OriginConfig(const S3OriginConfig& value) { m_s3OriginConfigHasBeenSet = true; m_s3OriginConfig = value; } /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline void SetS3OriginConfig(S3OriginConfig&& value) { m_s3OriginConfigHasBeenSet = true; m_s3OriginConfig = std::move(value); } /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline Origin& WithS3OriginConfig(const S3OriginConfig& value) { SetS3OriginConfig(value); return *this;} /** *

Use this type to specify an origin that is an Amazon S3 bucket that is * not configured with static website hosting. To specify any other * type of origin, including an Amazon S3 bucket that is configured with static * website hosting, use the CustomOriginConfig type instead.

*/ inline Origin& WithS3OriginConfig(S3OriginConfig&& value) { SetS3OriginConfig(std::move(value)); return *this;} /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline const CustomOriginConfig& GetCustomOriginConfig() const{ return m_customOriginConfig; } /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline bool CustomOriginConfigHasBeenSet() const { return m_customOriginConfigHasBeenSet; } /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline void SetCustomOriginConfig(const CustomOriginConfig& value) { m_customOriginConfigHasBeenSet = true; m_customOriginConfig = value; } /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline void SetCustomOriginConfig(CustomOriginConfig&& value) { m_customOriginConfigHasBeenSet = true; m_customOriginConfig = std::move(value); } /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline Origin& WithCustomOriginConfig(const CustomOriginConfig& value) { SetCustomOriginConfig(value); return *this;} /** *

Use this type to specify an origin that is a content container or HTTP * server, including an Amazon S3 bucket that is configured with static website * hosting. To specify an Amazon S3 bucket that is not configured * with static website hosting, use the S3OriginConfig type * instead.

*/ inline Origin& WithCustomOriginConfig(CustomOriginConfig&& value) { SetCustomOriginConfig(std::move(value)); return *this;} /** *

The number of times that CloudFront attempts to connect to the origin. The * minimum number is 1, the maximum is 3, and the default (if you don’t specify * otherwise) is 3.

For a custom origin (including an Amazon S3 bucket * that’s configured with static website hosting), this value also specifies the * number of times that CloudFront attempts to get a response from the origin, in * the case of an Origin * Response Timeout.

For more information, see Origin * Connection Attempts in the Amazon CloudFront Developer Guide.

*/ inline int GetConnectionAttempts() const{ return m_connectionAttempts; } /** *

The number of times that CloudFront attempts to connect to the origin. The * minimum number is 1, the maximum is 3, and the default (if you don’t specify * otherwise) is 3.

For a custom origin (including an Amazon S3 bucket * that’s configured with static website hosting), this value also specifies the * number of times that CloudFront attempts to get a response from the origin, in * the case of an Origin * Response Timeout.

For more information, see Origin * Connection Attempts in the Amazon CloudFront Developer Guide.

*/ inline bool ConnectionAttemptsHasBeenSet() const { return m_connectionAttemptsHasBeenSet; } /** *

The number of times that CloudFront attempts to connect to the origin. The * minimum number is 1, the maximum is 3, and the default (if you don’t specify * otherwise) is 3.

For a custom origin (including an Amazon S3 bucket * that’s configured with static website hosting), this value also specifies the * number of times that CloudFront attempts to get a response from the origin, in * the case of an Origin * Response Timeout.

For more information, see Origin * Connection Attempts in the Amazon CloudFront Developer Guide.

*/ inline void SetConnectionAttempts(int value) { m_connectionAttemptsHasBeenSet = true; m_connectionAttempts = value; } /** *

The number of times that CloudFront attempts to connect to the origin. The * minimum number is 1, the maximum is 3, and the default (if you don’t specify * otherwise) is 3.

For a custom origin (including an Amazon S3 bucket * that’s configured with static website hosting), this value also specifies the * number of times that CloudFront attempts to get a response from the origin, in * the case of an Origin * Response Timeout.

For more information, see Origin * Connection Attempts in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithConnectionAttempts(int value) { SetConnectionAttempts(value); return *this;} /** *

The number of seconds that CloudFront waits when trying to establish a * connection to the origin. The minimum timeout is 1 second, the maximum is 10 * seconds, and the default (if you don’t specify otherwise) is 10 seconds.

*

For more information, see Origin * Connection Timeout in the Amazon CloudFront Developer Guide.

*/ inline int GetConnectionTimeout() const{ return m_connectionTimeout; } /** *

The number of seconds that CloudFront waits when trying to establish a * connection to the origin. The minimum timeout is 1 second, the maximum is 10 * seconds, and the default (if you don’t specify otherwise) is 10 seconds.

*

For more information, see Origin * Connection Timeout in the Amazon CloudFront Developer Guide.

*/ inline bool ConnectionTimeoutHasBeenSet() const { return m_connectionTimeoutHasBeenSet; } /** *

The number of seconds that CloudFront waits when trying to establish a * connection to the origin. The minimum timeout is 1 second, the maximum is 10 * seconds, and the default (if you don’t specify otherwise) is 10 seconds.

*

For more information, see Origin * Connection Timeout in the Amazon CloudFront Developer Guide.

*/ inline void SetConnectionTimeout(int value) { m_connectionTimeoutHasBeenSet = true; m_connectionTimeout = value; } /** *

The number of seconds that CloudFront waits when trying to establish a * connection to the origin. The minimum timeout is 1 second, the maximum is 10 * seconds, and the default (if you don’t specify otherwise) is 10 seconds.

*

For more information, see Origin * Connection Timeout in the Amazon CloudFront Developer Guide.

*/ inline Origin& WithConnectionTimeout(int value) { SetConnectionTimeout(value); return *this;} private: Aws::String m_id; bool m_idHasBeenSet; Aws::String m_domainName; bool m_domainNameHasBeenSet; Aws::String m_originPath; bool m_originPathHasBeenSet; CustomHeaders m_customHeaders; bool m_customHeadersHasBeenSet; S3OriginConfig m_s3OriginConfig; bool m_s3OriginConfigHasBeenSet; CustomOriginConfig m_customOriginConfig; bool m_customOriginConfigHasBeenSet; int m_connectionAttempts; bool m_connectionAttemptsHasBeenSet; int m_connectionTimeout; bool m_connectionTimeoutHasBeenSet; }; } // namespace Model } // namespace CloudFront } // namespace Aws