AWS SDK for C++

AWS SDK for C++ Version 1.11.612

Loading...
Searching...
No Matches
Cors.h
1
6#pragma once
7#include <aws/apigatewayv2/ApiGatewayV2_EXPORTS.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/core/utils/memory/stl/AWSString.h>
10#include <utility>
11
12namespace Aws
13{
14namespace Utils
15{
16namespace Json
17{
18 class JsonValue;
19 class JsonView;
20} // namespace Json
21} // namespace Utils
22namespace ApiGatewayV2
23{
24namespace Model
25{
26
34 class Cors
35 {
36 public:
37 AWS_APIGATEWAYV2_API Cors() = default;
38 AWS_APIGATEWAYV2_API Cors(Aws::Utils::Json::JsonView jsonValue);
39 AWS_APIGATEWAYV2_API Cors& operator=(Aws::Utils::Json::JsonView jsonValue);
40 AWS_APIGATEWAYV2_API Aws::Utils::Json::JsonValue Jsonize() const;
41
42
44
48 inline bool GetAllowCredentials() const { return m_allowCredentials; }
49 inline bool AllowCredentialsHasBeenSet() const { return m_allowCredentialsHasBeenSet; }
50 inline void SetAllowCredentials(bool value) { m_allowCredentialsHasBeenSet = true; m_allowCredentials = value; }
51 inline Cors& WithAllowCredentials(bool value) { SetAllowCredentials(value); return *this;}
53
55
58 inline const Aws::Vector<Aws::String>& GetAllowHeaders() const { return m_allowHeaders; }
59 inline bool AllowHeadersHasBeenSet() const { return m_allowHeadersHasBeenSet; }
60 template<typename AllowHeadersT = Aws::Vector<Aws::String>>
61 void SetAllowHeaders(AllowHeadersT&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders = std::forward<AllowHeadersT>(value); }
62 template<typename AllowHeadersT = Aws::Vector<Aws::String>>
63 Cors& WithAllowHeaders(AllowHeadersT&& value) { SetAllowHeaders(std::forward<AllowHeadersT>(value)); return *this;}
64 template<typename AllowHeadersT = Aws::String>
65 Cors& AddAllowHeaders(AllowHeadersT&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.emplace_back(std::forward<AllowHeadersT>(value)); return *this; }
67
69
73 inline const Aws::Vector<Aws::String>& GetAllowMethods() const { return m_allowMethods; }
74 inline bool AllowMethodsHasBeenSet() const { return m_allowMethodsHasBeenSet; }
75 template<typename AllowMethodsT = Aws::Vector<Aws::String>>
76 void SetAllowMethods(AllowMethodsT&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods = std::forward<AllowMethodsT>(value); }
77 template<typename AllowMethodsT = Aws::Vector<Aws::String>>
78 Cors& WithAllowMethods(AllowMethodsT&& value) { SetAllowMethods(std::forward<AllowMethodsT>(value)); return *this;}
79 template<typename AllowMethodsT = Aws::String>
80 Cors& AddAllowMethods(AllowMethodsT&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods.emplace_back(std::forward<AllowMethodsT>(value)); return *this; }
82
84
87 inline const Aws::Vector<Aws::String>& GetAllowOrigins() const { return m_allowOrigins; }
88 inline bool AllowOriginsHasBeenSet() const { return m_allowOriginsHasBeenSet; }
89 template<typename AllowOriginsT = Aws::Vector<Aws::String>>
90 void SetAllowOrigins(AllowOriginsT&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins = std::forward<AllowOriginsT>(value); }
91 template<typename AllowOriginsT = Aws::Vector<Aws::String>>
92 Cors& WithAllowOrigins(AllowOriginsT&& value) { SetAllowOrigins(std::forward<AllowOriginsT>(value)); return *this;}
93 template<typename AllowOriginsT = Aws::String>
94 Cors& AddAllowOrigins(AllowOriginsT&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins.emplace_back(std::forward<AllowOriginsT>(value)); return *this; }
96
98
101 inline const Aws::Vector<Aws::String>& GetExposeHeaders() const { return m_exposeHeaders; }
102 inline bool ExposeHeadersHasBeenSet() const { return m_exposeHeadersHasBeenSet; }
103 template<typename ExposeHeadersT = Aws::Vector<Aws::String>>
104 void SetExposeHeaders(ExposeHeadersT&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders = std::forward<ExposeHeadersT>(value); }
105 template<typename ExposeHeadersT = Aws::Vector<Aws::String>>
106 Cors& WithExposeHeaders(ExposeHeadersT&& value) { SetExposeHeaders(std::forward<ExposeHeadersT>(value)); return *this;}
107 template<typename ExposeHeadersT = Aws::String>
108 Cors& AddExposeHeaders(ExposeHeadersT&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders.emplace_back(std::forward<ExposeHeadersT>(value)); return *this; }
110
112
116 inline int GetMaxAge() const { return m_maxAge; }
117 inline bool MaxAgeHasBeenSet() const { return m_maxAgeHasBeenSet; }
118 inline void SetMaxAge(int value) { m_maxAgeHasBeenSet = true; m_maxAge = value; }
119 inline Cors& WithMaxAge(int value) { SetMaxAge(value); return *this;}
121 private:
122
123 bool m_allowCredentials{false};
124 bool m_allowCredentialsHasBeenSet = false;
125
126 Aws::Vector<Aws::String> m_allowHeaders;
127 bool m_allowHeadersHasBeenSet = false;
128
129 Aws::Vector<Aws::String> m_allowMethods;
130 bool m_allowMethodsHasBeenSet = false;
131
132 Aws::Vector<Aws::String> m_allowOrigins;
133 bool m_allowOriginsHasBeenSet = false;
134
135 Aws::Vector<Aws::String> m_exposeHeaders;
136 bool m_exposeHeadersHasBeenSet = false;
137
138 int m_maxAge{0};
139 bool m_maxAgeHasBeenSet = false;
140 };
141
142} // namespace Model
143} // namespace ApiGatewayV2
144} // namespace Aws
Cors & WithAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:92
Cors & AddAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:65
AWS_APIGATEWAYV2_API Cors & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetAllowCredentials(bool value)
Definition Cors.h:50
Cors & AddAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:94
AWS_APIGATEWAYV2_API Aws::Utils::Json::JsonValue Jsonize() const
AWS_APIGATEWAYV2_API Cors(Aws::Utils::Json::JsonView jsonValue)
const Aws::Vector< Aws::String > & GetAllowMethods() const
Definition Cors.h:73
bool MaxAgeHasBeenSet() const
Definition Cors.h:117
bool AllowCredentialsHasBeenSet() const
Definition Cors.h:49
const Aws::Vector< Aws::String > & GetExposeHeaders() const
Definition Cors.h:101
const Aws::Vector< Aws::String > & GetAllowOrigins() const
Definition Cors.h:87
Cors & WithAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:63
bool ExposeHeadersHasBeenSet() const
Definition Cors.h:102
void SetAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:61
Cors & AddAllowMethods(AllowMethodsT &&value)
Definition Cors.h:80
bool AllowOriginsHasBeenSet() const
Definition Cors.h:88
void SetMaxAge(int value)
Definition Cors.h:118
void SetAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:90
bool GetAllowCredentials() const
Definition Cors.h:48
Cors & WithExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:106
bool AllowMethodsHasBeenSet() const
Definition Cors.h:74
AWS_APIGATEWAYV2_API Cors()=default
void SetAllowMethods(AllowMethodsT &&value)
Definition Cors.h:76
Cors & WithMaxAge(int value)
Definition Cors.h:119
Cors & WithAllowCredentials(bool value)
Definition Cors.h:51
bool AllowHeadersHasBeenSet() const
Definition Cors.h:59
void SetExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:104
const Aws::Vector< Aws::String > & GetAllowHeaders() const
Definition Cors.h:58
Cors & AddExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:108
Cors & WithAllowMethods(AllowMethodsT &&value)
Definition Cors.h:78
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue