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

An origin request policy.

When it's attached to a cache behavior, the * origin request policy 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 OriginRequestPolicy { public: AWS_CLOUDFRONT_API OriginRequestPolicy(); AWS_CLOUDFRONT_API OriginRequestPolicy(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_CLOUDFRONT_API OriginRequestPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_CLOUDFRONT_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const; /** *

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The unique identifier for the origin request policy.

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

The date and time when the origin request policy was last modified.

*/ inline const Aws::Utils::DateTime& GetLastModifiedTime() const{ return m_lastModifiedTime; } /** *

The date and time when the origin request policy was last modified.

*/ inline bool LastModifiedTimeHasBeenSet() const { return m_lastModifiedTimeHasBeenSet; } /** *

The date and time when the origin request policy was last modified.

*/ inline void SetLastModifiedTime(const Aws::Utils::DateTime& value) { m_lastModifiedTimeHasBeenSet = true; m_lastModifiedTime = value; } /** *

The date and time when the origin request policy was last modified.

*/ inline void SetLastModifiedTime(Aws::Utils::DateTime&& value) { m_lastModifiedTimeHasBeenSet = true; m_lastModifiedTime = std::move(value); } /** *

The date and time when the origin request policy was last modified.

*/ inline OriginRequestPolicy& WithLastModifiedTime(const Aws::Utils::DateTime& value) { SetLastModifiedTime(value); return *this;} /** *

The date and time when the origin request policy was last modified.

*/ inline OriginRequestPolicy& WithLastModifiedTime(Aws::Utils::DateTime&& value) { SetLastModifiedTime(std::move(value)); return *this;} /** *

The origin request policy configuration.

*/ inline const OriginRequestPolicyConfig& GetOriginRequestPolicyConfig() const{ return m_originRequestPolicyConfig; } /** *

The origin request policy configuration.

*/ inline bool OriginRequestPolicyConfigHasBeenSet() const { return m_originRequestPolicyConfigHasBeenSet; } /** *

The origin request policy configuration.

*/ inline void SetOriginRequestPolicyConfig(const OriginRequestPolicyConfig& value) { m_originRequestPolicyConfigHasBeenSet = true; m_originRequestPolicyConfig = value; } /** *

The origin request policy configuration.

*/ inline void SetOriginRequestPolicyConfig(OriginRequestPolicyConfig&& value) { m_originRequestPolicyConfigHasBeenSet = true; m_originRequestPolicyConfig = std::move(value); } /** *

The origin request policy configuration.

*/ inline OriginRequestPolicy& WithOriginRequestPolicyConfig(const OriginRequestPolicyConfig& value) { SetOriginRequestPolicyConfig(value); return *this;} /** *

The origin request policy configuration.

*/ inline OriginRequestPolicy& WithOriginRequestPolicyConfig(OriginRequestPolicyConfig&& value) { SetOriginRequestPolicyConfig(std::move(value)); return *this;} private: Aws::String m_id; bool m_idHasBeenSet = false; Aws::Utils::DateTime m_lastModifiedTime; bool m_lastModifiedTimeHasBeenSet = false; OriginRequestPolicyConfig m_originRequestPolicyConfig; bool m_originRequestPolicyConfigHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws