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-crt/S3Crt_EXPORTS.h>
8 #include <aws/s3-crt/S3CrtRequest.h>
9 #include <aws/core/utils/memory/stl/AWSString.h>
10 #include <aws/s3-crt/model/ObjectLockConfiguration.h>
11 #include <aws/s3-crt/model/RequestPayer.h>
12 #include <aws/core/utils/memory/stl/AWSMap.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace Http
18 {
19     class URI;
20 } //namespace Http
21 namespace S3Crt
22 {
23 namespace Model
24 {
25 
26   /**
27    */
28   class AWS_S3CRT_API PutObjectLockConfigurationRequest : public S3CrtRequest
29   {
30   public:
31     PutObjectLockConfigurationRequest();
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.
GetServiceRequestName()37     inline virtual const char* GetServiceRequestName() const override { return "PutObjectLockConfiguration"; }
38 
39     Aws::String SerializePayload() const override;
40 
41     void AddQueryStringParameters(Aws::Http::URI& uri) const override;
42 
43     Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
44 
ShouldComputeContentMd5()45     inline bool ShouldComputeContentMd5() const override { return true; }
46 
47 
48     /**
49      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
50      */
GetBucket()51     inline const Aws::String& GetBucket() const{ return m_bucket; }
52 
53     /**
54      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
55      */
BucketHasBeenSet()56     inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
57 
58     /**
59      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
60      */
SetBucket(const Aws::String & value)61     inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }
62 
63     /**
64      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
65      */
SetBucket(Aws::String && value)66     inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }
67 
68     /**
69      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
70      */
SetBucket(const char * value)71     inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }
72 
73     /**
74      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
75      */
WithBucket(const Aws::String & value)76     inline PutObjectLockConfigurationRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}
77 
78     /**
79      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
80      */
WithBucket(Aws::String && value)81     inline PutObjectLockConfigurationRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}
82 
83     /**
84      * <p>The bucket whose Object Lock configuration you want to create or replace.</p>
85      */
WithBucket(const char * value)86     inline PutObjectLockConfigurationRequest& WithBucket(const char* value) { SetBucket(value); return *this;}
87 
88 
89     /**
90      * <p>The Object Lock configuration that you want to apply to the specified
91      * bucket.</p>
92      */
GetObjectLockConfiguration()93     inline const ObjectLockConfiguration& GetObjectLockConfiguration() const{ return m_objectLockConfiguration; }
94 
95     /**
96      * <p>The Object Lock configuration that you want to apply to the specified
97      * bucket.</p>
98      */
ObjectLockConfigurationHasBeenSet()99     inline bool ObjectLockConfigurationHasBeenSet() const { return m_objectLockConfigurationHasBeenSet; }
100 
101     /**
102      * <p>The Object Lock configuration that you want to apply to the specified
103      * bucket.</p>
104      */
SetObjectLockConfiguration(const ObjectLockConfiguration & value)105     inline void SetObjectLockConfiguration(const ObjectLockConfiguration& value) { m_objectLockConfigurationHasBeenSet = true; m_objectLockConfiguration = value; }
106 
107     /**
108      * <p>The Object Lock configuration that you want to apply to the specified
109      * bucket.</p>
110      */
SetObjectLockConfiguration(ObjectLockConfiguration && value)111     inline void SetObjectLockConfiguration(ObjectLockConfiguration&& value) { m_objectLockConfigurationHasBeenSet = true; m_objectLockConfiguration = std::move(value); }
112 
113     /**
114      * <p>The Object Lock configuration that you want to apply to the specified
115      * bucket.</p>
116      */
WithObjectLockConfiguration(const ObjectLockConfiguration & value)117     inline PutObjectLockConfigurationRequest& WithObjectLockConfiguration(const ObjectLockConfiguration& value) { SetObjectLockConfiguration(value); return *this;}
118 
119     /**
120      * <p>The Object Lock configuration that you want to apply to the specified
121      * bucket.</p>
122      */
WithObjectLockConfiguration(ObjectLockConfiguration && value)123     inline PutObjectLockConfigurationRequest& WithObjectLockConfiguration(ObjectLockConfiguration&& value) { SetObjectLockConfiguration(std::move(value)); return *this;}
124 
125 
126 
GetRequestPayer()127     inline const RequestPayer& GetRequestPayer() const{ return m_requestPayer; }
128 
129 
RequestPayerHasBeenSet()130     inline bool RequestPayerHasBeenSet() const { return m_requestPayerHasBeenSet; }
131 
132 
SetRequestPayer(const RequestPayer & value)133     inline void SetRequestPayer(const RequestPayer& value) { m_requestPayerHasBeenSet = true; m_requestPayer = value; }
134 
135 
SetRequestPayer(RequestPayer && value)136     inline void SetRequestPayer(RequestPayer&& value) { m_requestPayerHasBeenSet = true; m_requestPayer = std::move(value); }
137 
138 
WithRequestPayer(const RequestPayer & value)139     inline PutObjectLockConfigurationRequest& WithRequestPayer(const RequestPayer& value) { SetRequestPayer(value); return *this;}
140 
141 
WithRequestPayer(RequestPayer && value)142     inline PutObjectLockConfigurationRequest& WithRequestPayer(RequestPayer&& value) { SetRequestPayer(std::move(value)); return *this;}
143 
144 
145     /**
146      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
147      */
GetToken()148     inline const Aws::String& GetToken() const{ return m_token; }
149 
150     /**
151      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
152      */
TokenHasBeenSet()153     inline bool TokenHasBeenSet() const { return m_tokenHasBeenSet; }
154 
155     /**
156      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
157      */
SetToken(const Aws::String & value)158     inline void SetToken(const Aws::String& value) { m_tokenHasBeenSet = true; m_token = value; }
159 
160     /**
161      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
162      */
SetToken(Aws::String && value)163     inline void SetToken(Aws::String&& value) { m_tokenHasBeenSet = true; m_token = std::move(value); }
164 
165     /**
166      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
167      */
SetToken(const char * value)168     inline void SetToken(const char* value) { m_tokenHasBeenSet = true; m_token.assign(value); }
169 
170     /**
171      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
172      */
WithToken(const Aws::String & value)173     inline PutObjectLockConfigurationRequest& WithToken(const Aws::String& value) { SetToken(value); return *this;}
174 
175     /**
176      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
177      */
WithToken(Aws::String && value)178     inline PutObjectLockConfigurationRequest& WithToken(Aws::String&& value) { SetToken(std::move(value)); return *this;}
179 
180     /**
181      * <p>A token to allow Object Lock to be enabled for an existing bucket.</p>
182      */
WithToken(const char * value)183     inline PutObjectLockConfigurationRequest& WithToken(const char* value) { SetToken(value); return *this;}
184 
185 
186     /**
187      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
188      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
189      * field is calculated automatically.</p>
190      */
GetContentMD5()191     inline const Aws::String& GetContentMD5() const{ return m_contentMD5; }
192 
193     /**
194      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
195      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
196      * field is calculated automatically.</p>
197      */
ContentMD5HasBeenSet()198     inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; }
199 
200     /**
201      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
202      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
203      * field is calculated automatically.</p>
204      */
SetContentMD5(const Aws::String & value)205     inline void SetContentMD5(const Aws::String& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = value; }
206 
207     /**
208      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
209      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
210      * field is calculated automatically.</p>
211      */
SetContentMD5(Aws::String && value)212     inline void SetContentMD5(Aws::String&& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = std::move(value); }
213 
214     /**
215      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
216      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
217      * field is calculated automatically.</p>
218      */
SetContentMD5(const char * value)219     inline void SetContentMD5(const char* value) { m_contentMD5HasBeenSet = true; m_contentMD5.assign(value); }
220 
221     /**
222      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
223      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
224      * field is calculated automatically.</p>
225      */
WithContentMD5(const Aws::String & value)226     inline PutObjectLockConfigurationRequest& WithContentMD5(const Aws::String& value) { SetContentMD5(value); return *this;}
227 
228     /**
229      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
230      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
231      * field is calculated automatically.</p>
232      */
WithContentMD5(Aws::String && value)233     inline PutObjectLockConfigurationRequest& WithContentMD5(Aws::String&& value) { SetContentMD5(std::move(value)); return *this;}
234 
235     /**
236      * <p>The MD5 hash for the request body.</p> <p>For requests made using the Amazon
237      * Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this
238      * field is calculated automatically.</p>
239      */
WithContentMD5(const char * value)240     inline PutObjectLockConfigurationRequest& WithContentMD5(const char* value) { SetContentMD5(value); return *this;}
241 
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      */
GetExpectedBucketOwner()248     inline const Aws::String& GetExpectedBucketOwner() const{ return m_expectedBucketOwner; }
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      */
ExpectedBucketOwnerHasBeenSet()255     inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; }
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 Aws::String & value)262     inline void SetExpectedBucketOwner(const Aws::String& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = 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      */
SetExpectedBucketOwner(Aws::String && value)269     inline void SetExpectedBucketOwner(Aws::String&& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = std::move(value); }
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      */
SetExpectedBucketOwner(const char * value)276     inline void SetExpectedBucketOwner(const char* value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner.assign(value); }
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 Aws::String & value)283     inline PutObjectLockConfigurationRequest& WithExpectedBucketOwner(const Aws::String& value) { SetExpectedBucketOwner(value); return *this;}
284 
285     /**
286      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
287      * different account, the request will fail with an HTTP <code>403 (Access
288      * Denied)</code> error.</p>
289      */
WithExpectedBucketOwner(Aws::String && value)290     inline PutObjectLockConfigurationRequest& WithExpectedBucketOwner(Aws::String&& value) { SetExpectedBucketOwner(std::move(value)); return *this;}
291 
292     /**
293      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
294      * different account, the request will fail with an HTTP <code>403 (Access
295      * Denied)</code> error.</p>
296      */
WithExpectedBucketOwner(const char * value)297     inline PutObjectLockConfigurationRequest& WithExpectedBucketOwner(const char* value) { SetExpectedBucketOwner(value); return *this;}
298 
299 
300 
GetCustomizedAccessLogTag()301     inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; }
302 
303 
CustomizedAccessLogTagHasBeenSet()304     inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }
305 
306 
SetCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)307     inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; }
308 
309 
SetCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)310     inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); }
311 
312 
WithCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)313     inline PutObjectLockConfigurationRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;}
314 
315 
WithCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)316     inline PutObjectLockConfigurationRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;}
317 
318 
AddCustomizedAccessLogTag(const Aws::String & key,const Aws::String & value)319     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
320 
321 
AddCustomizedAccessLogTag(Aws::String && key,const Aws::String & value)322     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
323 
324 
AddCustomizedAccessLogTag(const Aws::String & key,Aws::String && value)325     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
326 
327 
AddCustomizedAccessLogTag(Aws::String && key,Aws::String && value)328     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; }
329 
330 
AddCustomizedAccessLogTag(const char * key,Aws::String && value)331     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
332 
333 
AddCustomizedAccessLogTag(Aws::String && key,const char * value)334     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
335 
336 
AddCustomizedAccessLogTag(const char * key,const char * value)337     inline PutObjectLockConfigurationRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
338 
339   private:
340 
341     Aws::String m_bucket;
342     bool m_bucketHasBeenSet;
343 
344     ObjectLockConfiguration m_objectLockConfiguration;
345     bool m_objectLockConfigurationHasBeenSet;
346 
347     RequestPayer m_requestPayer;
348     bool m_requestPayerHasBeenSet;
349 
350     Aws::String m_token;
351     bool m_tokenHasBeenSet;
352 
353     Aws::String m_contentMD5;
354     bool m_contentMD5HasBeenSet;
355 
356     Aws::String m_expectedBucketOwner;
357     bool m_expectedBucketOwnerHasBeenSet;
358 
359     Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
360     bool m_customizedAccessLogTagHasBeenSet;
361   };
362 
363 } // namespace Model
364 } // namespace S3Crt
365 } // namespace Aws
366