/** * 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 request policy configuration.

This configuration determines * the values that CloudFront includes in requests that it sends to the origin. * Each request that CloudFront sends to the origin includes the following:

*
  • The request body and the URL path (without the domain name) from * the viewer request.

  • The headers that CloudFront automatically * includes in every origin request, including Host, * User-Agent, and X-Amz-Cf-Id.

  • All * HTTP headers, cookies, and URL query strings that are specified in the cache * policy or the origin request policy. These can include items from the viewer * request and, in the case of headers, additional ones that are added by * CloudFront.

CloudFront sends a request when it can't find an * object in its cache that matches the request. If you want to send values to the * origin and also include them in the cache key, use * CachePolicy.

See Also:

AWS * API Reference

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

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline const Aws::String& GetComment() const{ return m_comment; } /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline bool CommentHasBeenSet() const { return m_commentHasBeenSet; } /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline void SetComment(const Aws::String& value) { m_commentHasBeenSet = true; m_comment = value; } /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline void SetComment(Aws::String&& value) { m_commentHasBeenSet = true; m_comment = std::move(value); } /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline void SetComment(const char* value) { m_commentHasBeenSet = true; m_comment.assign(value); } /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline OriginRequestPolicyConfig& WithComment(const Aws::String& value) { SetComment(value); return *this;} /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline OriginRequestPolicyConfig& WithComment(Aws::String&& value) { SetComment(std::move(value)); return *this;} /** *

A comment to describe the origin request policy. The comment cannot be longer * than 128 characters.

*/ inline OriginRequestPolicyConfig& WithComment(const char* value) { SetComment(value); return *this;} /** *

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

A unique name to identify the origin request policy.

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

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline const OriginRequestPolicyHeadersConfig& GetHeadersConfig() const{ return m_headersConfig; } /** *

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline bool HeadersConfigHasBeenSet() const { return m_headersConfigHasBeenSet; } /** *

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline void SetHeadersConfig(const OriginRequestPolicyHeadersConfig& value) { m_headersConfigHasBeenSet = true; m_headersConfig = value; } /** *

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline void SetHeadersConfig(OriginRequestPolicyHeadersConfig&& value) { m_headersConfigHasBeenSet = true; m_headersConfig = std::move(value); } /** *

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline OriginRequestPolicyConfig& WithHeadersConfig(const OriginRequestPolicyHeadersConfig& value) { SetHeadersConfig(value); return *this;} /** *

The HTTP headers to include in origin requests. These can include headers * from viewer requests and additional headers added by CloudFront.

*/ inline OriginRequestPolicyConfig& WithHeadersConfig(OriginRequestPolicyHeadersConfig&& value) { SetHeadersConfig(std::move(value)); return *this;} /** *

The cookies from viewer requests to include in origin requests.

*/ inline const OriginRequestPolicyCookiesConfig& GetCookiesConfig() const{ return m_cookiesConfig; } /** *

The cookies from viewer requests to include in origin requests.

*/ inline bool CookiesConfigHasBeenSet() const { return m_cookiesConfigHasBeenSet; } /** *

The cookies from viewer requests to include in origin requests.

*/ inline void SetCookiesConfig(const OriginRequestPolicyCookiesConfig& value) { m_cookiesConfigHasBeenSet = true; m_cookiesConfig = value; } /** *

The cookies from viewer requests to include in origin requests.

*/ inline void SetCookiesConfig(OriginRequestPolicyCookiesConfig&& value) { m_cookiesConfigHasBeenSet = true; m_cookiesConfig = std::move(value); } /** *

The cookies from viewer requests to include in origin requests.

*/ inline OriginRequestPolicyConfig& WithCookiesConfig(const OriginRequestPolicyCookiesConfig& value) { SetCookiesConfig(value); return *this;} /** *

The cookies from viewer requests to include in origin requests.

*/ inline OriginRequestPolicyConfig& WithCookiesConfig(OriginRequestPolicyCookiesConfig&& value) { SetCookiesConfig(std::move(value)); return *this;} /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline const OriginRequestPolicyQueryStringsConfig& GetQueryStringsConfig() const{ return m_queryStringsConfig; } /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline bool QueryStringsConfigHasBeenSet() const { return m_queryStringsConfigHasBeenSet; } /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline void SetQueryStringsConfig(const OriginRequestPolicyQueryStringsConfig& value) { m_queryStringsConfigHasBeenSet = true; m_queryStringsConfig = value; } /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline void SetQueryStringsConfig(OriginRequestPolicyQueryStringsConfig&& value) { m_queryStringsConfigHasBeenSet = true; m_queryStringsConfig = std::move(value); } /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline OriginRequestPolicyConfig& WithQueryStringsConfig(const OriginRequestPolicyQueryStringsConfig& value) { SetQueryStringsConfig(value); return *this;} /** *

The URL query strings from viewer requests to include in origin requests.

*/ inline OriginRequestPolicyConfig& WithQueryStringsConfig(OriginRequestPolicyQueryStringsConfig&& value) { SetQueryStringsConfig(std::move(value)); return *this;} private: Aws::String m_comment; bool m_commentHasBeenSet = false; Aws::String m_name; bool m_nameHasBeenSet = false; OriginRequestPolicyHeadersConfig m_headersConfig; bool m_headersConfigHasBeenSet = false; OriginRequestPolicyCookiesConfig m_cookiesConfig; bool m_cookiesConfigHasBeenSet = false; OriginRequestPolicyQueryStringsConfig m_queryStringsConfig; bool m_queryStringsConfigHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws