/** * 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 { /** *

A configuration for a set of HTTP response headers that are used for * cross-origin resource sharing (CORS). CloudFront adds these headers to HTTP * responses that it sends for CORS requests that match a cache behavior associated * with this response headers policy.

For more information about CORS, see * Cross-Origin * Resource Sharing (CORS) in the MDN Web Docs.

See Also:

AWS * API Reference

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

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline const ResponseHeadersPolicyAccessControlAllowOrigins& GetAccessControlAllowOrigins() const{ return m_accessControlAllowOrigins; } /** *

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline bool AccessControlAllowOriginsHasBeenSet() const { return m_accessControlAllowOriginsHasBeenSet; } /** *

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline void SetAccessControlAllowOrigins(const ResponseHeadersPolicyAccessControlAllowOrigins& value) { m_accessControlAllowOriginsHasBeenSet = true; m_accessControlAllowOrigins = value; } /** *

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline void SetAccessControlAllowOrigins(ResponseHeadersPolicyAccessControlAllowOrigins&& value) { m_accessControlAllowOriginsHasBeenSet = true; m_accessControlAllowOrigins = std::move(value); } /** *

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowOrigins(const ResponseHeadersPolicyAccessControlAllowOrigins& value) { SetAccessControlAllowOrigins(value); return *this;} /** *

A list of origins (domain names) that CloudFront can use as the value for the * Access-Control-Allow-Origin HTTP response header.

For more * information about the Access-Control-Allow-Origin HTTP response * header, see Access-Control-Allow-Origin * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowOrigins(ResponseHeadersPolicyAccessControlAllowOrigins&& value) { SetAccessControlAllowOrigins(std::move(value)); return *this;} /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline const ResponseHeadersPolicyAccessControlAllowHeaders& GetAccessControlAllowHeaders() const{ return m_accessControlAllowHeaders; } /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline bool AccessControlAllowHeadersHasBeenSet() const { return m_accessControlAllowHeadersHasBeenSet; } /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline void SetAccessControlAllowHeaders(const ResponseHeadersPolicyAccessControlAllowHeaders& value) { m_accessControlAllowHeadersHasBeenSet = true; m_accessControlAllowHeaders = value; } /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline void SetAccessControlAllowHeaders(ResponseHeadersPolicyAccessControlAllowHeaders&& value) { m_accessControlAllowHeadersHasBeenSet = true; m_accessControlAllowHeaders = std::move(value); } /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowHeaders(const ResponseHeadersPolicyAccessControlAllowHeaders& value) { SetAccessControlAllowHeaders(value); return *this;} /** *

A list of HTTP header names that CloudFront includes as values for the * Access-Control-Allow-Headers HTTP response header.

For more * information about the Access-Control-Allow-Headers HTTP response * header, see Access-Control-Allow-Headers * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowHeaders(ResponseHeadersPolicyAccessControlAllowHeaders&& value) { SetAccessControlAllowHeaders(std::move(value)); return *this;} /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline const ResponseHeadersPolicyAccessControlAllowMethods& GetAccessControlAllowMethods() const{ return m_accessControlAllowMethods; } /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline bool AccessControlAllowMethodsHasBeenSet() const { return m_accessControlAllowMethodsHasBeenSet; } /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline void SetAccessControlAllowMethods(const ResponseHeadersPolicyAccessControlAllowMethods& value) { m_accessControlAllowMethodsHasBeenSet = true; m_accessControlAllowMethods = value; } /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline void SetAccessControlAllowMethods(ResponseHeadersPolicyAccessControlAllowMethods&& value) { m_accessControlAllowMethodsHasBeenSet = true; m_accessControlAllowMethods = std::move(value); } /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowMethods(const ResponseHeadersPolicyAccessControlAllowMethods& value) { SetAccessControlAllowMethods(value); return *this;} /** *

A list of HTTP methods that CloudFront includes as values for the * Access-Control-Allow-Methods HTTP response header.

For more * information about the Access-Control-Allow-Methods HTTP response * header, see Access-Control-Allow-Methods * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowMethods(ResponseHeadersPolicyAccessControlAllowMethods&& value) { SetAccessControlAllowMethods(std::move(value)); return *this;} /** *

A Boolean that CloudFront uses as the value for the * Access-Control-Allow-Credentials HTTP response header.

For * more information about the Access-Control-Allow-Credentials HTTP * response header, see Access-Control-Allow-Credentials * in the MDN Web Docs.

*/ inline bool GetAccessControlAllowCredentials() const{ return m_accessControlAllowCredentials; } /** *

A Boolean that CloudFront uses as the value for the * Access-Control-Allow-Credentials HTTP response header.

For * more information about the Access-Control-Allow-Credentials HTTP * response header, see Access-Control-Allow-Credentials * in the MDN Web Docs.

*/ inline bool AccessControlAllowCredentialsHasBeenSet() const { return m_accessControlAllowCredentialsHasBeenSet; } /** *

A Boolean that CloudFront uses as the value for the * Access-Control-Allow-Credentials HTTP response header.

For * more information about the Access-Control-Allow-Credentials HTTP * response header, see Access-Control-Allow-Credentials * in the MDN Web Docs.

*/ inline void SetAccessControlAllowCredentials(bool value) { m_accessControlAllowCredentialsHasBeenSet = true; m_accessControlAllowCredentials = value; } /** *

A Boolean that CloudFront uses as the value for the * Access-Control-Allow-Credentials HTTP response header.

For * more information about the Access-Control-Allow-Credentials HTTP * response header, see Access-Control-Allow-Credentials * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlAllowCredentials(bool value) { SetAccessControlAllowCredentials(value); return *this;} /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline const ResponseHeadersPolicyAccessControlExposeHeaders& GetAccessControlExposeHeaders() const{ return m_accessControlExposeHeaders; } /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline bool AccessControlExposeHeadersHasBeenSet() const { return m_accessControlExposeHeadersHasBeenSet; } /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline void SetAccessControlExposeHeaders(const ResponseHeadersPolicyAccessControlExposeHeaders& value) { m_accessControlExposeHeadersHasBeenSet = true; m_accessControlExposeHeaders = value; } /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline void SetAccessControlExposeHeaders(ResponseHeadersPolicyAccessControlExposeHeaders&& value) { m_accessControlExposeHeadersHasBeenSet = true; m_accessControlExposeHeaders = std::move(value); } /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlExposeHeaders(const ResponseHeadersPolicyAccessControlExposeHeaders& value) { SetAccessControlExposeHeaders(value); return *this;} /** *

A list of HTTP headers that CloudFront includes as values for the * Access-Control-Expose-Headers HTTP response header.

For more * information about the Access-Control-Expose-Headers HTTP response * header, see Access-Control-Expose-Headers * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlExposeHeaders(ResponseHeadersPolicyAccessControlExposeHeaders&& value) { SetAccessControlExposeHeaders(std::move(value)); return *this;} /** *

A number that CloudFront uses as the value for the * Access-Control-Max-Age HTTP response header.

For more * information about the Access-Control-Max-Age HTTP response header, * see Access-Control-Max-Age * in the MDN Web Docs.

*/ inline int GetAccessControlMaxAgeSec() const{ return m_accessControlMaxAgeSec; } /** *

A number that CloudFront uses as the value for the * Access-Control-Max-Age HTTP response header.

For more * information about the Access-Control-Max-Age HTTP response header, * see Access-Control-Max-Age * in the MDN Web Docs.

*/ inline bool AccessControlMaxAgeSecHasBeenSet() const { return m_accessControlMaxAgeSecHasBeenSet; } /** *

A number that CloudFront uses as the value for the * Access-Control-Max-Age HTTP response header.

For more * information about the Access-Control-Max-Age HTTP response header, * see Access-Control-Max-Age * in the MDN Web Docs.

*/ inline void SetAccessControlMaxAgeSec(int value) { m_accessControlMaxAgeSecHasBeenSet = true; m_accessControlMaxAgeSec = value; } /** *

A number that CloudFront uses as the value for the * Access-Control-Max-Age HTTP response header.

For more * information about the Access-Control-Max-Age HTTP response header, * see Access-Control-Max-Age * in the MDN Web Docs.

*/ inline ResponseHeadersPolicyCorsConfig& WithAccessControlMaxAgeSec(int value) { SetAccessControlMaxAgeSec(value); return *this;} /** *

A Boolean that determines whether CloudFront overrides HTTP response headers * received from the origin with the ones specified in this response headers * policy.

*/ inline bool GetOriginOverride() const{ return m_originOverride; } /** *

A Boolean that determines whether CloudFront overrides HTTP response headers * received from the origin with the ones specified in this response headers * policy.

*/ inline bool OriginOverrideHasBeenSet() const { return m_originOverrideHasBeenSet; } /** *

A Boolean that determines whether CloudFront overrides HTTP response headers * received from the origin with the ones specified in this response headers * policy.

*/ inline void SetOriginOverride(bool value) { m_originOverrideHasBeenSet = true; m_originOverride = value; } /** *

A Boolean that determines whether CloudFront overrides HTTP response headers * received from the origin with the ones specified in this response headers * policy.

*/ inline ResponseHeadersPolicyCorsConfig& WithOriginOverride(bool value) { SetOriginOverride(value); return *this;} private: ResponseHeadersPolicyAccessControlAllowOrigins m_accessControlAllowOrigins; bool m_accessControlAllowOriginsHasBeenSet = false; ResponseHeadersPolicyAccessControlAllowHeaders m_accessControlAllowHeaders; bool m_accessControlAllowHeadersHasBeenSet = false; ResponseHeadersPolicyAccessControlAllowMethods m_accessControlAllowMethods; bool m_accessControlAllowMethodsHasBeenSet = false; bool m_accessControlAllowCredentials; bool m_accessControlAllowCredentialsHasBeenSet = false; ResponseHeadersPolicyAccessControlExposeHeaders m_accessControlExposeHeaders; bool m_accessControlExposeHeadersHasBeenSet = false; int m_accessControlMaxAgeSec; bool m_accessControlMaxAgeSecHasBeenSet = false; bool m_originOverride; bool m_originOverrideHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws