1/*
2* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3*
4* Licensed under the Apache License, Version 2.0 (the "License").
5* You may not use this file except in compliance with the License.
6* A copy of the License is located at
7*
8* http://aws.amazon.com/apache2.0
9*
10* or in the "license" file accompanying this file. This file is distributed
11* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12* express or implied. See the License for the specific language governing
13* permissions and limitations under the License.
14*/
15
16#pragma once
17#include <aws/s3/S3_EXPORTS.h>
18#include <aws/s3/S3Request.h>
19#include <aws/core/utils/memory/stl/AWSString.h>
20#include <aws/s3/model/CORSConfiguration.h>
21#include <aws/core/utils/memory/stl/AWSMap.h>
22#include <utility>
23
24namespace Aws
25{
26namespace Http
27{
28 class URI;
29} //namespace Http
30namespace S3
31{
32namespace Model
33{
34
35 /**
36 */
37 class AWS_S3_API PutBucketCorsRequest : public S3Request
38 {
39 public:
40 PutBucketCorsRequest();
41
42 // Service request name is the Operation name which will send this request out,
43 // each operation should has unique request name, so that we can get operation's name from this request.
44 // Note: this is not true for response, multiple operations may have the same response name,
45 // so we can not get operation's name from response.
46 inline virtual const char* GetServiceRequestName() const override { return "PutBucketCors"; }
47
48 Aws::String SerializePayload() const override;
49
50 void AddQueryStringParameters(Aws::Http::URI& uri) const override;
51
52 Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
53
54 inline bool ShouldComputeContentMd5() const override { return true; }
55
56
57 /**
58 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
59 */
60 inline const Aws::String& GetBucket() const{ return m_bucket; }
61
62 /**
63 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
64 */
65 inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
66
67 /**
68 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
69 */
70 inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }
71
72 /**
73 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
74 */
75 inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }
76
77 /**
78 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
79 */
80 inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }
81
82 /**
83 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
84 */
85 inline PutBucketCorsRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}
86
87 /**
88 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
89 */
90 inline PutBucketCorsRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}
91
92 /**
93 * <p>Specifies the bucket impacted by the <code>cors</code>configuration.</p>
94 */
95 inline PutBucketCorsRequest& WithBucket(const char* value) { SetBucket(value); return *this;}
96
97
98 /**
99 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
100 * bucket. For more information, see <a
101 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
102 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
103 * Developer Guide</i>.</p>
104 */
105 inline const CORSConfiguration& GetCORSConfiguration() const{ return m_cORSConfiguration; }
106
107 /**
108 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
109 * bucket. For more information, see <a
110 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
111 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
112 * Developer Guide</i>.</p>
113 */
114 inline bool CORSConfigurationHasBeenSet() const { return m_cORSConfigurationHasBeenSet; }
115
116 /**
117 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
118 * bucket. For more information, see <a
119 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
120 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
121 * Developer Guide</i>.</p>
122 */
123 inline void SetCORSConfiguration(const CORSConfiguration& value) { m_cORSConfigurationHasBeenSet = true; m_cORSConfiguration = value; }
124
125 /**
126 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
127 * bucket. For more information, see <a
128 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
129 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
130 * Developer Guide</i>.</p>
131 */
132 inline void SetCORSConfiguration(CORSConfiguration&& value) { m_cORSConfigurationHasBeenSet = true; m_cORSConfiguration = std::move(value); }
133
134 /**
135 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
136 * bucket. For more information, see <a
137 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
138 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
139 * Developer Guide</i>.</p>
140 */
141 inline PutBucketCorsRequest& WithCORSConfiguration(const CORSConfiguration& value) { SetCORSConfiguration(value); return *this;}
142
143 /**
144 * <p>Describes the cross-origin access configuration for objects in an Amazon S3
145 * bucket. For more information, see <a
146 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html">Enabling
147 * Cross-Origin Resource Sharing</a> in the <i>Amazon Simple Storage Service
148 * Developer Guide</i>.</p>
149 */
150 inline PutBucketCorsRequest& WithCORSConfiguration(CORSConfiguration&& value) { SetCORSConfiguration(std::move(value)); return *this;}
151
152
153 /**
154 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
155 * as a message integrity check to verify that the request body was not corrupted
156 * in transit. For more information, go to <a
157 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
158 */
159 inline const Aws::String& GetContentMD5() const{ return m_contentMD5; }
160
161 /**
162 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
163 * as a message integrity check to verify that the request body was not corrupted
164 * in transit. For more information, go to <a
165 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
166 */
167 inline bool ContentMD5HasBeenSet() const { return m_contentMD5HasBeenSet; }
168
169 /**
170 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
171 * as a message integrity check to verify that the request body was not corrupted
172 * in transit. For more information, go to <a
173 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
174 */
175 inline void SetContentMD5(const Aws::String& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = value; }
176
177 /**
178 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
179 * as a message integrity check to verify that the request body was not corrupted
180 * in transit. For more information, go to <a
181 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
182 */
183 inline void SetContentMD5(Aws::String&& value) { m_contentMD5HasBeenSet = true; m_contentMD5 = std::move(value); }
184
185 /**
186 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
187 * as a message integrity check to verify that the request body was not corrupted
188 * in transit. For more information, go to <a
189 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
190 */
191 inline void SetContentMD5(const char* value) { m_contentMD5HasBeenSet = true; m_contentMD5.assign(value); }
192
193 /**
194 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
195 * as a message integrity check to verify that the request body was not corrupted
196 * in transit. For more information, go to <a
197 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
198 */
199 inline PutBucketCorsRequest& WithContentMD5(const Aws::String& value) { SetContentMD5(value); return *this;}
200
201 /**
202 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
203 * as a message integrity check to verify that the request body was not corrupted
204 * in transit. For more information, go to <a
205 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
206 */
207 inline PutBucketCorsRequest& WithContentMD5(Aws::String&& value) { SetContentMD5(std::move(value)); return *this;}
208
209 /**
210 * <p>The base64-encoded 128-bit MD5 digest of the data. This header must be used
211 * as a message integrity check to verify that the request body was not corrupted
212 * in transit. For more information, go to <a
213 * href="http://www.ietf.org/rfc/rfc1864.txt">RFC 1864.</a> </p>
214 */
215 inline PutBucketCorsRequest& WithContentMD5(const char* value) { SetContentMD5(value); return *this;}
216
217
218
219 inline const Aws::Map<Aws::String, Aws::String>& GetCustomizedAccessLogTag() const{ return m_customizedAccessLogTag; }
220
221
222 inline bool CustomizedAccessLogTagHasBeenSet() const { return m_customizedAccessLogTagHasBeenSet; }
223
224
225 inline void SetCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = value; }
226
227
228 inline void SetCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag = std::move(value); }
229
230
231 inline PutBucketCorsRequest& WithCustomizedAccessLogTag(const Aws::Map<Aws::String, Aws::String>& value) { SetCustomizedAccessLogTag(value); return *this;}
232
233
234 inline PutBucketCorsRequest& WithCustomizedAccessLogTag(Aws::Map<Aws::String, Aws::String>&& value) { SetCustomizedAccessLogTag(std::move(value)); return *this;}
235
236
237 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(const Aws::String& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
238
239
240 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(Aws::String&& key, const Aws::String& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
241
242
243 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(const Aws::String& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
244
245
246 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(Aws::String&& key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), std::move(value)); return *this; }
247
248
249 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(const char* key, Aws::String&& value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, std::move(value)); return *this; }
250
251
252 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(Aws::String&& key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(std::move(key), value); return *this; }
253
254
255 inline PutBucketCorsRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; }
256
257 private:
258
259 Aws::String m_bucket;
260 bool m_bucketHasBeenSet;
261
262 CORSConfiguration m_cORSConfiguration;
263 bool m_cORSConfigurationHasBeenSet;
264
265 Aws::String m_contentMD5;
266 bool m_contentMD5HasBeenSet;
267
268 Aws::Map<Aws::String, Aws::String> m_customizedAccessLogTag;
269 bool m_customizedAccessLogTagHasBeenSet;
270 };
271
272} // namespace Model
273} // namespace S3
274} // namespace Aws
275