/** * 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 Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Lightsail { namespace Model { /** *

Describes the cache settings of an Amazon Lightsail content delivery network * (CDN) distribution.

These settings apply only to your distribution's * cacheBehaviors (including the defaultCacheBehavior) * that have a behavior of cache.

See * Also:

AWS * API Reference

*/ class CacheSettings { public: AWS_LIGHTSAIL_API CacheSettings(); AWS_LIGHTSAIL_API CacheSettings(Aws::Utils::Json::JsonView jsonValue); AWS_LIGHTSAIL_API CacheSettings& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_LIGHTSAIL_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The default amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the content has been updated.

The value specified applies * only when the origin does not add HTTP headers such as Cache-Control * max-age, Cache-Control s-maxage, and Expires to * objects.

*/ inline long long GetDefaultTTL() const{ return m_defaultTTL; } /** *

The default amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the content has been updated.

The value specified applies * only when the origin does not add HTTP headers such as Cache-Control * max-age, Cache-Control s-maxage, and Expires to * objects.

*/ inline bool DefaultTTLHasBeenSet() const { return m_defaultTTLHasBeenSet; } /** *

The default amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the content has been updated.

The value specified applies * only when the origin does not add HTTP headers such as Cache-Control * max-age, Cache-Control s-maxage, and Expires to * objects.

*/ inline void SetDefaultTTL(long long value) { m_defaultTTLHasBeenSet = true; m_defaultTTL = value; } /** *

The default amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the content has been updated.

The value specified applies * only when the origin does not add HTTP headers such as Cache-Control * max-age, Cache-Control s-maxage, and Expires to * objects.

*/ inline CacheSettings& WithDefaultTTL(long long value) { SetDefaultTTL(value); return *this;} /** *

The minimum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

A value of 0 must be * specified for minimumTTL if the distribution is configured to * forward all headers to the origin.

*/ inline long long GetMinimumTTL() const{ return m_minimumTTL; } /** *

The minimum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

A value of 0 must be * specified for minimumTTL if the distribution is configured to * forward all headers to the origin.

*/ inline bool MinimumTTLHasBeenSet() const { return m_minimumTTLHasBeenSet; } /** *

The minimum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

A value of 0 must be * specified for minimumTTL if the distribution is configured to * forward all headers to the origin.

*/ inline void SetMinimumTTL(long long value) { m_minimumTTLHasBeenSet = true; m_minimumTTL = value; } /** *

The minimum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

A value of 0 must be * specified for minimumTTL if the distribution is configured to * forward all headers to the origin.

*/ inline CacheSettings& WithMinimumTTL(long long value) { SetMinimumTTL(value); return *this;} /** *

The maximum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

The value specified applies only * when the origin adds HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects.

*/ inline long long GetMaximumTTL() const{ return m_maximumTTL; } /** *

The maximum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

The value specified applies only * when the origin adds HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects.

*/ inline bool MaximumTTLHasBeenSet() const { return m_maximumTTLHasBeenSet; } /** *

The maximum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

The value specified applies only * when the origin adds HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects.

*/ inline void SetMaximumTTL(long long value) { m_maximumTTLHasBeenSet = true; m_maximumTTL = value; } /** *

The maximum amount of time that objects stay in the distribution's cache * before the distribution forwards another request to the origin to determine * whether the object has been updated.

The value specified applies only * when the origin adds HTTP headers such as Cache-Control max-age, * Cache-Control s-maxage, and Expires to objects.

*/ inline CacheSettings& WithMaximumTTL(long long value) { SetMaximumTTL(value); return *this;} /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline const Aws::String& GetAllowedHTTPMethods() const{ return m_allowedHTTPMethods; } /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline bool AllowedHTTPMethodsHasBeenSet() const { return m_allowedHTTPMethodsHasBeenSet; } /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline void SetAllowedHTTPMethods(const Aws::String& value) { m_allowedHTTPMethodsHasBeenSet = true; m_allowedHTTPMethods = value; } /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline void SetAllowedHTTPMethods(Aws::String&& value) { m_allowedHTTPMethodsHasBeenSet = true; m_allowedHTTPMethods = std::move(value); } /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline void SetAllowedHTTPMethods(const char* value) { m_allowedHTTPMethodsHasBeenSet = true; m_allowedHTTPMethods.assign(value); } /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline CacheSettings& WithAllowedHTTPMethods(const Aws::String& value) { SetAllowedHTTPMethods(value); return *this;} /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline CacheSettings& WithAllowedHTTPMethods(Aws::String&& value) { SetAllowedHTTPMethods(std::move(value)); return *this;} /** *

The HTTP methods that are processed and forwarded to the distribution's * origin.

You can specify the following options:

  • * GET,HEAD - The distribution forwards the GET and * HEAD methods.

  • GET,HEAD,OPTIONS - * The distribution forwards the GET, HEAD, and * OPTIONS methods.

  • * GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards * the GET, HEAD, OPTIONS, PUT, * PATCH, POST, and DELETE methods.

    *

If you specify the third option, you might need to restrict * access to your distribution's origin so users can't perform operations that you * don't want them to. For example, you might not want users to have permission to * delete objects from your origin.

*/ inline CacheSettings& WithAllowedHTTPMethods(const char* value) { SetAllowedHTTPMethods(value); return *this;} /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline const Aws::String& GetCachedHTTPMethods() const{ return m_cachedHTTPMethods; } /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline bool CachedHTTPMethodsHasBeenSet() const { return m_cachedHTTPMethodsHasBeenSet; } /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline void SetCachedHTTPMethods(const Aws::String& value) { m_cachedHTTPMethodsHasBeenSet = true; m_cachedHTTPMethods = value; } /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline void SetCachedHTTPMethods(Aws::String&& value) { m_cachedHTTPMethodsHasBeenSet = true; m_cachedHTTPMethods = std::move(value); } /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline void SetCachedHTTPMethods(const char* value) { m_cachedHTTPMethodsHasBeenSet = true; m_cachedHTTPMethods.assign(value); } /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline CacheSettings& WithCachedHTTPMethods(const Aws::String& value) { SetCachedHTTPMethods(value); return *this;} /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline CacheSettings& WithCachedHTTPMethods(Aws::String&& value) { SetCachedHTTPMethods(std::move(value)); return *this;} /** *

The HTTP method responses that are cached by your distribution.

You * can specify the following options:

  • GET,HEAD - The * distribution caches responses to the GET and HEAD * methods.

  • GET,HEAD,OPTIONS - The distribution * caches responses to the GET, HEAD, and * OPTIONS methods.

*/ inline CacheSettings& WithCachedHTTPMethods(const char* value) { SetCachedHTTPMethods(value); return *this;} /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline const CookieObject& GetForwardedCookies() const{ return m_forwardedCookies; } /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline bool ForwardedCookiesHasBeenSet() const { return m_forwardedCookiesHasBeenSet; } /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline void SetForwardedCookies(const CookieObject& value) { m_forwardedCookiesHasBeenSet = true; m_forwardedCookies = value; } /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline void SetForwardedCookies(CookieObject&& value) { m_forwardedCookiesHasBeenSet = true; m_forwardedCookies = std::move(value); } /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline CacheSettings& WithForwardedCookies(const CookieObject& value) { SetForwardedCookies(value); return *this;} /** *

An object that describes the cookies that are forwarded to the origin. Your * content is cached based on the cookies that are forwarded.

*/ inline CacheSettings& WithForwardedCookies(CookieObject&& value) { SetForwardedCookies(std::move(value)); return *this;} /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline const HeaderObject& GetForwardedHeaders() const{ return m_forwardedHeaders; } /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline bool ForwardedHeadersHasBeenSet() const { return m_forwardedHeadersHasBeenSet; } /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline void SetForwardedHeaders(const HeaderObject& value) { m_forwardedHeadersHasBeenSet = true; m_forwardedHeaders = value; } /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline void SetForwardedHeaders(HeaderObject&& value) { m_forwardedHeadersHasBeenSet = true; m_forwardedHeaders = std::move(value); } /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline CacheSettings& WithForwardedHeaders(const HeaderObject& value) { SetForwardedHeaders(value); return *this;} /** *

An object that describes the headers that are forwarded to the origin. Your * content is cached based on the headers that are forwarded.

*/ inline CacheSettings& WithForwardedHeaders(HeaderObject&& value) { SetForwardedHeaders(std::move(value)); return *this;} /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline const QueryStringObject& GetForwardedQueryStrings() const{ return m_forwardedQueryStrings; } /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline bool ForwardedQueryStringsHasBeenSet() const { return m_forwardedQueryStringsHasBeenSet; } /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline void SetForwardedQueryStrings(const QueryStringObject& value) { m_forwardedQueryStringsHasBeenSet = true; m_forwardedQueryStrings = value; } /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline void SetForwardedQueryStrings(QueryStringObject&& value) { m_forwardedQueryStringsHasBeenSet = true; m_forwardedQueryStrings = std::move(value); } /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline CacheSettings& WithForwardedQueryStrings(const QueryStringObject& value) { SetForwardedQueryStrings(value); return *this;} /** *

An object that describes the query strings that are forwarded to the origin. * Your content is cached based on the query strings that are forwarded.

*/ inline CacheSettings& WithForwardedQueryStrings(QueryStringObject&& value) { SetForwardedQueryStrings(std::move(value)); return *this;} private: long long m_defaultTTL; bool m_defaultTTLHasBeenSet = false; long long m_minimumTTL; bool m_minimumTTLHasBeenSet = false; long long m_maximumTTL; bool m_maximumTTLHasBeenSet = false; Aws::String m_allowedHTTPMethods; bool m_allowedHTTPMethodsHasBeenSet = false; Aws::String m_cachedHTTPMethods; bool m_cachedHTTPMethodsHasBeenSet = false; CookieObject m_forwardedCookies; bool m_forwardedCookiesHasBeenSet = false; HeaderObject m_forwardedHeaders; bool m_forwardedHeadersHasBeenSet = false; QueryStringObject m_forwardedQueryStrings; bool m_forwardedQueryStringsHasBeenSet = false; }; } // namespace Model } // namespace Lightsail } // namespace Aws