AWS SDK for C++

AWS SDK for C++ Version 1.11.891

Loading...
Searching...
No Matches
CreateDistributionRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSString.h>
8#include <aws/core/utils/memory/stl/AWSVector.h>
9#include <aws/lightsail/LightsailRequest.h>
10#include <aws/lightsail/Lightsail_EXPORTS.h>
11#include <aws/lightsail/model/CacheBehavior.h>
12#include <aws/lightsail/model/CacheBehaviorPerPath.h>
13#include <aws/lightsail/model/CacheSettings.h>
14#include <aws/lightsail/model/DistributionCustomErrorResponse.h>
15#include <aws/lightsail/model/InputOrigin.h>
16#include <aws/lightsail/model/IpAddressType.h>
17#include <aws/lightsail/model/Tag.h>
18#include <aws/lightsail/model/ViewerMinimumTlsProtocolVersionEnum.h>
19
20#include <utility>
21
22namespace Aws {
23namespace Lightsail {
24namespace Model {
25
29 public:
30 AWS_LIGHTSAIL_API CreateDistributionRequest() = default;
31
32 // Service request name is the Operation name which will send this request out,
33 // each operation should has unique request name, so that we can get operation's name from this request.
34 // Note: this is not true for response, multiple operations may have the same response name,
35 // so we can not get operation's name from response.
36 inline virtual const char* GetServiceRequestName() const override { return "CreateDistribution"; }
37
38 AWS_LIGHTSAIL_API Aws::String SerializePayload() const override;
39
41
43
46 inline const Aws::String& GetDistributionName() const { return m_distributionName; }
47 inline bool DistributionNameHasBeenSet() const { return m_distributionNameHasBeenSet; }
48 template <typename DistributionNameT = Aws::String>
49 void SetDistributionName(DistributionNameT&& value) {
50 m_distributionNameHasBeenSet = true;
51 m_distributionName = std::forward<DistributionNameT>(value);
52 }
53 template <typename DistributionNameT = Aws::String>
54 CreateDistributionRequest& WithDistributionName(DistributionNameT&& value) {
55 SetDistributionName(std::forward<DistributionNameT>(value));
56 return *this;
57 }
59
61
66 inline const InputOrigin& GetOrigin() const { return m_origin; }
67 inline bool OriginHasBeenSet() const { return m_originHasBeenSet; }
68 template <typename OriginT = InputOrigin>
69 void SetOrigin(OriginT&& value) {
70 m_originHasBeenSet = true;
71 m_origin = std::forward<OriginT>(value);
72 }
73 template <typename OriginT = InputOrigin>
75 SetOrigin(std::forward<OriginT>(value));
76 return *this;
77 }
79
81
84 inline const CacheBehavior& GetDefaultCacheBehavior() const { return m_defaultCacheBehavior; }
85 inline bool DefaultCacheBehaviorHasBeenSet() const { return m_defaultCacheBehaviorHasBeenSet; }
86 template <typename DefaultCacheBehaviorT = CacheBehavior>
87 void SetDefaultCacheBehavior(DefaultCacheBehaviorT&& value) {
88 m_defaultCacheBehaviorHasBeenSet = true;
89 m_defaultCacheBehavior = std::forward<DefaultCacheBehaviorT>(value);
90 }
91 template <typename DefaultCacheBehaviorT = CacheBehavior>
92 CreateDistributionRequest& WithDefaultCacheBehavior(DefaultCacheBehaviorT&& value) {
93 SetDefaultCacheBehavior(std::forward<DefaultCacheBehaviorT>(value));
94 return *this;
95 }
97
99
103 inline const CacheSettings& GetCacheBehaviorSettings() const { return m_cacheBehaviorSettings; }
104 inline bool CacheBehaviorSettingsHasBeenSet() const { return m_cacheBehaviorSettingsHasBeenSet; }
105 template <typename CacheBehaviorSettingsT = CacheSettings>
106 void SetCacheBehaviorSettings(CacheBehaviorSettingsT&& value) {
107 m_cacheBehaviorSettingsHasBeenSet = true;
108 m_cacheBehaviorSettings = std::forward<CacheBehaviorSettingsT>(value);
109 }
110 template <typename CacheBehaviorSettingsT = CacheSettings>
111 CreateDistributionRequest& WithCacheBehaviorSettings(CacheBehaviorSettingsT&& value) {
112 SetCacheBehaviorSettings(std::forward<CacheBehaviorSettingsT>(value));
113 return *this;
114 }
116
118
122 inline const Aws::Vector<CacheBehaviorPerPath>& GetCacheBehaviors() const { return m_cacheBehaviors; }
123 inline bool CacheBehaviorsHasBeenSet() const { return m_cacheBehaviorsHasBeenSet; }
124 template <typename CacheBehaviorsT = Aws::Vector<CacheBehaviorPerPath>>
125 void SetCacheBehaviors(CacheBehaviorsT&& value) {
126 m_cacheBehaviorsHasBeenSet = true;
127 m_cacheBehaviors = std::forward<CacheBehaviorsT>(value);
128 }
129 template <typename CacheBehaviorsT = Aws::Vector<CacheBehaviorPerPath>>
131 SetCacheBehaviors(std::forward<CacheBehaviorsT>(value));
132 return *this;
133 }
134 template <typename CacheBehaviorsT = CacheBehaviorPerPath>
136 m_cacheBehaviorsHasBeenSet = true;
137 m_cacheBehaviors.emplace_back(std::forward<CacheBehaviorsT>(value));
138 return *this;
139 }
141
143
150 inline const Aws::String& GetBundleId() const { return m_bundleId; }
151 inline bool BundleIdHasBeenSet() const { return m_bundleIdHasBeenSet; }
152 template <typename BundleIdT = Aws::String>
153 void SetBundleId(BundleIdT&& value) {
154 m_bundleIdHasBeenSet = true;
155 m_bundleId = std::forward<BundleIdT>(value);
156 }
157 template <typename BundleIdT = Aws::String>
159 SetBundleId(std::forward<BundleIdT>(value));
160 return *this;
161 }
163
165
170 inline IpAddressType GetIpAddressType() const { return m_ipAddressType; }
171 inline bool IpAddressTypeHasBeenSet() const { return m_ipAddressTypeHasBeenSet; }
172 inline void SetIpAddressType(IpAddressType value) {
173 m_ipAddressTypeHasBeenSet = true;
174 m_ipAddressType = value;
175 }
177 SetIpAddressType(value);
178 return *this;
179 }
181
183
188 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
189 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
190 template <typename TagsT = Aws::Vector<Tag>>
191 void SetTags(TagsT&& value) {
192 m_tagsHasBeenSet = true;
193 m_tags = std::forward<TagsT>(value);
194 }
195 template <typename TagsT = Aws::Vector<Tag>>
197 SetTags(std::forward<TagsT>(value));
198 return *this;
199 }
200 template <typename TagsT = Tag>
202 m_tagsHasBeenSet = true;
203 m_tags.emplace_back(std::forward<TagsT>(value));
204 return *this;
205 }
207
209
215 inline const Aws::String& GetCertificateName() const { return m_certificateName; }
216 inline bool CertificateNameHasBeenSet() const { return m_certificateNameHasBeenSet; }
217 template <typename CertificateNameT = Aws::String>
218 void SetCertificateName(CertificateNameT&& value) {
219 m_certificateNameHasBeenSet = true;
220 m_certificateName = std::forward<CertificateNameT>(value);
221 }
222 template <typename CertificateNameT = Aws::String>
224 SetCertificateName(std::forward<CertificateNameT>(value));
225 return *this;
226 }
228
230
233 inline ViewerMinimumTlsProtocolVersionEnum GetViewerMinimumTlsProtocolVersion() const { return m_viewerMinimumTlsProtocolVersion; }
234 inline bool ViewerMinimumTlsProtocolVersionHasBeenSet() const { return m_viewerMinimumTlsProtocolVersionHasBeenSet; }
236 m_viewerMinimumTlsProtocolVersionHasBeenSet = true;
237 m_viewerMinimumTlsProtocolVersion = value;
238 }
241 return *this;
242 }
244
246
256 inline bool GetEnablePrivateOriginAccess() const { return m_enablePrivateOriginAccess; }
257 inline bool EnablePrivateOriginAccessHasBeenSet() const { return m_enablePrivateOriginAccessHasBeenSet; }
258 inline void SetEnablePrivateOriginAccess(bool value) {
259 m_enablePrivateOriginAccessHasBeenSet = true;
260 m_enablePrivateOriginAccess = value;
261 }
264 return *this;
265 }
267
269
275 inline const Aws::String& GetDefaultRootObject() const { return m_defaultRootObject; }
276 inline bool DefaultRootObjectHasBeenSet() const { return m_defaultRootObjectHasBeenSet; }
277 template <typename DefaultRootObjectT = Aws::String>
278 void SetDefaultRootObject(DefaultRootObjectT&& value) {
279 m_defaultRootObjectHasBeenSet = true;
280 m_defaultRootObject = std::forward<DefaultRootObjectT>(value);
281 }
282 template <typename DefaultRootObjectT = Aws::String>
284 SetDefaultRootObject(std::forward<DefaultRootObjectT>(value));
285 return *this;
286 }
288
290
296 inline const Aws::Vector<DistributionCustomErrorResponse>& GetCustomErrorResponses() const { return m_customErrorResponses; }
297 inline bool CustomErrorResponsesHasBeenSet() const { return m_customErrorResponsesHasBeenSet; }
298 template <typename CustomErrorResponsesT = Aws::Vector<DistributionCustomErrorResponse>>
299 void SetCustomErrorResponses(CustomErrorResponsesT&& value) {
300 m_customErrorResponsesHasBeenSet = true;
301 m_customErrorResponses = std::forward<CustomErrorResponsesT>(value);
302 }
303 template <typename CustomErrorResponsesT = Aws::Vector<DistributionCustomErrorResponse>>
304 CreateDistributionRequest& WithCustomErrorResponses(CustomErrorResponsesT&& value) {
305 SetCustomErrorResponses(std::forward<CustomErrorResponsesT>(value));
306 return *this;
307 }
308 template <typename CustomErrorResponsesT = DistributionCustomErrorResponse>
309 CreateDistributionRequest& AddCustomErrorResponses(CustomErrorResponsesT&& value) {
310 m_customErrorResponsesHasBeenSet = true;
311 m_customErrorResponses.emplace_back(std::forward<CustomErrorResponsesT>(value));
312 return *this;
313 }
315 private:
316 Aws::String m_distributionName;
317
318 InputOrigin m_origin;
319
320 CacheBehavior m_defaultCacheBehavior;
321
322 CacheSettings m_cacheBehaviorSettings;
323
324 Aws::Vector<CacheBehaviorPerPath> m_cacheBehaviors;
325
326 Aws::String m_bundleId;
327
328 IpAddressType m_ipAddressType{IpAddressType::NOT_SET};
329
330 Aws::Vector<Tag> m_tags;
331
332 Aws::String m_certificateName;
333
335
336 bool m_enablePrivateOriginAccess{false};
337
338 Aws::String m_defaultRootObject;
339
341 bool m_distributionNameHasBeenSet = false;
342 bool m_originHasBeenSet = false;
343 bool m_defaultCacheBehaviorHasBeenSet = false;
344 bool m_cacheBehaviorSettingsHasBeenSet = false;
345 bool m_cacheBehaviorsHasBeenSet = false;
346 bool m_bundleIdHasBeenSet = false;
347 bool m_ipAddressTypeHasBeenSet = false;
348 bool m_tagsHasBeenSet = false;
349 bool m_certificateNameHasBeenSet = false;
350 bool m_viewerMinimumTlsProtocolVersionHasBeenSet = false;
351 bool m_enablePrivateOriginAccessHasBeenSet = false;
352 bool m_defaultRootObjectHasBeenSet = false;
353 bool m_customErrorResponsesHasBeenSet = false;
354};
355
356} // namespace Model
357} // namespace Lightsail
358} // namespace Aws
CreateDistributionRequest & WithViewerMinimumTlsProtocolVersion(ViewerMinimumTlsProtocolVersionEnum value)
CreateDistributionRequest & WithDistributionName(DistributionNameT &&value)
void SetCacheBehaviorSettings(CacheBehaviorSettingsT &&value)
void SetViewerMinimumTlsProtocolVersion(ViewerMinimumTlsProtocolVersionEnum value)
CreateDistributionRequest & AddTags(TagsT &&value)
AWS_LIGHTSAIL_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
CreateDistributionRequest & WithDefaultCacheBehavior(DefaultCacheBehaviorT &&value)
void SetCustomErrorResponses(CustomErrorResponsesT &&value)
CreateDistributionRequest & WithCacheBehaviorSettings(CacheBehaviorSettingsT &&value)
const Aws::Vector< CacheBehaviorPerPath > & GetCacheBehaviors() const
AWS_LIGHTSAIL_API Aws::String SerializePayload() const override
void SetDefaultCacheBehavior(DefaultCacheBehaviorT &&value)
virtual const char * GetServiceRequestName() const override
CreateDistributionRequest & WithDefaultRootObject(DefaultRootObjectT &&value)
CreateDistributionRequest & WithEnablePrivateOriginAccess(bool value)
CreateDistributionRequest & AddCacheBehaviors(CacheBehaviorsT &&value)
CreateDistributionRequest & WithIpAddressType(IpAddressType value)
const Aws::Vector< DistributionCustomErrorResponse > & GetCustomErrorResponses() const
CreateDistributionRequest & AddCustomErrorResponses(CustomErrorResponsesT &&value)
ViewerMinimumTlsProtocolVersionEnum GetViewerMinimumTlsProtocolVersion() const
CreateDistributionRequest & WithCacheBehaviors(CacheBehaviorsT &&value)
CreateDistributionRequest & WithCertificateName(CertificateNameT &&value)
AWS_LIGHTSAIL_API CreateDistributionRequest()=default
CreateDistributionRequest & WithOrigin(OriginT &&value)
CreateDistributionRequest & WithCustomErrorResponses(CustomErrorResponsesT &&value)
CreateDistributionRequest & WithBundleId(BundleIdT &&value)
CreateDistributionRequest & WithTags(TagsT &&value)
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector