/** * 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 SecurityHub { namespace Model { /** *

Contains the cross-origin resource sharing (CORS) configuration for the API. * CORS is only supported for HTTP APIs.

See Also:

AWS * API Reference

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

The allowed origins for CORS requests.

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

Indicates whether the CORS request includes credentials.

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

Indicates whether the CORS request includes credentials.

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

Indicates whether the CORS request includes credentials.

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

Indicates whether the CORS request includes credentials.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The exposed headers for CORS requests.

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

The number of seconds for which the browser caches preflight request * results.

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

The number of seconds for which the browser caches preflight request * results.

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

The number of seconds for which the browser caches preflight request * results.

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

The number of seconds for which the browser caches preflight request * results.

*/ inline AwsCorsConfiguration& WithMaxAge(int value) { SetMaxAge(value); return *this;} /** *

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed methods for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

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

The allowed headers for CORS requests.

*/ inline AwsCorsConfiguration& AddAllowHeaders(const char* value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.push_back(value); return *this; } private: Aws::Vector m_allowOrigins; bool m_allowOriginsHasBeenSet = false; bool m_allowCredentials; bool m_allowCredentialsHasBeenSet = false; Aws::Vector m_exposeHeaders; bool m_exposeHeadersHasBeenSet = false; int m_maxAge; bool m_maxAgeHasBeenSet = false; Aws::Vector m_allowMethods; bool m_allowMethodsHasBeenSet = false; Aws::Vector m_allowHeaders; bool m_allowHeadersHasBeenSet = false; }; } // namespace Model } // namespace SecurityHub } // namespace Aws