/** * 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 CloudFront origin access control configuration.

See Also:

* AWS * API Reference

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A name to identify the origin access control.

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

A description of the origin access control.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

A description of the origin access control.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

A description of the origin access control.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

A description of the origin access control.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

A description of the origin access control.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

A description of the origin access control.

*/ inline OriginAccessControlConfig& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

A description of the origin access control.

*/ inline OriginAccessControlConfig& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

A description of the origin access control.

*/ inline OriginAccessControlConfig& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline const OriginAccessControlSigningProtocols& GetSigningProtocol() const{ return m_signingProtocol; } /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline bool SigningProtocolHasBeenSet() const { return m_signingProtocolHasBeenSet; } /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline void SetSigningProtocol(const OriginAccessControlSigningProtocols& value) { m_signingProtocolHasBeenSet = true; m_signingProtocol = value; } /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline void SetSigningProtocol(OriginAccessControlSigningProtocols&& value) { m_signingProtocolHasBeenSet = true; m_signingProtocol = std::move(value); } /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline OriginAccessControlConfig& WithSigningProtocol(const OriginAccessControlSigningProtocols& value) { SetSigningProtocol(value); return *this;} /** *

The signing protocol of the origin access control, which determines how * CloudFront signs (authenticates) requests. The only valid value is * sigv4.

*/ inline OriginAccessControlConfig& WithSigningProtocol(OriginAccessControlSigningProtocols&& value) { SetSigningProtocol(std::move(value)); return *this;} /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline const OriginAccessControlSigningBehaviors& GetSigningBehavior() const{ return m_signingBehavior; } /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline bool SigningBehaviorHasBeenSet() const { return m_signingBehaviorHasBeenSet; } /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline void SetSigningBehavior(const OriginAccessControlSigningBehaviors& value) { m_signingBehaviorHasBeenSet = true; m_signingBehavior = value; } /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline void SetSigningBehavior(OriginAccessControlSigningBehaviors&& value) { m_signingBehaviorHasBeenSet = true; m_signingBehavior = std::move(value); } /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline OriginAccessControlConfig& WithSigningBehavior(const OriginAccessControlSigningBehaviors& value) { SetSigningBehavior(value); return *this;} /** *

Specifies which requests CloudFront signs (adds authentication information * to). Specify always for the most common use case. For more * information, see origin * access control advanced settings in the Amazon CloudFront Developer * Guide.

This field can have one of the following values:

  • *

    always – CloudFront signs all origin requests, overwriting the * Authorization header from the viewer request if one exists.

    *
  • never – CloudFront doesn't sign any origin requests. * This value turns off origin access control for all origins in all distributions * that use this origin access control.

  • no-override * – If the viewer request doesn't contain the Authorization header, * then CloudFront signs the origin request. If the viewer request contains the * Authorization header, then CloudFront doesn't sign the origin * request and instead passes along the Authorization header from the * viewer request. WARNING: To pass along the Authorization header * from the viewer request, you must add the Authorization * header to a cache * policy for all cache behaviors that use origins associated with this origin * access control.

*/ inline OriginAccessControlConfig& WithSigningBehavior(OriginAccessControlSigningBehaviors&& value) { SetSigningBehavior(std::move(value)); return *this;} /** *

The type of origin that this origin access control is for.

*/ inline const OriginAccessControlOriginTypes& GetOriginAccessControlOriginType() const{ return m_originAccessControlOriginType; } /** *

The type of origin that this origin access control is for.

*/ inline bool OriginAccessControlOriginTypeHasBeenSet() const { return m_originAccessControlOriginTypeHasBeenSet; } /** *

The type of origin that this origin access control is for.

*/ inline void SetOriginAccessControlOriginType(const OriginAccessControlOriginTypes& value) { m_originAccessControlOriginTypeHasBeenSet = true; m_originAccessControlOriginType = value; } /** *

The type of origin that this origin access control is for.

*/ inline void SetOriginAccessControlOriginType(OriginAccessControlOriginTypes&& value) { m_originAccessControlOriginTypeHasBeenSet = true; m_originAccessControlOriginType = std::move(value); } /** *

The type of origin that this origin access control is for.

*/ inline OriginAccessControlConfig& WithOriginAccessControlOriginType(const OriginAccessControlOriginTypes& value) { SetOriginAccessControlOriginType(value); return *this;} /** *

The type of origin that this origin access control is for.

*/ inline OriginAccessControlConfig& WithOriginAccessControlOriginType(OriginAccessControlOriginTypes&& value) { SetOriginAccessControlOriginType(std::move(value)); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; OriginAccessControlSigningProtocols m_signingProtocol; bool m_signingProtocolHasBeenSet = false; OriginAccessControlSigningBehaviors m_signingBehavior; bool m_signingBehaviorHasBeenSet = false; OriginAccessControlOriginTypes m_originAccessControlOriginType; bool m_originAccessControlOriginTypeHasBeenSet = false; }; } // namespace Model } // namespace CloudFront } // namespace Aws