AWS SDK for C++

AWS SDK for C++ Version 1.11.929

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#include <aws/lightsail/model/WafRule.h>
20
21#include <utility>
22
23namespace Aws {
24namespace Lightsail {
25namespace Model {
26
30 public:
31 AWS_LIGHTSAIL_API CreateDistributionRequest() = default;
32
33 // Service request name is the Operation name which will send this request out,
34 // each operation should has unique request name, so that we can get operation's name from this request.
35 // Note: this is not true for response, multiple operations may have the same response name,
36 // so we can not get operation's name from response.
37 inline virtual const char* GetServiceRequestName() const override { return "CreateDistribution"; }
38
39 AWS_LIGHTSAIL_API Aws::String SerializePayload() const override;
40
42
44
47 inline const Aws::String& GetDistributionName() const { return m_distributionName; }
48 inline bool DistributionNameHasBeenSet() const { return m_distributionNameHasBeenSet; }
49 template <typename DistributionNameT = Aws::String>
50 void SetDistributionName(DistributionNameT&& value) {
51 m_distributionNameHasBeenSet = true;
52 m_distributionName = std::forward<DistributionNameT>(value);
53 }
54 template <typename DistributionNameT = Aws::String>
55 CreateDistributionRequest& WithDistributionName(DistributionNameT&& value) {
56 SetDistributionName(std::forward<DistributionNameT>(value));
57 return *this;
58 }
60
62
67 inline const InputOrigin& GetOrigin() const { return m_origin; }
68 inline bool OriginHasBeenSet() const { return m_originHasBeenSet; }
69 template <typename OriginT = InputOrigin>
70 void SetOrigin(OriginT&& value) {
71 m_originHasBeenSet = true;
72 m_origin = std::forward<OriginT>(value);
73 }
74 template <typename OriginT = InputOrigin>
76 SetOrigin(std::forward<OriginT>(value));
77 return *this;
78 }
80
82
85 inline const CacheBehavior& GetDefaultCacheBehavior() const { return m_defaultCacheBehavior; }
86 inline bool DefaultCacheBehaviorHasBeenSet() const { return m_defaultCacheBehaviorHasBeenSet; }
87 template <typename DefaultCacheBehaviorT = CacheBehavior>
88 void SetDefaultCacheBehavior(DefaultCacheBehaviorT&& value) {
89 m_defaultCacheBehaviorHasBeenSet = true;
90 m_defaultCacheBehavior = std::forward<DefaultCacheBehaviorT>(value);
91 }
92 template <typename DefaultCacheBehaviorT = CacheBehavior>
93 CreateDistributionRequest& WithDefaultCacheBehavior(DefaultCacheBehaviorT&& value) {
94 SetDefaultCacheBehavior(std::forward<DefaultCacheBehaviorT>(value));
95 return *this;
96 }
98
100
104 inline const CacheSettings& GetCacheBehaviorSettings() const { return m_cacheBehaviorSettings; }
105 inline bool CacheBehaviorSettingsHasBeenSet() const { return m_cacheBehaviorSettingsHasBeenSet; }
106 template <typename CacheBehaviorSettingsT = CacheSettings>
107 void SetCacheBehaviorSettings(CacheBehaviorSettingsT&& value) {
108 m_cacheBehaviorSettingsHasBeenSet = true;
109 m_cacheBehaviorSettings = std::forward<CacheBehaviorSettingsT>(value);
110 }
111 template <typename CacheBehaviorSettingsT = CacheSettings>
112 CreateDistributionRequest& WithCacheBehaviorSettings(CacheBehaviorSettingsT&& value) {
113 SetCacheBehaviorSettings(std::forward<CacheBehaviorSettingsT>(value));
114 return *this;
115 }
117
119
123 inline const Aws::Vector<CacheBehaviorPerPath>& GetCacheBehaviors() const { return m_cacheBehaviors; }
124 inline bool CacheBehaviorsHasBeenSet() const { return m_cacheBehaviorsHasBeenSet; }
125 template <typename CacheBehaviorsT = Aws::Vector<CacheBehaviorPerPath>>
126 void SetCacheBehaviors(CacheBehaviorsT&& value) {
127 m_cacheBehaviorsHasBeenSet = true;
128 m_cacheBehaviors = std::forward<CacheBehaviorsT>(value);
129 }
130 template <typename CacheBehaviorsT = Aws::Vector<CacheBehaviorPerPath>>
132 SetCacheBehaviors(std::forward<CacheBehaviorsT>(value));
133 return *this;
134 }
135 template <typename CacheBehaviorsT = CacheBehaviorPerPath>
137 m_cacheBehaviorsHasBeenSet = true;
138 m_cacheBehaviors.emplace_back(std::forward<CacheBehaviorsT>(value));
139 return *this;
140 }
142
144
151 inline const Aws::String& GetBundleId() const { return m_bundleId; }
152 inline bool BundleIdHasBeenSet() const { return m_bundleIdHasBeenSet; }
153 template <typename BundleIdT = Aws::String>
154 void SetBundleId(BundleIdT&& value) {
155 m_bundleIdHasBeenSet = true;
156 m_bundleId = std::forward<BundleIdT>(value);
157 }
158 template <typename BundleIdT = Aws::String>
160 SetBundleId(std::forward<BundleIdT>(value));
161 return *this;
162 }
164
166
171 inline IpAddressType GetIpAddressType() const { return m_ipAddressType; }
172 inline bool IpAddressTypeHasBeenSet() const { return m_ipAddressTypeHasBeenSet; }
173 inline void SetIpAddressType(IpAddressType value) {
174 m_ipAddressTypeHasBeenSet = true;
175 m_ipAddressType = value;
176 }
178 SetIpAddressType(value);
179 return *this;
180 }
182
184
189 inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
190 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
191 template <typename TagsT = Aws::Vector<Tag>>
192 void SetTags(TagsT&& value) {
193 m_tagsHasBeenSet = true;
194 m_tags = std::forward<TagsT>(value);
195 }
196 template <typename TagsT = Aws::Vector<Tag>>
198 SetTags(std::forward<TagsT>(value));
199 return *this;
200 }
201 template <typename TagsT = Tag>
203 m_tagsHasBeenSet = true;
204 m_tags.emplace_back(std::forward<TagsT>(value));
205 return *this;
206 }
208
210
216 inline const Aws::String& GetCertificateName() const { return m_certificateName; }
217 inline bool CertificateNameHasBeenSet() const { return m_certificateNameHasBeenSet; }
218 template <typename CertificateNameT = Aws::String>
219 void SetCertificateName(CertificateNameT&& value) {
220 m_certificateNameHasBeenSet = true;
221 m_certificateName = std::forward<CertificateNameT>(value);
222 }
223 template <typename CertificateNameT = Aws::String>
225 SetCertificateName(std::forward<CertificateNameT>(value));
226 return *this;
227 }
229
231
234 inline ViewerMinimumTlsProtocolVersionEnum GetViewerMinimumTlsProtocolVersion() const { return m_viewerMinimumTlsProtocolVersion; }
235 inline bool ViewerMinimumTlsProtocolVersionHasBeenSet() const { return m_viewerMinimumTlsProtocolVersionHasBeenSet; }
237 m_viewerMinimumTlsProtocolVersionHasBeenSet = true;
238 m_viewerMinimumTlsProtocolVersion = value;
239 }
245
247
257 inline bool GetEnablePrivateOriginAccess() const { return m_enablePrivateOriginAccess; }
258 inline bool EnablePrivateOriginAccessHasBeenSet() const { return m_enablePrivateOriginAccessHasBeenSet; }
259 inline void SetEnablePrivateOriginAccess(bool value) {
260 m_enablePrivateOriginAccessHasBeenSet = true;
261 m_enablePrivateOriginAccess = value;
262 }
265 return *this;
266 }
268
270
276 inline const Aws::String& GetDefaultRootObject() const { return m_defaultRootObject; }
277 inline bool DefaultRootObjectHasBeenSet() const { return m_defaultRootObjectHasBeenSet; }
278 template <typename DefaultRootObjectT = Aws::String>
279 void SetDefaultRootObject(DefaultRootObjectT&& value) {
280 m_defaultRootObjectHasBeenSet = true;
281 m_defaultRootObject = std::forward<DefaultRootObjectT>(value);
282 }
283 template <typename DefaultRootObjectT = Aws::String>
285 SetDefaultRootObject(std::forward<DefaultRootObjectT>(value));
286 return *this;
287 }
289
291
297 inline const Aws::Vector<DistributionCustomErrorResponse>& GetCustomErrorResponses() const { return m_customErrorResponses; }
298 inline bool CustomErrorResponsesHasBeenSet() const { return m_customErrorResponsesHasBeenSet; }
299 template <typename CustomErrorResponsesT = Aws::Vector<DistributionCustomErrorResponse>>
300 void SetCustomErrorResponses(CustomErrorResponsesT&& value) {
301 m_customErrorResponsesHasBeenSet = true;
302 m_customErrorResponses = std::forward<CustomErrorResponsesT>(value);
303 }
304 template <typename CustomErrorResponsesT = Aws::Vector<DistributionCustomErrorResponse>>
305 CreateDistributionRequest& WithCustomErrorResponses(CustomErrorResponsesT&& value) {
306 SetCustomErrorResponses(std::forward<CustomErrorResponsesT>(value));
307 return *this;
308 }
309 template <typename CustomErrorResponsesT = DistributionCustomErrorResponse>
310 CreateDistributionRequest& AddCustomErrorResponses(CustomErrorResponsesT&& value) {
311 m_customErrorResponsesHasBeenSet = true;
312 m_customErrorResponses.emplace_back(std::forward<CustomErrorResponsesT>(value));
313 return *this;
314 }
316
318
327 inline bool GetEnableWaf() const { return m_enableWaf; }
328 inline bool EnableWafHasBeenSet() const { return m_enableWafHasBeenSet; }
329 inline void SetEnableWaf(bool value) {
330 m_enableWafHasBeenSet = true;
331 m_enableWaf = value;
332 }
334 SetEnableWaf(value);
335 return *this;
336 }
338
340
359 inline const Aws::Vector<WafRule>& GetWafRules() const { return m_wafRules; }
360 inline bool WafRulesHasBeenSet() const { return m_wafRulesHasBeenSet; }
361 template <typename WafRulesT = Aws::Vector<WafRule>>
362 void SetWafRules(WafRulesT&& value) {
363 m_wafRulesHasBeenSet = true;
364 m_wafRules = std::forward<WafRulesT>(value);
365 }
366 template <typename WafRulesT = Aws::Vector<WafRule>>
368 SetWafRules(std::forward<WafRulesT>(value));
369 return *this;
370 }
371 template <typename WafRulesT = WafRule>
373 m_wafRulesHasBeenSet = true;
374 m_wafRules.emplace_back(std::forward<WafRulesT>(value));
375 return *this;
376 }
378
380
391 inline const Aws::String& GetSubdomainName() const { return m_subdomainName; }
392 inline bool SubdomainNameHasBeenSet() const { return m_subdomainNameHasBeenSet; }
393 template <typename SubdomainNameT = Aws::String>
394 void SetSubdomainName(SubdomainNameT&& value) {
395 m_subdomainNameHasBeenSet = true;
396 m_subdomainName = std::forward<SubdomainNameT>(value);
397 }
398 template <typename SubdomainNameT = Aws::String>
400 SetSubdomainName(std::forward<SubdomainNameT>(value));
401 return *this;
402 }
404 private:
405 Aws::String m_distributionName;
406
407 InputOrigin m_origin;
408
409 CacheBehavior m_defaultCacheBehavior;
410
411 CacheSettings m_cacheBehaviorSettings;
412
413 Aws::Vector<CacheBehaviorPerPath> m_cacheBehaviors;
414
415 Aws::String m_bundleId;
416
417 IpAddressType m_ipAddressType{IpAddressType::NOT_SET};
418
419 Aws::Vector<Tag> m_tags;
420
421 Aws::String m_certificateName;
422
424
425 bool m_enablePrivateOriginAccess{false};
426
427 Aws::String m_defaultRootObject;
428
430
431 bool m_enableWaf{false};
432
433 Aws::Vector<WafRule> m_wafRules;
434
435 Aws::String m_subdomainName;
436 bool m_distributionNameHasBeenSet = false;
437 bool m_originHasBeenSet = false;
438 bool m_defaultCacheBehaviorHasBeenSet = false;
439 bool m_cacheBehaviorSettingsHasBeenSet = false;
440 bool m_cacheBehaviorsHasBeenSet = false;
441 bool m_bundleIdHasBeenSet = false;
442 bool m_ipAddressTypeHasBeenSet = false;
443 bool m_tagsHasBeenSet = false;
444 bool m_certificateNameHasBeenSet = false;
445 bool m_viewerMinimumTlsProtocolVersionHasBeenSet = false;
446 bool m_enablePrivateOriginAccessHasBeenSet = false;
447 bool m_defaultRootObjectHasBeenSet = false;
448 bool m_customErrorResponsesHasBeenSet = false;
449 bool m_enableWafHasBeenSet = false;
450 bool m_wafRulesHasBeenSet = false;
451 bool m_subdomainNameHasBeenSet = false;
452};
453
454} // namespace Model
455} // namespace Lightsail
456} // namespace Aws
CreateDistributionRequest & WithViewerMinimumTlsProtocolVersion(ViewerMinimumTlsProtocolVersionEnum value)
CreateDistributionRequest & WithDistributionName(DistributionNameT &&value)
void SetCacheBehaviorSettings(CacheBehaviorSettingsT &&value)
CreateDistributionRequest & WithWafRules(WafRulesT &&value)
CreateDistributionRequest & WithEnableWaf(bool value)
void SetViewerMinimumTlsProtocolVersion(ViewerMinimumTlsProtocolVersionEnum value)
CreateDistributionRequest & WithSubdomainName(SubdomainNameT &&value)
CreateDistributionRequest & AddTags(TagsT &&value)
AWS_LIGHTSAIL_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
CreateDistributionRequest & AddWafRules(WafRulesT &&value)
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