AWS SDK for C++

AWS SDK for C++ Version 1.11.745

Loading...
Searching...
No Matches
Cors.h
1
6#pragma once
7#include <aws/apigatewayv2/ApiGatewayV2_EXPORTS.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10
11#include <utility>
12
13namespace Aws {
14namespace Utils {
15namespace Json {
16class JsonValue;
17class JsonView;
18} // namespace Json
19} // namespace Utils
20namespace ApiGatewayV2 {
21namespace Model {
22
30class Cors {
31 public:
32 AWS_APIGATEWAYV2_API Cors() = default;
33 AWS_APIGATEWAYV2_API Cors(Aws::Utils::Json::JsonView jsonValue);
34 AWS_APIGATEWAYV2_API Cors& operator=(Aws::Utils::Json::JsonView jsonValue);
35 AWS_APIGATEWAYV2_API Aws::Utils::Json::JsonValue Jsonize() const;
36
38
42 inline bool GetAllowCredentials() const { return m_allowCredentials; }
43 inline bool AllowCredentialsHasBeenSet() const { return m_allowCredentialsHasBeenSet; }
44 inline void SetAllowCredentials(bool value) {
45 m_allowCredentialsHasBeenSet = true;
46 m_allowCredentials = value;
47 }
48 inline Cors& WithAllowCredentials(bool value) {
50 return *this;
51 }
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) {
62 m_allowHeadersHasBeenSet = true;
63 m_allowHeaders = std::forward<AllowHeadersT>(value);
64 }
65 template <typename AllowHeadersT = Aws::Vector<Aws::String>>
66 Cors& WithAllowHeaders(AllowHeadersT&& value) {
67 SetAllowHeaders(std::forward<AllowHeadersT>(value));
68 return *this;
69 }
70 template <typename AllowHeadersT = Aws::String>
71 Cors& AddAllowHeaders(AllowHeadersT&& value) {
72 m_allowHeadersHasBeenSet = true;
73 m_allowHeaders.emplace_back(std::forward<AllowHeadersT>(value));
74 return *this;
75 }
77
79
83 inline const Aws::Vector<Aws::String>& GetAllowMethods() const { return m_allowMethods; }
84 inline bool AllowMethodsHasBeenSet() const { return m_allowMethodsHasBeenSet; }
85 template <typename AllowMethodsT = Aws::Vector<Aws::String>>
86 void SetAllowMethods(AllowMethodsT&& value) {
87 m_allowMethodsHasBeenSet = true;
88 m_allowMethods = std::forward<AllowMethodsT>(value);
89 }
90 template <typename AllowMethodsT = Aws::Vector<Aws::String>>
91 Cors& WithAllowMethods(AllowMethodsT&& value) {
92 SetAllowMethods(std::forward<AllowMethodsT>(value));
93 return *this;
94 }
95 template <typename AllowMethodsT = Aws::String>
96 Cors& AddAllowMethods(AllowMethodsT&& value) {
97 m_allowMethodsHasBeenSet = true;
98 m_allowMethods.emplace_back(std::forward<AllowMethodsT>(value));
99 return *this;
100 }
102
104
107 inline const Aws::Vector<Aws::String>& GetAllowOrigins() const { return m_allowOrigins; }
108 inline bool AllowOriginsHasBeenSet() const { return m_allowOriginsHasBeenSet; }
109 template <typename AllowOriginsT = Aws::Vector<Aws::String>>
110 void SetAllowOrigins(AllowOriginsT&& value) {
111 m_allowOriginsHasBeenSet = true;
112 m_allowOrigins = std::forward<AllowOriginsT>(value);
113 }
114 template <typename AllowOriginsT = Aws::Vector<Aws::String>>
115 Cors& WithAllowOrigins(AllowOriginsT&& value) {
116 SetAllowOrigins(std::forward<AllowOriginsT>(value));
117 return *this;
118 }
119 template <typename AllowOriginsT = Aws::String>
120 Cors& AddAllowOrigins(AllowOriginsT&& value) {
121 m_allowOriginsHasBeenSet = true;
122 m_allowOrigins.emplace_back(std::forward<AllowOriginsT>(value));
123 return *this;
124 }
126
128
131 inline const Aws::Vector<Aws::String>& GetExposeHeaders() const { return m_exposeHeaders; }
132 inline bool ExposeHeadersHasBeenSet() const { return m_exposeHeadersHasBeenSet; }
133 template <typename ExposeHeadersT = Aws::Vector<Aws::String>>
134 void SetExposeHeaders(ExposeHeadersT&& value) {
135 m_exposeHeadersHasBeenSet = true;
136 m_exposeHeaders = std::forward<ExposeHeadersT>(value);
137 }
138 template <typename ExposeHeadersT = Aws::Vector<Aws::String>>
139 Cors& WithExposeHeaders(ExposeHeadersT&& value) {
140 SetExposeHeaders(std::forward<ExposeHeadersT>(value));
141 return *this;
142 }
143 template <typename ExposeHeadersT = Aws::String>
144 Cors& AddExposeHeaders(ExposeHeadersT&& value) {
145 m_exposeHeadersHasBeenSet = true;
146 m_exposeHeaders.emplace_back(std::forward<ExposeHeadersT>(value));
147 return *this;
148 }
150
152
156 inline int GetMaxAge() const { return m_maxAge; }
157 inline bool MaxAgeHasBeenSet() const { return m_maxAgeHasBeenSet; }
158 inline void SetMaxAge(int value) {
159 m_maxAgeHasBeenSet = true;
160 m_maxAge = value;
161 }
162 inline Cors& WithMaxAge(int value) {
163 SetMaxAge(value);
164 return *this;
165 }
167 private:
168 bool m_allowCredentials{false};
169
170 Aws::Vector<Aws::String> m_allowHeaders;
171
172 Aws::Vector<Aws::String> m_allowMethods;
173
174 Aws::Vector<Aws::String> m_allowOrigins;
175
176 Aws::Vector<Aws::String> m_exposeHeaders;
177
178 int m_maxAge{0};
179 bool m_allowCredentialsHasBeenSet = false;
180 bool m_allowHeadersHasBeenSet = false;
181 bool m_allowMethodsHasBeenSet = false;
182 bool m_allowOriginsHasBeenSet = false;
183 bool m_exposeHeadersHasBeenSet = false;
184 bool m_maxAgeHasBeenSet = false;
185};
186
187} // namespace Model
188} // namespace ApiGatewayV2
189} // namespace Aws
Cors & WithAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:115
Cors & AddAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:71
AWS_APIGATEWAYV2_API Cors & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetAllowCredentials(bool value)
Definition Cors.h:44
Cors & AddAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:120
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:83
bool MaxAgeHasBeenSet() const
Definition Cors.h:157
bool AllowCredentialsHasBeenSet() const
Definition Cors.h:43
const Aws::Vector< Aws::String > & GetExposeHeaders() const
Definition Cors.h:131
const Aws::Vector< Aws::String > & GetAllowOrigins() const
Definition Cors.h:107
Cors & WithAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:66
bool ExposeHeadersHasBeenSet() const
Definition Cors.h:132
void SetAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:61
Cors & AddAllowMethods(AllowMethodsT &&value)
Definition Cors.h:96
bool AllowOriginsHasBeenSet() const
Definition Cors.h:108
void SetMaxAge(int value)
Definition Cors.h:158
void SetAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:110
bool GetAllowCredentials() const
Definition Cors.h:42
Cors & WithExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:139
bool AllowMethodsHasBeenSet() const
Definition Cors.h:84
AWS_APIGATEWAYV2_API Cors()=default
void SetAllowMethods(AllowMethodsT &&value)
Definition Cors.h:86
Cors & WithMaxAge(int value)
Definition Cors.h:162
Cors & WithAllowCredentials(bool value)
Definition Cors.h:48
bool AllowHeadersHasBeenSet() const
Definition Cors.h:59
void SetExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:134
const Aws::Vector< Aws::String > & GetAllowHeaders() const
Definition Cors.h:58
Cors & AddExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:144
Cors & WithAllowMethods(AllowMethodsT &&value)
Definition Cors.h:91
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue