/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ApiGatewayV2 { namespace Model { /** *

Represents a CORS configuration. Supported only for HTTP APIs. See Configuring * CORS for more information.

See Also:

AWS * API Reference

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

Specifies whether credentials are included in the CORS request. Supported * only for HTTP APIs.

*/ inline bool GetAllowCredentials() const{ return m_allowCredentials; } /** *

Specifies whether credentials are included in the CORS request. Supported * only for HTTP APIs.

*/ inline bool AllowCredentialsHasBeenSet() const { return m_allowCredentialsHasBeenSet; } /** *

Specifies whether credentials are included in the CORS request. Supported * only for HTTP APIs.

*/ inline void SetAllowCredentials(bool value) { m_allowCredentialsHasBeenSet = true; m_allowCredentials = value; } /** *

Specifies whether credentials are included in the CORS request. Supported * only for HTTP APIs.

*/ inline Cors& WithAllowCredentials(bool value) { SetAllowCredentials(value); return *this;} /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline const Aws::Vector& GetAllowHeaders() const{ return m_allowHeaders; } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline bool AllowHeadersHasBeenSet() const { return m_allowHeadersHasBeenSet; } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline void SetAllowHeaders(const Aws::Vector& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders = value; } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline void SetAllowHeaders(Aws::Vector&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders = std::move(value); } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline Cors& WithAllowHeaders(const Aws::Vector& value) { SetAllowHeaders(value); return *this;} /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline Cors& WithAllowHeaders(Aws::Vector&& value) { SetAllowHeaders(std::move(value)); return *this;} /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline Cors& AddAllowHeaders(const Aws::String& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.push_back(value); return *this; } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline Cors& AddAllowHeaders(Aws::String&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.push_back(std::move(value)); return *this; } /** *

Represents a collection of allowed headers. Supported only for HTTP APIs.

*/ inline Cors& AddAllowHeaders(const char* value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.push_back(value); return *this; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline const Aws::Vector& GetAllowMethods() const{ return m_allowMethods; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline bool AllowMethodsHasBeenSet() const { return m_allowMethodsHasBeenSet; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline void SetAllowMethods(const Aws::Vector& value) { m_allowMethodsHasBeenSet = true; m_allowMethods = value; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline void SetAllowMethods(Aws::Vector&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods = std::move(value); } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline Cors& WithAllowMethods(const Aws::Vector& value) { SetAllowMethods(value); return *this;} /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline Cors& WithAllowMethods(Aws::Vector&& value) { SetAllowMethods(std::move(value)); return *this;} /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline Cors& AddAllowMethods(const Aws::String& value) { m_allowMethodsHasBeenSet = true; m_allowMethods.push_back(value); return *this; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline Cors& AddAllowMethods(Aws::String&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods.push_back(std::move(value)); return *this; } /** *

Represents a collection of allowed HTTP methods. Supported only for HTTP * APIs.

*/ inline Cors& AddAllowMethods(const char* value) { m_allowMethodsHasBeenSet = true; m_allowMethods.push_back(value); return *this; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline const Aws::Vector& GetAllowOrigins() const{ return m_allowOrigins; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline bool AllowOriginsHasBeenSet() const { return m_allowOriginsHasBeenSet; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline void SetAllowOrigins(const Aws::Vector& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins = value; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline void SetAllowOrigins(Aws::Vector&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins = std::move(value); } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline Cors& WithAllowOrigins(const Aws::Vector& value) { SetAllowOrigins(value); return *this;} /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline Cors& WithAllowOrigins(Aws::Vector&& value) { SetAllowOrigins(std::move(value)); return *this;} /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline Cors& AddAllowOrigins(const Aws::String& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins.push_back(value); return *this; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline Cors& AddAllowOrigins(Aws::String&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins.push_back(std::move(value)); return *this; } /** *

Represents a collection of allowed origins. Supported only for HTTP APIs.

*/ inline Cors& AddAllowOrigins(const char* value) { m_allowOriginsHasBeenSet = true; m_allowOrigins.push_back(value); return *this; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline const Aws::Vector& GetExposeHeaders() const{ return m_exposeHeaders; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline bool ExposeHeadersHasBeenSet() const { return m_exposeHeadersHasBeenSet; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline void SetExposeHeaders(const Aws::Vector& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders = value; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline void SetExposeHeaders(Aws::Vector&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders = std::move(value); } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline Cors& WithExposeHeaders(const Aws::Vector& value) { SetExposeHeaders(value); return *this;} /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline Cors& WithExposeHeaders(Aws::Vector&& value) { SetExposeHeaders(std::move(value)); return *this;} /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline Cors& AddExposeHeaders(const Aws::String& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders.push_back(value); return *this; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline Cors& AddExposeHeaders(Aws::String&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders.push_back(std::move(value)); return *this; } /** *

Represents a collection of exposed headers. Supported only for HTTP APIs.

*/ inline Cors& AddExposeHeaders(const char* value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders.push_back(value); return *this; } /** *

The number of seconds that the browser should cache preflight request * results. Supported only for HTTP APIs.

*/ inline int GetMaxAge() const{ return m_maxAge; } /** *

The number of seconds that the browser should cache preflight request * results. Supported only for HTTP APIs.

*/ inline bool MaxAgeHasBeenSet() const { return m_maxAgeHasBeenSet; } /** *

The number of seconds that the browser should cache preflight request * results. Supported only for HTTP APIs.

*/ inline void SetMaxAge(int value) { m_maxAgeHasBeenSet = true; m_maxAge = value; } /** *

The number of seconds that the browser should cache preflight request * results. Supported only for HTTP APIs.

*/ inline Cors& WithMaxAge(int value) { SetMaxAge(value); return *this;} private: bool m_allowCredentials; bool m_allowCredentialsHasBeenSet = false; Aws::Vector m_allowHeaders; bool m_allowHeadersHasBeenSet = false; Aws::Vector m_allowMethods; bool m_allowMethodsHasBeenSet = false; Aws::Vector m_allowOrigins; bool m_allowOriginsHasBeenSet = false; Aws::Vector m_exposeHeaders; bool m_exposeHeadersHasBeenSet = false; int m_maxAge; bool m_maxAgeHasBeenSet = false; }; } // namespace Model } // namespace ApiGatewayV2 } // namespace Aws