AWS SDK for C++

AWS SDK for C++ Version 1.11.695

Loading...
Searching...
No Matches
CreateBucketRequest.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSMap.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/s3/S3Request.h>
10#include <aws/s3/S3_EXPORTS.h>
11#include <aws/s3/model/BucketCannedACL.h>
12#include <aws/s3/model/CreateBucketConfiguration.h>
13#include <aws/s3/model/ObjectOwnership.h>
14
15#include <utility>
16
17namespace Aws {
18namespace Http {
19class URI;
20} // namespace Http
21namespace S3 {
22namespace Model {
23
27 public:
28 AWS_S3_API CreateBucketRequest() = default;
29
30 // Service request name is the Operation name which will send this request out,
31 // each operation should has unique request name, so that we can get operation's name from this request.
32 // Note: this is not true for response, multiple operations may have the same response name,
33 // so we can not get operation's name from response.
34 inline virtual const char* GetServiceRequestName() const override { return "CreateBucket"; }
35
36 AWS_S3_API Aws::String SerializePayload() const override;
37
38 AWS_S3_API void AddQueryStringParameters(Aws::Http::URI& uri) const override;
39
41
42 AWS_S3_API bool HasEmbeddedError(IOStream& body, const Http::HeaderValueCollection& header) const override;
46 AWS_S3_API EndpointParameters GetEndpointContextParams() const override;
47
49
53 inline BucketCannedACL GetACL() const { return m_aCL; }
54 inline bool ACLHasBeenSet() const { return m_aCLHasBeenSet; }
55 inline void SetACL(BucketCannedACL value) {
56 m_aCLHasBeenSet = true;
57 m_aCL = value;
58 }
60 SetACL(value);
61 return *this;
62 }
64
66
83 inline const Aws::String& GetBucket() const { return m_bucket; }
84 inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
85 template <typename BucketT = Aws::String>
86 void SetBucket(BucketT&& value) {
87 m_bucketHasBeenSet = true;
88 m_bucket = std::forward<BucketT>(value);
89 }
90 template <typename BucketT = Aws::String>
91 CreateBucketRequest& WithBucket(BucketT&& value) {
92 SetBucket(std::forward<BucketT>(value));
93 return *this;
94 }
96
98
101 inline const CreateBucketConfiguration& GetCreateBucketConfiguration() const { return m_createBucketConfiguration; }
102 inline bool CreateBucketConfigurationHasBeenSet() const { return m_createBucketConfigurationHasBeenSet; }
103 template <typename CreateBucketConfigurationT = CreateBucketConfiguration>
104 void SetCreateBucketConfiguration(CreateBucketConfigurationT&& value) {
105 m_createBucketConfigurationHasBeenSet = true;
106 m_createBucketConfiguration = std::forward<CreateBucketConfigurationT>(value);
107 }
108 template <typename CreateBucketConfigurationT = CreateBucketConfiguration>
109 CreateBucketRequest& WithCreateBucketConfiguration(CreateBucketConfigurationT&& value) {
110 SetCreateBucketConfiguration(std::forward<CreateBucketConfigurationT>(value));
111 return *this;
112 }
114
116
121 inline const Aws::String& GetGrantFullControl() const { return m_grantFullControl; }
122 inline bool GrantFullControlHasBeenSet() const { return m_grantFullControlHasBeenSet; }
123 template <typename GrantFullControlT = Aws::String>
124 void SetGrantFullControl(GrantFullControlT&& value) {
125 m_grantFullControlHasBeenSet = true;
126 m_grantFullControl = std::forward<GrantFullControlT>(value);
127 }
128 template <typename GrantFullControlT = Aws::String>
129 CreateBucketRequest& WithGrantFullControl(GrantFullControlT&& value) {
130 SetGrantFullControl(std::forward<GrantFullControlT>(value));
131 return *this;
132 }
134
136
140 inline const Aws::String& GetGrantRead() const { return m_grantRead; }
141 inline bool GrantReadHasBeenSet() const { return m_grantReadHasBeenSet; }
142 template <typename GrantReadT = Aws::String>
143 void SetGrantRead(GrantReadT&& value) {
144 m_grantReadHasBeenSet = true;
145 m_grantRead = std::forward<GrantReadT>(value);
146 }
147 template <typename GrantReadT = Aws::String>
148 CreateBucketRequest& WithGrantRead(GrantReadT&& value) {
149 SetGrantRead(std::forward<GrantReadT>(value));
150 return *this;
151 }
153
155
159 inline const Aws::String& GetGrantReadACP() const { return m_grantReadACP; }
160 inline bool GrantReadACPHasBeenSet() const { return m_grantReadACPHasBeenSet; }
161 template <typename GrantReadACPT = Aws::String>
162 void SetGrantReadACP(GrantReadACPT&& value) {
163 m_grantReadACPHasBeenSet = true;
164 m_grantReadACP = std::forward<GrantReadACPT>(value);
165 }
166 template <typename GrantReadACPT = Aws::String>
167 CreateBucketRequest& WithGrantReadACP(GrantReadACPT&& value) {
168 SetGrantReadACP(std::forward<GrantReadACPT>(value));
169 return *this;
170 }
172
174
180 inline const Aws::String& GetGrantWrite() const { return m_grantWrite; }
181 inline bool GrantWriteHasBeenSet() const { return m_grantWriteHasBeenSet; }
182 template <typename GrantWriteT = Aws::String>
183 void SetGrantWrite(GrantWriteT&& value) {
184 m_grantWriteHasBeenSet = true;
185 m_grantWrite = std::forward<GrantWriteT>(value);
186 }
187 template <typename GrantWriteT = Aws::String>
188 CreateBucketRequest& WithGrantWrite(GrantWriteT&& value) {
189 SetGrantWrite(std::forward<GrantWriteT>(value));
190 return *this;
191 }
193
195
199 inline const Aws::String& GetGrantWriteACP() const { return m_grantWriteACP; }
200 inline bool GrantWriteACPHasBeenSet() const { return m_grantWriteACPHasBeenSet; }
201 template <typename GrantWriteACPT = Aws::String>
202 void SetGrantWriteACP(GrantWriteACPT&& value) {
203 m_grantWriteACPHasBeenSet = true;
204 m_grantWriteACP = std::forward<GrantWriteACPT>(value);
205 }
206 template <typename GrantWriteACPT = Aws::String>
207 CreateBucketRequest& WithGrantWriteACP(GrantWriteACPT&& value) {
208 SetGrantWriteACP(std::forward<GrantWriteACPT>(value));
209 return *this;
210 }
212
214
219 inline bool GetObjectLockEnabledForBucket() const { return m_objectLockEnabledForBucket; }
220 inline bool ObjectLockEnabledForBucketHasBeenSet() const { return m_objectLockEnabledForBucketHasBeenSet; }
221 inline void SetObjectLockEnabledForBucket(bool value) {
222 m_objectLockEnabledForBucketHasBeenSet = true;
223 m_objectLockEnabledForBucket = value;
224 }
227 return *this;
228 }
230
232
233 inline ObjectOwnership GetObjectOwnership() const { return m_objectOwnership; }
234 inline bool ObjectOwnershipHasBeenSet() const { return m_objectOwnershipHasBeenSet; }
236 m_objectOwnershipHasBeenSet = true;
237 m_objectOwnership = value;
238 }
240 SetObjectOwnership(value);
241 return *this;
242 }
244
246
247 inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const { return m_customizedAccessLogTag; }
248 inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }
249 template <typename CustomizedAccessLogTagT = Aws::Map<Aws::String, Aws::String>>
250 void SetCustomizedAccessLogTag(CustomizedAccessLogTagT&& value) {
251 m_customizedAccessLogTagHasBeenSet = true;
252 m_customizedAccessLogTag = std::forward<CustomizedAccessLogTagT>(value);
253 }
254 template <typename CustomizedAccessLogTagT = Aws::Map<Aws::String, Aws::String>>
255 CreateBucketRequest& WithCustomizedAccessLogTag(CustomizedAccessLogTagT&& value) {
256 SetCustomizedAccessLogTag(std::forward<CustomizedAccessLogTagT>(value));
257 return *this;
258 }
259 template <typename CustomizedAccessLogTagKeyT = Aws::String, typename CustomizedAccessLogTagValueT = Aws::String>
260 CreateBucketRequest& AddCustomizedAccessLogTag(CustomizedAccessLogTagKeyT&& key, CustomizedAccessLogTagValueT&& value) {
261 m_customizedAccessLogTagHasBeenSet = true;
262 m_customizedAccessLogTag.emplace(std::forward<CustomizedAccessLogTagKeyT>(key), std::forward<CustomizedAccessLogTagValueT>(value));
263 return *this;
264 }
266 private:
268 bool m_aCLHasBeenSet = false;
269
270 Aws::String m_bucket;
271 bool m_bucketHasBeenSet = false;
272
273 CreateBucketConfiguration m_createBucketConfiguration;
274 bool m_createBucketConfigurationHasBeenSet = false;
275
276 Aws::String m_grantFullControl;
277 bool m_grantFullControlHasBeenSet = false;
278
279 Aws::String m_grantRead;
280 bool m_grantReadHasBeenSet = false;
281
282 Aws::String m_grantReadACP;
283 bool m_grantReadACPHasBeenSet = false;
284
285 Aws::String m_grantWrite;
286 bool m_grantWriteHasBeenSet = false;
287
288 Aws::String m_grantWriteACP;
289 bool m_grantWriteACPHasBeenSet = false;
290
291 bool m_objectLockEnabledForBucket{false};
292 bool m_objectLockEnabledForBucketHasBeenSet = false;
293
294 ObjectOwnership m_objectOwnership{ObjectOwnership::NOT_SET};
295 bool m_objectOwnershipHasBeenSet = false;
296
297 Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
298 bool m_customizedAccessLogTagHasBeenSet = false;
299};
300
301} // namespace Model
302} // namespace S3
303} // namespace Aws
CreateBucketRequest & WithCustomizedAccessLogTag(CustomizedAccessLogTagT &&value)
AWS_S3_API void AddQueryStringParameters(Aws::Http::URI &uri) const override
void SetCustomizedAccessLogTag(CustomizedAccessLogTagT &&value)
AWS_S3_API CreateBucketRequest()=default
const Aws::String & GetBucket() const
const Aws::Map< Aws::String, Aws::String > & GetCustomizedAccessLogTag() const
CreateBucketRequest & WithBucket(BucketT &&value)
CreateBucketRequest & WithGrantWrite(GrantWriteT &&value)
const Aws::String & GetGrantFullControl() const
AWS_S3_API Aws::String SerializePayload() const override
const Aws::String & GetGrantReadACP() const
void SetGrantReadACP(GrantReadACPT &&value)
CreateBucketRequest & WithCreateBucketConfiguration(CreateBucketConfigurationT &&value)
const Aws::String & GetGrantRead() const
virtual const char * GetServiceRequestName() const override
void SetGrantWriteACP(GrantWriteACPT &&value)
void SetCreateBucketConfiguration(CreateBucketConfigurationT &&value)
CreateBucketRequest & WithObjectLockEnabledForBucket(bool value)
AWS_S3_API bool HasEmbeddedError(IOStream &body, const Http::HeaderValueCollection &header) const override
AWS_S3_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override
CreateBucketRequest & WithGrantReadACP(GrantReadACPT &&value)
void SetACL(BucketCannedACL value)
CreateBucketRequest & WithACL(BucketCannedACL value)
const Aws::String & GetGrantWrite() const
CreateBucketRequest & WithGrantRead(GrantReadT &&value)
const CreateBucketConfiguration & GetCreateBucketConfiguration() const
void SetGrantFullControl(GrantFullControlT &&value)
void SetGrantWrite(GrantWriteT &&value)
const Aws::String & GetGrantWriteACP() const
void SetObjectOwnership(ObjectOwnership value)
CreateBucketRequest & AddCustomizedAccessLogTag(CustomizedAccessLogTagKeyT &&key, CustomizedAccessLogTagValueT &&value)
CreateBucketRequest & WithObjectOwnership(ObjectOwnership value)
CreateBucketRequest & WithGrantFullControl(GrantFullControlT &&value)
CreateBucketRequest & WithGrantWriteACP(GrantWriteACPT &&value)
AWS_S3_API EndpointParameters GetEndpointContextParams() const override
Aws::Endpoint::EndpointParameters EndpointParameters
Definition S3Request.h:19
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_iostream< char, std::char_traits< char > > IOStream
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String