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