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/Tagging.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 PutBucketTaggingRequest : public S3CrtRequest 28 { 29 public: 30 PutBucketTaggingRequest(); 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 "PutBucketTagging"; } 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 bucket name.</p> 49 */ GetBucket()50 inline const Aws::String& GetBucket() const{ return m_bucket; } 51 52 /** 53 * <p>The bucket name.</p> 54 */ BucketHasBeenSet()55 inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; } 56 57 /** 58 * <p>The bucket name.</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 bucket name.</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 bucket name.</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 bucket name.</p> 74 */ WithBucket(const Aws::String & value)75 inline PutBucketTaggingRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;} 76 77 /** 78 * <p>The bucket name.</p> 79 */ WithBucket(Aws::String && value)80 inline PutBucketTaggingRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;} 81 82 /** 83 * <p>The bucket name.</p> 84 */ WithBucket(const char * value)85 inline PutBucketTaggingRequest& 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 PutBucketTaggingRequest& 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 PutBucketTaggingRequest& 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 PutBucketTaggingRequest& WithContentMD5(const char* value) { SetContentMD5(value); return *this;} 167 168 169 /** 170 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 171 */ GetTagging()172 inline const Tagging& GetTagging() const{ return m_tagging; } 173 174 /** 175 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 176 */ TaggingHasBeenSet()177 inline bool TaggingHasBeenSet() const { return m_taggingHasBeenSet; } 178 179 /** 180 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 181 */ SetTagging(const Tagging & value)182 inline void SetTagging(const Tagging& value) { m_taggingHasBeenSet = true; m_tagging = value; } 183 184 /** 185 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 186 */ SetTagging(Tagging && value)187 inline void SetTagging(Tagging&& value) { m_taggingHasBeenSet = true; m_tagging = std::move(value); } 188 189 /** 190 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 191 */ WithTagging(const Tagging & value)192 inline PutBucketTaggingRequest& WithTagging(const Tagging& value) { SetTagging(value); return *this;} 193 194 /** 195 * <p>Container for the <code>TagSet</code> and <code>Tag</code> elements.</p> 196 */ WithTagging(Tagging && value)197 inline PutBucketTaggingRequest& WithTagging(Tagging&& value) { SetTagging(std::move(value)); return *this;} 198 199 200 /** 201 * <p>The account ID of the expected bucket owner. If the bucket is owned by a 202 * different account, the request will fail with an HTTP <code>403 (Access 203 * Denied)</code> error.</p> 204 */ GetExpectedBucketOwner()205 inline const Aws::String& GetExpectedBucketOwner() const{ return m_expectedBucketOwner; } 206 207 /** 208 * <p>The account ID of the expected bucket owner. If the bucket is owned by a 209 * different account, the request will fail with an HTTP <code>403 (Access 210 * Denied)</code> error.</p> 211 */ ExpectedBucketOwnerHasBeenSet()212 inline bool ExpectedBucketOwnerHasBeenSet() const { return m_expectedBucketOwnerHasBeenSet; } 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 */ SetExpectedBucketOwner(const Aws::String & value)219 inline void SetExpectedBucketOwner(const Aws::String& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = value; } 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 */ SetExpectedBucketOwner(Aws::String && value)226 inline void SetExpectedBucketOwner(Aws::String&& value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner = std::move(value); } 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 char * value)233 inline void SetExpectedBucketOwner(const char* value) { m_expectedBucketOwnerHasBeenSet = true; m_expectedBucketOwner.assign(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 */ WithExpectedBucketOwner(const Aws::String & value)240 inline PutBucketTaggingRequest& WithExpectedBucketOwner(const Aws::String& value) { SetExpectedBucketOwner(value); return *this;} 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 */ WithExpectedBucketOwner(Aws::String && value)247 inline PutBucketTaggingRequest& WithExpectedBucketOwner(Aws::String&& value) { SetExpectedBucketOwner(std::move(value)); return *this;} 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 char * value)254 inline PutBucketTaggingRequest& WithExpectedBucketOwner(const char* value) { SetExpectedBucketOwner(value); return *this;} 255 256 257 GetCustomizedAccessLogTag()258 inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; } 259 260 CustomizedAccessLogTagHasBeenSet()261 inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; } 262 263 SetCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)264 inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; } 265 266 SetCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)267 inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); } 268 269 WithCustomizedAccessLogTag(const Aws::Map<Aws::String,Aws::String> & value)270 inline PutBucketTaggingRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;} 271 272 WithCustomizedAccessLogTag(Aws::Map<Aws::String,Aws::String> && value)273 inline PutBucketTaggingRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;} 274 275 AddCustomizedAccessLogTag(const Aws::String & key,const Aws::String & value)276 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; } 277 278 AddCustomizedAccessLogTag(Aws::String && key,const Aws::String & value)279 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; } 280 281 AddCustomizedAccessLogTag(const Aws::String & key,Aws::String && value)282 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; } 283 284 AddCustomizedAccessLogTag(Aws::String && key,Aws::String && value)285 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; } 286 287 AddCustomizedAccessLogTag(const char * key,Aws::String && value)288 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; } 289 290 AddCustomizedAccessLogTag(Aws::String && key,const char * value)291 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; } 292 293 AddCustomizedAccessLogTag(const char * key,const char * value)294 inline PutBucketTaggingRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; } 295 296 private: 297 298 Aws::String m_bucket; 299 bool m_bucketHasBeenSet; 300 301 Aws::String m_contentMD5; 302 bool m_contentMD5HasBeenSet; 303 304 Tagging m_tagging; 305 bool m_taggingHasBeenSet; 306 307 Aws::String m_expectedBucketOwner; 308 bool m_expectedBucketOwnerHasBeenSet; 309 310 Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag; 311 bool m_customizedAccessLogTagHasBeenSet; 312 }; 313 314 } // namespace Model 315 } // namespace S3Crt 316 } // namespace Aws 317