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

Describes the request headers that a Lightsail distribution bases caching * on.

For the headers that you specify, your distribution caches separate * versions of the specified content based on the header values in viewer requests. * For example, suppose viewer requests for logo.jpg contain a custom * product header that has a value of either acme or * apex, and you configure your distribution to cache your content * based on values in the product header. Your distribution forwards * the product header to the origin and caches the response from the * origin once for each header value.

See Also:

AWS * API Reference

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

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline const ForwardValues& GetOption() const{ return m_option; } /** *

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline bool OptionHasBeenSet() const { return m_optionHasBeenSet; } /** *

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline void SetOption(const ForwardValues& value) { m_optionHasBeenSet = true; m_option = value; } /** *

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline void SetOption(ForwardValues&& value) { m_optionHasBeenSet = true; m_option = std::move(value); } /** *

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline HeaderObject& WithOption(const ForwardValues& value) { SetOption(value); return *this;} /** *

The headers that you want your distribution to forward to your origin and * base caching on.

You can configure your distribution to do one of the * following:

  • all - Forward all headers to * your origin.

  • none - Forward only the * default headers.

  • allow-list - Forward * only the headers you specify using the headersAllowList * parameter.

*/ inline HeaderObject& WithOption(ForwardValues&& value) { SetOption(std::move(value)); return *this;} /** *

The specific headers to forward to your distribution's origin.

*/ inline const Aws::Vector& GetHeadersAllowList() const{ return m_headersAllowList; } /** *

The specific headers to forward to your distribution's origin.

*/ inline bool HeadersAllowListHasBeenSet() const { return m_headersAllowListHasBeenSet; } /** *

The specific headers to forward to your distribution's origin.

*/ inline void SetHeadersAllowList(const Aws::Vector& value) { m_headersAllowListHasBeenSet = true; m_headersAllowList = value; } /** *

The specific headers to forward to your distribution's origin.

*/ inline void SetHeadersAllowList(Aws::Vector&& value) { m_headersAllowListHasBeenSet = true; m_headersAllowList = std::move(value); } /** *

The specific headers to forward to your distribution's origin.

*/ inline HeaderObject& WithHeadersAllowList(const Aws::Vector& value) { SetHeadersAllowList(value); return *this;} /** *

The specific headers to forward to your distribution's origin.

*/ inline HeaderObject& WithHeadersAllowList(Aws::Vector&& value) { SetHeadersAllowList(std::move(value)); return *this;} /** *

The specific headers to forward to your distribution's origin.

*/ inline HeaderObject& AddHeadersAllowList(const HeaderEnum& value) { m_headersAllowListHasBeenSet = true; m_headersAllowList.push_back(value); return *this; } /** *

The specific headers to forward to your distribution's origin.

*/ inline HeaderObject& AddHeadersAllowList(HeaderEnum&& value) { m_headersAllowListHasBeenSet = true; m_headersAllowList.push_back(std::move(value)); return *this; } private: ForwardValues m_option; bool m_optionHasBeenSet = false; Aws::Vector m_headersAllowList; bool m_headersAllowListHasBeenSet = false; }; } // namespace Model } // namespace Lightsail } // namespace Aws