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/ServerSideEncryptionConfiguration.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 S3Crt
21 {
22 namespace Model
23 {
24 
25   /**
26    */
27   class AWS_S3CRT_API PutBucketEncryptionRequest : public S3CrtRequest
28   {
29   public:
30     PutBucketEncryptionRequest();
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 "PutBucketEncryption"; }
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>Specifies default encryption for a bucket using server-side encryption with
49      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
50      * information about the Amazon S3 default encryption feature, see <a
51      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
52      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
53      */
GetBucket()54     inline const Aws::String& GetBucket() const{ return m_bucket; }
55 
56     /**
57      * <p>Specifies default encryption for a bucket using server-side encryption with
58      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
59      * information about the Amazon S3 default encryption feature, see <a
60      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
61      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
62      */
BucketHasBeenSet()63     inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
64 
65     /**
66      * <p>Specifies default encryption for a bucket using server-side encryption with
67      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
68      * information about the Amazon S3 default encryption feature, see <a
69      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
70      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
71      */
SetBucket(const Aws::String & value)72     inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }
73 
74     /**
75      * <p>Specifies default encryption for a bucket using server-side encryption with
76      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
77      * information about the Amazon S3 default encryption feature, see <a
78      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
79      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
80      */
SetBucket(Aws::String && value)81     inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }
82 
83     /**
84      * <p>Specifies default encryption for a bucket using server-side encryption with
85      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
86      * information about the Amazon S3 default encryption feature, see <a
87      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
88      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
89      */
SetBucket(const char * value)90     inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }
91 
92     /**
93      * <p>Specifies default encryption for a bucket using server-side encryption with
94      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
95      * information about the Amazon S3 default encryption feature, see <a
96      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
97      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
98      */
WithBucket(const Aws::String & value)99     inline PutBucketEncryptionRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}
100 
101     /**
102      * <p>Specifies default encryption for a bucket using server-side encryption with
103      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
104      * information about the Amazon S3 default encryption feature, see <a
105      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
106      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
107      */
WithBucket(Aws::String && value)108     inline PutBucketEncryptionRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}
109 
110     /**
111      * <p>Specifies default encryption for a bucket using server-side encryption with
112      * Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For
113      * information about the Amazon S3 default encryption feature, see <a
114      * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
115      * S3 Default Bucket Encryption</a> in the <i>Amazon S3 User Guide</i>.</p>
116      */
WithBucket(const char * value)117     inline PutBucketEncryptionRequest& WithBucket(const char* value) { SetBucket(value); return *this;}
118 
119 
120     /**
121      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
122      * configuration.</p> <p>For requests made using the Amazon Web Services Command
123      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
124      * automatically.</p>
125      */
GetContentMD5()126     inline const Aws::String& GetContentMD5() const{ return m_contentMD5; }
127 
128     /**
129      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
130      * configuration.</p> <p>For requests made using the Amazon Web Services Command
131      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
132      * automatically.</p>
133      */
ContentMD5HasBeenSet()134     inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; }
135 
136     /**
137      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
138      * configuration.</p> <p>For requests made using the Amazon Web Services Command
139      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
140      * automatically.</p>
141      */
SetContentMD5(const Aws::String & value)142     inline void SetContentMD5(const Aws::String& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = value; }
143 
144     /**
145      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
146      * configuration.</p> <p>For requests made using the Amazon Web Services Command
147      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
148      * automatically.</p>
149      */
SetContentMD5(Aws::String && value)150     inline void SetContentMD5(Aws::String&& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = std::move(value); }
151 
152     /**
153      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
154      * configuration.</p> <p>For requests made using the Amazon Web Services Command
155      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
156      * automatically.</p>
157      */
SetContentMD5(const char * value)158     inline void SetContentMD5(const char* value) { m_contentMD5HasBeenSet = true; m_contentMD5.assign(value); }
159 
160     /**
161      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
162      * configuration.</p> <p>For requests made using the Amazon Web Services Command
163      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
164      * automatically.</p>
165      */
WithContentMD5(const Aws::String & value)166     inline PutBucketEncryptionRequest& WithContentMD5(const Aws::String& value) { SetContentMD5(value); return *this;}
167 
168     /**
169      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
170      * configuration.</p> <p>For requests made using the Amazon Web Services Command
171      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
172      * automatically.</p>
173      */
WithContentMD5(Aws::String && value)174     inline PutBucketEncryptionRequest& WithContentMD5(Aws::String&& value) { SetContentMD5(std::move(value)); return *this;}
175 
176     /**
177      * <p>The base64-encoded 128-bit MD5 digest of the server-side encryption
178      * configuration.</p> <p>For requests made using the Amazon Web Services Command
179      * Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated
180      * automatically.</p>
181      */
WithContentMD5(const char * value)182     inline PutBucketEncryptionRequest& WithContentMD5(const char* value) { SetContentMD5(value); return *this;}
183 
184 
185 
GetServerSideEncryptionConfiguration()186     inline const ServerSideEncryptionConfiguration& GetServerSideEncryptionConfiguration() const{ return m_serverSideEncryptionConfiguration; }
187 
188 
ServerSideEncryptionConfigurationHasBeenSet()189     inline bool ServerSideEncryptionConfigurationHasBeenSet() const { return m_serverSideEncryptionConfigurationHasBeenSet; }
190 
191 
SetServerSideEncryptionConfiguration(const ServerSideEncryptionConfiguration & value)192     inline void SetServerSideEncryptionConfiguration(const ServerSideEncryptionConfiguration& value) { m_serverSideEncryptionConfigurationHasBeenSet = true; m_serverSideEncryptionConfiguration = value; }
193 
194 
SetServerSideEncryptionConfiguration(ServerSideEncryptionConfiguration && value)195     inline void SetServerSideEncryptionConfiguration(ServerSideEncryptionConfiguration&& value) { m_serverSideEncryptionConfigurationHasBeenSet = true; m_serverSideEncryptionConfiguration = std::move(value); }
196 
197 
WithServerSideEncryptionConfiguration(const ServerSideEncryptionConfiguration & value)198     inline PutBucketEncryptionRequest& WithServerSideEncryptionConfiguration(const ServerSideEncryptionConfiguration& value) { SetServerSideEncryptionConfiguration(value); return *this;}
199 
200 
WithServerSideEncryptionConfiguration(ServerSideEncryptionConfiguration && value)201     inline PutBucketEncryptionRequest& WithServerSideEncryptionConfiguration(ServerSideEncryptionConfiguration&& value) { SetServerSideEncryptionConfiguration(std::move(value)); return *this;}
202 
203 
204     /**
205      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
206      * different account, the request will fail with an HTTP <code>403 (Access
207      * Denied)</code> error.</p>
208      */
GetExpectedBucketOwner()209     inline const Aws::String& GetExpectedBucketOwner() const{ return m_expectedBucketOwner; }
210 
211     /**
212      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
213      * different account, the request will fail with an HTTP <code>403 (Access
214      * Denied)</code> error.</p>
215      */
ExpectedBucketOwnerHasBeenSet()216     inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; }
217 
218     /**
219      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
220      * different account, the request will fail with an HTTP <code>403 (Access
221      * Denied)</code> error.</p>
222      */
SetExpectedBucketOwner(const Aws::String & value)223     inline void SetExpectedBucketOwner(const Aws::String& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = value; }
224 
225     /**
226      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
227      * different account, the request will fail with an HTTP <code>403 (Access
228      * Denied)</code> error.</p>
229      */
SetExpectedBucketOwner(Aws::String && value)230     inline void SetExpectedBucketOwner(Aws::String&& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = std::move(value); }
231 
232     /**
233      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
234      * different account, the request will fail with an HTTP <code>403 (Access
235      * Denied)</code> error.</p>
236      */
SetExpectedBucketOwner(const char * value)237     inline void SetExpectedBucketOwner(const char* value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner.assign(value); }
238 
239     /**
240      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
241      * different account, the request will fail with an HTTP <code>403 (Access
242      * Denied)</code> error.</p>
243      */
WithExpectedBucketOwner(const Aws::String & value)244     inline PutBucketEncryptionRequest& WithExpectedBucketOwner(const Aws::String& value) { SetExpectedBucketOwner(value); return *this;}
245 
246     /**
247      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
248      * different account, the request will fail with an HTTP <code>403 (Access
249      * Denied)</code> error.</p>
250      */
WithExpectedBucketOwner(Aws::String && value)251     inline PutBucketEncryptionRequest& WithExpectedBucketOwner(Aws::String&& value) { SetExpectedBucketOwner(std::move(value)); return *this;}
252 
253     /**
254      * <p>The account ID of the expected bucket owner. If the bucket is owned by a
255      * different account, the request will fail with an HTTP <code>403 (Access
256      * Denied)</code> error.</p>
257      */
WithExpectedBucketOwner(const char * value)258     inline PutBucketEncryptionRequest& WithExpectedBucketOwner(const char* value) { SetExpectedBucketOwner(value); return *this;}
259 
260 
261 
GetCustomizedAccessLogTag()262     inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; }
263 
264 
CustomizedAccessLogTagHasBeenSet()265     inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }
266 
267 
SetCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)268     inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; }
269 
270 
SetCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)271     inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); }
272 
273 
WithCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)274     inline PutBucketEncryptionRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;}
275 
276 
WithCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)277     inline PutBucketEncryptionRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;}
278 
279 
AddCustomizedAccessLogTag(const Aws::String & key,const Aws::String & value)280     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
281 
282 
AddCustomizedAccessLogTag(Aws::String && key,const Aws::String & value)283     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
284 
285 
AddCustomizedAccessLogTag(const Aws::String & key,Aws::String && value)286     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
287 
288 
AddCustomizedAccessLogTag(Aws::String && key,Aws::String && value)289     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; }
290 
291 
AddCustomizedAccessLogTag(const char * key,Aws::String && value)292     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
293 
294 
AddCustomizedAccessLogTag(Aws::String && key,const char * value)295     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
296 
297 
AddCustomizedAccessLogTag(const char * key,const char * value)298     inline PutBucketEncryptionRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
299 
300   private:
301 
302     Aws::String m_bucket;
303     bool m_bucketHasBeenSet;
304 
305     Aws::String m_contentMD5;
306     bool m_contentMD5HasBeenSet;
307 
308     ServerSideEncryptionConfiguration m_serverSideEncryptionConfiguration;
309     bool m_serverSideEncryptionConfigurationHasBeenSet;
310 
311     Aws::String m_expectedBucketOwner;
312     bool m_expectedBucketOwnerHasBeenSet;
313 
314     Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
315     bool m_customizedAccessLogTagHasBeenSet;
316   };
317 
318 } // namespace Model
319 } // namespace S3Crt
320 } // namespace Aws
321