AWS SDK for C++

AWS SDK for C++ Version 1.11.606

Loading...
Searching...
No Matches
Cors.h
1
6#pragma once
7#include <aws/lambda/Lambda_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 Lambda
23{
24namespace Model
25{
26
37 class Cors
38 {
39 public:
40 AWS_LAMBDA_API Cors() = default;
41 AWS_LAMBDA_API Cors(Aws::Utils::Json::JsonView jsonValue);
42 AWS_LAMBDA_API Cors& operator=(Aws::Utils::Json::JsonView jsonValue);
43 AWS_LAMBDA_API Aws::Utils::Json::JsonValue Jsonize() const;
44
45
47
51 inline bool GetAllowCredentials() const { return m_allowCredentials; }
52 inline bool AllowCredentialsHasBeenSet() const { return m_allowCredentialsHasBeenSet; }
53 inline void SetAllowCredentials(bool value) { m_allowCredentialsHasBeenSet = true; m_allowCredentials = value; }
54 inline Cors& WithAllowCredentials(bool value) { SetAllowCredentials(value); return *this;}
56
58
63 inline const Aws::Vector<Aws::String>& GetAllowHeaders() const { return m_allowHeaders; }
64 inline bool AllowHeadersHasBeenSet() const { return m_allowHeadersHasBeenSet; }
65 template<typename AllowHeadersT = Aws::Vector<Aws::String>>
66 void SetAllowHeaders(AllowHeadersT&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders = std::forward<AllowHeadersT>(value); }
67 template<typename AllowHeadersT = Aws::Vector<Aws::String>>
68 Cors& WithAllowHeaders(AllowHeadersT&& value) { SetAllowHeaders(std::forward<AllowHeadersT>(value)); return *this;}
69 template<typename AllowHeadersT = Aws::String>
70 Cors& AddAllowHeaders(AllowHeadersT&& value) { m_allowHeadersHasBeenSet = true; m_allowHeaders.emplace_back(std::forward<AllowHeadersT>(value)); return *this; }
72
74
79 inline const Aws::Vector<Aws::String>& GetAllowMethods() const { return m_allowMethods; }
80 inline bool AllowMethodsHasBeenSet() const { return m_allowMethodsHasBeenSet; }
81 template<typename AllowMethodsT = Aws::Vector<Aws::String>>
82 void SetAllowMethods(AllowMethodsT&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods = std::forward<AllowMethodsT>(value); }
83 template<typename AllowMethodsT = Aws::Vector<Aws::String>>
84 Cors& WithAllowMethods(AllowMethodsT&& value) { SetAllowMethods(std::forward<AllowMethodsT>(value)); return *this;}
85 template<typename AllowMethodsT = Aws::String>
86 Cors& AddAllowMethods(AllowMethodsT&& value) { m_allowMethodsHasBeenSet = true; m_allowMethods.emplace_back(std::forward<AllowMethodsT>(value)); return *this; }
88
90
97 inline const Aws::Vector<Aws::String>& GetAllowOrigins() const { return m_allowOrigins; }
98 inline bool AllowOriginsHasBeenSet() const { return m_allowOriginsHasBeenSet; }
99 template<typename AllowOriginsT = Aws::Vector<Aws::String>>
100 void SetAllowOrigins(AllowOriginsT&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins = std::forward<AllowOriginsT>(value); }
101 template<typename AllowOriginsT = Aws::Vector<Aws::String>>
102 Cors& WithAllowOrigins(AllowOriginsT&& value) { SetAllowOrigins(std::forward<AllowOriginsT>(value)); return *this;}
103 template<typename AllowOriginsT = Aws::String>
104 Cors& AddAllowOrigins(AllowOriginsT&& value) { m_allowOriginsHasBeenSet = true; m_allowOrigins.emplace_back(std::forward<AllowOriginsT>(value)); return *this; }
106
108
113 inline const Aws::Vector<Aws::String>& GetExposeHeaders() const { return m_exposeHeaders; }
114 inline bool ExposeHeadersHasBeenSet() const { return m_exposeHeadersHasBeenSet; }
115 template<typename ExposeHeadersT = Aws::Vector<Aws::String>>
116 void SetExposeHeaders(ExposeHeadersT&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders = std::forward<ExposeHeadersT>(value); }
117 template<typename ExposeHeadersT = Aws::Vector<Aws::String>>
118 Cors& WithExposeHeaders(ExposeHeadersT&& value) { SetExposeHeaders(std::forward<ExposeHeadersT>(value)); return *this;}
119 template<typename ExposeHeadersT = Aws::String>
120 Cors& AddExposeHeaders(ExposeHeadersT&& value) { m_exposeHeadersHasBeenSet = true; m_exposeHeaders.emplace_back(std::forward<ExposeHeadersT>(value)); return *this; }
122
124
129 inline int GetMaxAge() const { return m_maxAge; }
130 inline bool MaxAgeHasBeenSet() const { return m_maxAgeHasBeenSet; }
131 inline void SetMaxAge(int value) { m_maxAgeHasBeenSet = true; m_maxAge = value; }
132 inline Cors& WithMaxAge(int value) { SetMaxAge(value); return *this;}
134 private:
135
136 bool m_allowCredentials{false};
137 bool m_allowCredentialsHasBeenSet = false;
138
139 Aws::Vector<Aws::String> m_allowHeaders;
140 bool m_allowHeadersHasBeenSet = false;
141
142 Aws::Vector<Aws::String> m_allowMethods;
143 bool m_allowMethodsHasBeenSet = false;
144
145 Aws::Vector<Aws::String> m_allowOrigins;
146 bool m_allowOriginsHasBeenSet = false;
147
148 Aws::Vector<Aws::String> m_exposeHeaders;
149 bool m_exposeHeadersHasBeenSet = false;
150
151 int m_maxAge{0};
152 bool m_maxAgeHasBeenSet = false;
153 };
154
155} // namespace Model
156} // namespace Lambda
157} // namespace Aws
Cors & AddAllowMethods(AllowMethodsT &&value)
Definition Cors.h:86
const Aws::Vector< Aws::String > & GetAllowMethods() const
Definition Cors.h:79
bool ExposeHeadersHasBeenSet() const
Definition Cors.h:114
AWS_LAMBDA_API Aws::Utils::Json::JsonValue Jsonize() const
int GetMaxAge() const
Definition Cors.h:129
Cors & AddExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:120
bool AllowMethodsHasBeenSet() const
Definition Cors.h:80
const Aws::Vector< Aws::String > & GetExposeHeaders() const
Definition Cors.h:113
void SetAllowMethods(AllowMethodsT &&value)
Definition Cors.h:82
Cors & AddAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:104
bool AllowOriginsHasBeenSet() const
Definition Cors.h:98
const Aws::Vector< Aws::String > & GetAllowHeaders() const
Definition Cors.h:63
void SetAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:100
AWS_LAMBDA_API Cors & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetAllowCredentials(bool value)
Definition Cors.h:53
const Aws::Vector< Aws::String > & GetAllowOrigins() const
Definition Cors.h:97
bool GetAllowCredentials() const
Definition Cors.h:51
bool AllowHeadersHasBeenSet() const
Definition Cors.h:64
void SetMaxAge(int value)
Definition Cors.h:131
Cors & WithExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:118
void SetAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:66
bool MaxAgeHasBeenSet() const
Definition Cors.h:130
Cors & WithAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:68
Cors & WithMaxAge(int value)
Definition Cors.h:132
Cors & WithAllowOrigins(AllowOriginsT &&value)
Definition Cors.h:102
AWS_LAMBDA_API Cors()=default
Cors & WithAllowCredentials(bool value)
Definition Cors.h:54
Cors & WithAllowMethods(AllowMethodsT &&value)
Definition Cors.h:84
Cors & AddAllowHeaders(AllowHeadersT &&value)
Definition Cors.h:70
bool AllowCredentialsHasBeenSet() const
Definition Cors.h:52
void SetExposeHeaders(ExposeHeadersT &&value)
Definition Cors.h:116
AWS_LAMBDA_API Cors(Aws::Utils::Json::JsonView jsonValue)
std::vector< T, Aws::Allocator< T > > Vector
Aws::Utils::Json::JsonValue JsonValue