1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/s3/S3_EXPORTS.h>
8 #include <aws/s3/S3Request.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/s3/model/ReplicationConfiguration.h>
11 #include <aws/core/utils/memory/stl/AWSMap.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Http
17 {
18     class URI;
19 } //namespace Http
20 namespace S3
21 {
22 namespace Model
23 {
24 
25   /**
26    */
27   class AWS_S3_API PutBucketReplicationRequest : public S3Request
28   {
29   public:
30     PutBucketReplicationRequest();
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.
GetServiceRequestName()36     inline virtual const char* GetServiceRequestName() const override { return "PutBucketReplication"; }
37 
38     Aws::String SerializePayload() const override;
39 
40     void AddQueryStringParameters(Aws::Http::URI& uri) const override;
41 
42     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
43 
ShouldComputeContentMd5()44     inline bool ShouldComputeContentMd5() const override { return true; }
45 
46 
47     /**
48      * <p>The name of the bucket</p>
49      */
GetBucket()50     inline const Aws::String& GetBucket() const{ return m_bucket; }
51 
52     /**
53      * <p>The name of the bucket</p>
54      */
BucketHasBeenSet()55     inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
56 
57     /**
58      * <p>The name of the bucket</p>
59      */
SetBucket(const Aws::String & value)60     inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }
61 
62     /**
63      * <p>The name of the bucket</p>
64      */
SetBucket(Aws::String && value)65     inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }
66 
67     /**
68      * <p>The name of the bucket</p>
69      */
SetBucket(const char * value)70     inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }
71 
72     /**
73      * <p>The name of the bucket</p>
74      */
WithBucket(const Aws::String & value)75     inline PutBucketReplicationRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}
76 
77     /**
78      * <p>The name of the bucket</p>
79      */
WithBucket(Aws::String && value)80     inline PutBucketReplicationRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}
81 
82     /**
83      * <p>The name of the bucket</p>
84      */
WithBucket(const char * value)85     inline PutBucketReplicationRequest& WithBucket(const char* value) { SetBucket(value); return *this;}
86 
87 
88     /**
89      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
90      * as a message integrity check to verify that the request body was not corrupted
91      * in transit. For more information, see <a
92      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
93      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
94      * Services SDKs, this field is calculated automatically.</p>
95      */
GetContentMD5()96     inline const Aws::String& GetContentMD5() const{ return m_contentMD5; }
97 
98     /**
99      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
100      * as a message integrity check to verify that the request body was not corrupted
101      * in transit. For more information, see <a
102      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
103      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
104      * Services SDKs, this field is calculated automatically.</p>
105      */
ContentMD5HasBeenSet()106     inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; }
107 
108     /**
109      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
110      * as a message integrity check to verify that the request body was not corrupted
111      * in transit. For more information, see <a
112      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
113      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
114      * Services SDKs, this field is calculated automatically.</p>
115      */
SetContentMD5(const Aws::String & value)116     inline void SetContentMD5(const Aws::String& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = value; }
117 
118     /**
119      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
120      * as a message integrity check to verify that the request body was not corrupted
121      * in transit. For more information, see <a
122      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
123      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
124      * Services SDKs, this field is calculated automatically.</p>
125      */
SetContentMD5(Aws::String && value)126     inline void SetContentMD5(Aws::String&& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = std::move(value); }
127 
128     /**
129      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
130      * as a message integrity check to verify that the request body was not corrupted
131      * in transit. For more information, see <a
132      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
133      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
134      * Services SDKs, this field is calculated automatically.</p>
135      */
SetContentMD5(const char * value)136     inline void SetContentMD5(const char* value) { m_contentMD5HasBeenSet = true; m_contentMD5.assign(value); }
137 
138     /**
139      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
140      * as a message integrity check to verify that the request body was not corrupted
141      * in transit. For more information, see <a
142      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
143      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
144      * Services SDKs, this field is calculated automatically.</p>
145      */
WithContentMD5(const Aws::String & value)146     inline PutBucketReplicationRequest& WithContentMD5(const Aws::String& value) { SetContentMD5(value); return *this;}
147 
148     /**
149      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
150      * as a message integrity check to verify that the request body was not corrupted
151      * in transit. For more information, see <a
152      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
153      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
154      * Services SDKs, this field is calculated automatically.</p>
155      */
WithContentMD5(Aws::String && value)156     inline PutBucketReplicationRequest& WithContentMD5(Aws::String&& value) { SetContentMD5(std::move(value)); return *this;}
157 
158     /**
159      * <p>The base64-encoded 128-bit MD5 digest of the data. You must use this header
160      * as a message integrity check to verify that the request body was not corrupted
161      * in transit. For more information, see <a
162      * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864</a>.</p> <p>For requests
163      * made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web
164      * Services SDKs, this field is calculated automatically.</p>
165      */
WithContentMD5(const char * value)166     inline PutBucketReplicationRequest& WithContentMD5(const char* value) { SetContentMD5(value); return *this;}
167 
168 
169 
GetReplicationConfiguration()170     inline const ReplicationConfiguration& GetReplicationConfiguration() const{ return m_replicationConfiguration; }
171 
172 
ReplicationConfigurationHasBeenSet()173     inline bool ReplicationConfigurationHasBeenSet() const { return m_replicationConfigurationHasBeenSet; }
174 
175 
SetReplicationConfiguration(const ReplicationConfiguration & value)176     inline void SetReplicationConfiguration(const ReplicationConfiguration& value) { m_replicationConfigurationHasBeenSet = true; m_replicationConfiguration = value; }
177 
178 
SetReplicationConfiguration(ReplicationConfiguration && value)179     inline void SetReplicationConfiguration(ReplicationConfiguration&& value) { m_replicationConfigurationHasBeenSet = true; m_replicationConfiguration = std::move(value); }
180 
181 
WithReplicationConfiguration(const ReplicationConfiguration & value)182     inline PutBucketReplicationRequest& WithReplicationConfiguration(const ReplicationConfiguration& value) { SetReplicationConfiguration(value); return *this;}
183 
184 
WithReplicationConfiguration(ReplicationConfiguration && value)185     inline PutBucketReplicationRequest& WithReplicationConfiguration(ReplicationConfiguration&& value) { SetReplicationConfiguration(std::move(value)); return *this;}
186 
187 
188     /**
189      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
190      */
GetToken()191     inline const Aws::String& GetToken() const{ return m_token; }
192 
193     /**
194      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
195      */
TokenHasBeenSet()196     inline bool TokenHasBeenSet() const { return m_tokenHasBeenSet; }
197 
198     /**
199      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
200      */
SetToken(const Aws::String & value)201     inline void SetToken(const Aws::String& value) { m_tokenHasBeenSet = true; m_token = value; }
202 
203     /**
204      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
205      */
SetToken(Aws::String && value)206     inline void SetToken(Aws::String&& value) { m_tokenHasBeenSet = true; m_token = std::move(value); }
207 
208     /**
209      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
210      */
SetToken(const char * value)211     inline void SetToken(const char* value) { m_tokenHasBeenSet = true; m_token.assign(value); }
212 
213     /**
214      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
215      */
WithToken(const Aws::String & value)216     inline PutBucketReplicationRequest& WithToken(const Aws::String& value) { SetToken(value); return *this;}
217 
218     /**
219      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
220      */
WithToken(Aws::String && value)221     inline PutBucketReplicationRequest& WithToken(Aws::String&& value) { SetToken(std::move(value)); return *this;}
222 
223     /**
224      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
225      */
WithToken(const char * value)226     inline PutBucketReplicationRequest& WithToken(const char* value) { SetToken(value); return *this;}
227 
228 
229     /**
230      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
231      * different account, the request will fail with an HTTP <code>403 (Access
232      * Denied)</code> error.</p>
233      */
GetExpectedBucketOwner()234     inline const Aws::String& GetExpectedBucketOwner() const{ return m_expectedBucketOwner; }
235 
236     /**
237      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
238      * different account, the request will fail with an HTTP <code>403 (Access
239      * Denied)</code> error.</p>
240      */
ExpectedBucketOwnerHasBeenSet()241     inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; }
242 
243     /**
244      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
245      * different account, the request will fail with an HTTP <code>403 (Access
246      * Denied)</code> error.</p>
247      */
SetExpectedBucketOwner(const Aws::String & value)248     inline void SetExpectedBucketOwner(const Aws::String& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = value; }
249 
250     /**
251      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
252      * different account, the request will fail with an HTTP <code>403 (Access
253      * Denied)</code> error.</p>
254      */
SetExpectedBucketOwner(Aws::String && value)255     inline void SetExpectedBucketOwner(Aws::String&& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = std::move(value); }
256 
257     /**
258      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
259      * different account, the request will fail with an HTTP <code>403 (Access
260      * Denied)</code> error.</p>
261      */
SetExpectedBucketOwner(const char * value)262     inline void SetExpectedBucketOwner(const char* value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner.assign(value); }
263 
264     /**
265      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
266      * different account, the request will fail with an HTTP <code>403 (Access
267      * Denied)</code> error.</p>
268      */
WithExpectedBucketOwner(const Aws::String & value)269     inline PutBucketReplicationRequest& WithExpectedBucketOwner(const Aws::String& value) { SetExpectedBucketOwner(value); return *this;}
270 
271     /**
272      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
273      * different account, the request will fail with an HTTP <code>403 (Access
274      * Denied)</code> error.</p>
275      */
WithExpectedBucketOwner(Aws::String && value)276     inline PutBucketReplicationRequest& WithExpectedBucketOwner(Aws::String&& value) { SetExpectedBucketOwner(std::move(value)); return *this;}
277 
278     /**
279      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
280      * different account, the request will fail with an HTTP <code>403 (Access
281      * Denied)</code> error.</p>
282      */
WithExpectedBucketOwner(const char * value)283     inline PutBucketReplicationRequest& WithExpectedBucketOwner(const char* value) { SetExpectedBucketOwner(value); return *this;}
284 
285 
286 
GetCustomizedAccessLogTag()287     inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; }
288 
289 
CustomizedAccessLogTagHasBeenSet()290     inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }
291 
292 
SetCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)293     inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; }
294 
295 
SetCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)296     inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); }
297 
298 
WithCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)299     inline PutBucketReplicationRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;}
300 
301 
WithCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)302     inline PutBucketReplicationRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;}
303 
304 
AddCustomizedAccessLogTag(const Aws::String & key,const Aws::String & value)305     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
306 
307 
AddCustomizedAccessLogTag(Aws::String && key,const Aws::String & value)308     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
309 
310 
AddCustomizedAccessLogTag(const Aws::String & key,Aws::String && value)311     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
312 
313 
AddCustomizedAccessLogTag(Aws::String && key,Aws::String && value)314     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; }
315 
316 
AddCustomizedAccessLogTag(const char * key,Aws::String && value)317     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
318 
319 
AddCustomizedAccessLogTag(Aws::String && key,const char * value)320     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
321 
322 
AddCustomizedAccessLogTag(const char * key,const char * value)323     inline PutBucketReplicationRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
324 
325   private:
326 
327     Aws::String m_bucket;
328     bool m_bucketHasBeenSet;
329 
330     Aws::String m_contentMD5;
331     bool m_contentMD5HasBeenSet;
332 
333     ReplicationConfiguration m_replicationConfiguration;
334     bool m_replicationConfigurationHasBeenSet;
335 
336     Aws::String m_token;
337     bool m_tokenHasBeenSet;
338 
339     Aws::String m_expectedBucketOwner;
340     bool m_expectedBucketOwnerHasBeenSet;
341 
342     Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
343     bool m_customizedAccessLogTagHasBeenSet;
344   };
345 
346 } // namespace Model
347 } // namespace S3
348 } // namespace Aws
349