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 | #include <aws/core/utils/Outcome.h> |
17 | #include <aws/core/auth/AWSAuthSigner.h> |
18 | #include <aws/core/client/CoreErrors.h> |
19 | #include <aws/core/client/RetryStrategy.h> |
20 | #include <aws/core/http/HttpClient.h> |
21 | #include <aws/core/http/HttpResponse.h> |
22 | #include <aws/core/http/HttpClientFactory.h> |
23 | #include <aws/core/auth/AWSCredentialsProviderChain.h> |
24 | #include <aws/core/utils/xml/XmlSerializer.h> |
25 | #include <aws/core/utils/memory/stl/AWSStringStream.h> |
26 | #include <aws/core/utils/threading/Executor.h> |
27 | #include <aws/core/utils/DNS.h> |
28 | #include <aws/core/utils/logging/LogMacros.h> |
29 | |
30 | #include <aws/core/utils/event/EventStream.h> |
31 | #include <aws/s3/S3Client.h> |
32 | #include <aws/s3/S3Endpoint.h> |
33 | #include <aws/s3/S3ErrorMarshaller.h> |
34 | #include <aws/s3/S3ARN.h> |
35 | #include <aws/s3/model/AbortMultipartUploadRequest.h> |
36 | #include <aws/s3/model/CompleteMultipartUploadRequest.h> |
37 | #include <aws/s3/model/CopyObjectRequest.h> |
38 | #include <aws/s3/model/CreateBucketRequest.h> |
39 | #include <aws/s3/model/CreateMultipartUploadRequest.h> |
40 | #include <aws/s3/model/DeleteBucketRequest.h> |
41 | #include <aws/s3/model/DeleteBucketAnalyticsConfigurationRequest.h> |
42 | #include <aws/s3/model/DeleteBucketCorsRequest.h> |
43 | #include <aws/s3/model/DeleteBucketEncryptionRequest.h> |
44 | #include <aws/s3/model/DeleteBucketInventoryConfigurationRequest.h> |
45 | #include <aws/s3/model/DeleteBucketLifecycleRequest.h> |
46 | #include <aws/s3/model/DeleteBucketMetricsConfigurationRequest.h> |
47 | #include <aws/s3/model/DeleteBucketPolicyRequest.h> |
48 | #include <aws/s3/model/DeleteBucketReplicationRequest.h> |
49 | #include <aws/s3/model/DeleteBucketTaggingRequest.h> |
50 | #include <aws/s3/model/DeleteBucketWebsiteRequest.h> |
51 | #include <aws/s3/model/DeleteObjectRequest.h> |
52 | #include <aws/s3/model/DeleteObjectTaggingRequest.h> |
53 | #include <aws/s3/model/DeleteObjectsRequest.h> |
54 | #include <aws/s3/model/DeletePublicAccessBlockRequest.h> |
55 | #include <aws/s3/model/GetBucketAccelerateConfigurationRequest.h> |
56 | #include <aws/s3/model/GetBucketAclRequest.h> |
57 | #include <aws/s3/model/GetBucketAnalyticsConfigurationRequest.h> |
58 | #include <aws/s3/model/GetBucketCorsRequest.h> |
59 | #include <aws/s3/model/GetBucketEncryptionRequest.h> |
60 | #include <aws/s3/model/GetBucketInventoryConfigurationRequest.h> |
61 | #include <aws/s3/model/GetBucketLifecycleConfigurationRequest.h> |
62 | #include <aws/s3/model/GetBucketLocationRequest.h> |
63 | #include <aws/s3/model/GetBucketLoggingRequest.h> |
64 | #include <aws/s3/model/GetBucketMetricsConfigurationRequest.h> |
65 | #include <aws/s3/model/GetBucketNotificationConfigurationRequest.h> |
66 | #include <aws/s3/model/GetBucketPolicyRequest.h> |
67 | #include <aws/s3/model/GetBucketPolicyStatusRequest.h> |
68 | #include <aws/s3/model/GetBucketReplicationRequest.h> |
69 | #include <aws/s3/model/GetBucketRequestPaymentRequest.h> |
70 | #include <aws/s3/model/GetBucketTaggingRequest.h> |
71 | #include <aws/s3/model/GetBucketVersioningRequest.h> |
72 | #include <aws/s3/model/GetBucketWebsiteRequest.h> |
73 | #include <aws/s3/model/GetObjectRequest.h> |
74 | #include <aws/s3/model/GetObjectAclRequest.h> |
75 | #include <aws/s3/model/GetObjectLegalHoldRequest.h> |
76 | #include <aws/s3/model/GetObjectLockConfigurationRequest.h> |
77 | #include <aws/s3/model/GetObjectRetentionRequest.h> |
78 | #include <aws/s3/model/GetObjectTaggingRequest.h> |
79 | #include <aws/s3/model/GetObjectTorrentRequest.h> |
80 | #include <aws/s3/model/GetPublicAccessBlockRequest.h> |
81 | #include <aws/s3/model/HeadBucketRequest.h> |
82 | #include <aws/s3/model/HeadObjectRequest.h> |
83 | #include <aws/s3/model/ListBucketAnalyticsConfigurationsRequest.h> |
84 | #include <aws/s3/model/ListBucketInventoryConfigurationsRequest.h> |
85 | #include <aws/s3/model/ListBucketMetricsConfigurationsRequest.h> |
86 | #include <aws/s3/model/ListMultipartUploadsRequest.h> |
87 | #include <aws/s3/model/ListObjectVersionsRequest.h> |
88 | #include <aws/s3/model/ListObjectsRequest.h> |
89 | #include <aws/s3/model/ListObjectsV2Request.h> |
90 | #include <aws/s3/model/ListPartsRequest.h> |
91 | #include <aws/s3/model/PutBucketAccelerateConfigurationRequest.h> |
92 | #include <aws/s3/model/PutBucketAclRequest.h> |
93 | #include <aws/s3/model/PutBucketAnalyticsConfigurationRequest.h> |
94 | #include <aws/s3/model/PutBucketCorsRequest.h> |
95 | #include <aws/s3/model/PutBucketEncryptionRequest.h> |
96 | #include <aws/s3/model/PutBucketInventoryConfigurationRequest.h> |
97 | #include <aws/s3/model/PutBucketLifecycleConfigurationRequest.h> |
98 | #include <aws/s3/model/PutBucketLoggingRequest.h> |
99 | #include <aws/s3/model/PutBucketMetricsConfigurationRequest.h> |
100 | #include <aws/s3/model/PutBucketNotificationConfigurationRequest.h> |
101 | #include <aws/s3/model/PutBucketPolicyRequest.h> |
102 | #include <aws/s3/model/PutBucketReplicationRequest.h> |
103 | #include <aws/s3/model/PutBucketRequestPaymentRequest.h> |
104 | #include <aws/s3/model/PutBucketTaggingRequest.h> |
105 | #include <aws/s3/model/PutBucketVersioningRequest.h> |
106 | #include <aws/s3/model/PutBucketWebsiteRequest.h> |
107 | #include <aws/s3/model/PutObjectRequest.h> |
108 | #include <aws/s3/model/PutObjectAclRequest.h> |
109 | #include <aws/s3/model/PutObjectLegalHoldRequest.h> |
110 | #include <aws/s3/model/PutObjectLockConfigurationRequest.h> |
111 | #include <aws/s3/model/PutObjectRetentionRequest.h> |
112 | #include <aws/s3/model/PutObjectTaggingRequest.h> |
113 | #include <aws/s3/model/PutPublicAccessBlockRequest.h> |
114 | #include <aws/s3/model/RestoreObjectRequest.h> |
115 | #include <aws/s3/model/SelectObjectContentRequest.h> |
116 | #include <aws/s3/model/UploadPartRequest.h> |
117 | #include <aws/s3/model/UploadPartCopyRequest.h> |
118 | |
119 | using namespace Aws; |
120 | using namespace Aws::Auth; |
121 | using namespace Aws::Client; |
122 | using namespace Aws::S3; |
123 | using namespace Aws::S3::Model; |
124 | using namespace Aws::Http; |
125 | using namespace Aws::Utils::Xml; |
126 | |
127 | |
128 | static const char* SERVICE_NAME = "s3" ; |
129 | static const char* ALLOCATION_TAG = "S3Client" ; |
130 | |
131 | |
132 | S3Client::S3Client(const Client::ClientConfiguration& clientConfiguration, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signPayloads, bool useVirtualAddressing, Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION USEast1RegionalEndPointOption) : |
133 | BASECLASS(clientConfiguration, |
134 | Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG), |
135 | SERVICE_NAME, clientConfiguration.region, signPayloads, false), |
136 | Aws::MakeShared<S3ErrorMarshaller>(ALLOCATION_TAG)), |
137 | m_executor(clientConfiguration.executor), m_useVirtualAddressing(useVirtualAddressing), m_USEast1RegionalEndpointOption(USEast1RegionalEndPointOption) |
138 | { |
139 | init(clientConfiguration); |
140 | } |
141 | |
142 | S3Client::S3Client(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signPayloads, bool useVirtualAddressing, Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION USEast1RegionalEndPointOption) : |
143 | BASECLASS(clientConfiguration, |
144 | Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials), |
145 | SERVICE_NAME, clientConfiguration.region, signPayloads, false), |
146 | Aws::MakeShared<S3ErrorMarshaller>(ALLOCATION_TAG)), |
147 | m_executor(clientConfiguration.executor), m_useVirtualAddressing(useVirtualAddressing), m_USEast1RegionalEndpointOption(USEast1RegionalEndPointOption) |
148 | { |
149 | init(clientConfiguration); |
150 | } |
151 | |
152 | S3Client::S3Client(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider, |
153 | const Client::ClientConfiguration& clientConfiguration, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy signPayloads, bool useVirtualAddressing, Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION USEast1RegionalEndPointOption) : |
154 | BASECLASS(clientConfiguration, |
155 | Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider, |
156 | SERVICE_NAME, clientConfiguration.region, signPayloads, false), |
157 | Aws::MakeShared<S3ErrorMarshaller>(ALLOCATION_TAG)), |
158 | m_executor(clientConfiguration.executor), m_useVirtualAddressing(useVirtualAddressing), m_USEast1RegionalEndpointOption(USEast1RegionalEndPointOption) |
159 | { |
160 | init(clientConfiguration); |
161 | } |
162 | |
163 | S3Client::~S3Client() |
164 | { |
165 | } |
166 | |
167 | void S3Client::init(const ClientConfiguration& config) |
168 | { |
169 | LoadS3SpecificConfig(config.profileName); |
170 | m_configScheme = SchemeMapper::ToString(config.scheme); |
171 | m_scheme = m_configScheme; |
172 | m_region = config.region; |
173 | m_useDualStack = config.useDualStack; |
174 | if (config.endpointOverride.empty()) |
175 | { |
176 | m_useCustomEndpoint = false; |
177 | m_baseUri = S3Endpoint::ForRegion(config.region, config.useDualStack, m_USEast1RegionalEndpointOption == Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION::REGIONAL); |
178 | } |
179 | else |
180 | { |
181 | m_useCustomEndpoint = true; |
182 | OverrideEndpoint(config.endpointOverride); |
183 | } |
184 | } |
185 | |
186 | void S3Client::OverrideEndpoint(const Aws::String& endpoint) |
187 | { |
188 | if (endpoint.compare(0, 7, "http://" ) == 0) |
189 | { |
190 | m_scheme = "http" ; |
191 | m_baseUri = endpoint.substr(7); |
192 | } |
193 | else if (endpoint.compare(0, 8, "https://" ) == 0) |
194 | { |
195 | m_scheme = "https" ; |
196 | m_baseUri = endpoint.substr(8); |
197 | } |
198 | else |
199 | { |
200 | m_scheme = m_configScheme; |
201 | m_baseUri = endpoint; |
202 | } |
203 | } |
204 | |
205 | AbortMultipartUploadOutcome S3Client::AbortMultipartUpload(const AbortMultipartUploadRequest& request) const |
206 | { |
207 | if (!request.BucketHasBeenSet()) |
208 | { |
209 | AWS_LOGSTREAM_ERROR("AbortMultipartUpload" , "Required field: Bucket, is not set" ); |
210 | return AbortMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
211 | } |
212 | if (!request.KeyHasBeenSet()) |
213 | { |
214 | AWS_LOGSTREAM_ERROR("AbortMultipartUpload" , "Required field: Key, is not set" ); |
215 | return AbortMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
216 | } |
217 | if (!request.UploadIdHasBeenSet()) |
218 | { |
219 | AWS_LOGSTREAM_ERROR("AbortMultipartUpload" , "Required field: UploadId, is not set" ); |
220 | return AbortMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [UploadId]" , false)); |
221 | } |
222 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
223 | if (!computeEndpointOutcome.IsSuccess()) |
224 | { |
225 | return AbortMultipartUploadOutcome(computeEndpointOutcome.GetError()); |
226 | } |
227 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
228 | Aws::StringStream ss; |
229 | ss << "/" ; |
230 | ss << request.GetKey(); |
231 | uri.SetPath(uri.GetPath() + ss.str()); |
232 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
233 | if(outcome.IsSuccess()) |
234 | { |
235 | return AbortMultipartUploadOutcome(AbortMultipartUploadResult(outcome.GetResult())); |
236 | } |
237 | else |
238 | { |
239 | return AbortMultipartUploadOutcome(outcome.GetError()); |
240 | } |
241 | } |
242 | |
243 | AbortMultipartUploadOutcomeCallable S3Client::AbortMultipartUploadCallable(const AbortMultipartUploadRequest& request) const |
244 | { |
245 | auto task = Aws::MakeShared< std::packaged_task< AbortMultipartUploadOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->AbortMultipartUpload(request); } ); |
246 | auto packagedFunction = [task]() { (*task)(); }; |
247 | m_executor->Submit(packagedFunction); |
248 | return task->get_future(); |
249 | } |
250 | |
251 | void S3Client::AbortMultipartUploadAsync(const AbortMultipartUploadRequest& request, const AbortMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
252 | { |
253 | m_executor->Submit( [this, request, handler, context](){ this->AbortMultipartUploadAsyncHelper( request, handler, context ); } ); |
254 | } |
255 | |
256 | void S3Client::AbortMultipartUploadAsyncHelper(const AbortMultipartUploadRequest& request, const AbortMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
257 | { |
258 | handler(this, request, AbortMultipartUpload(request), context); |
259 | } |
260 | |
261 | CompleteMultipartUploadOutcome S3Client::CompleteMultipartUpload(const CompleteMultipartUploadRequest& request) const |
262 | { |
263 | if (!request.BucketHasBeenSet()) |
264 | { |
265 | AWS_LOGSTREAM_ERROR("CompleteMultipartUpload" , "Required field: Bucket, is not set" ); |
266 | return CompleteMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
267 | } |
268 | if (!request.KeyHasBeenSet()) |
269 | { |
270 | AWS_LOGSTREAM_ERROR("CompleteMultipartUpload" , "Required field: Key, is not set" ); |
271 | return CompleteMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
272 | } |
273 | if (!request.UploadIdHasBeenSet()) |
274 | { |
275 | AWS_LOGSTREAM_ERROR("CompleteMultipartUpload" , "Required field: UploadId, is not set" ); |
276 | return CompleteMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [UploadId]" , false)); |
277 | } |
278 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
279 | if (!computeEndpointOutcome.IsSuccess()) |
280 | { |
281 | return CompleteMultipartUploadOutcome(computeEndpointOutcome.GetError()); |
282 | } |
283 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
284 | Aws::StringStream ss; |
285 | ss << "/" ; |
286 | ss << request.GetKey(); |
287 | uri.SetPath(uri.GetPath() + ss.str()); |
288 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
289 | if(outcome.IsSuccess()) |
290 | { |
291 | return CompleteMultipartUploadOutcome(CompleteMultipartUploadResult(outcome.GetResult())); |
292 | } |
293 | else |
294 | { |
295 | return CompleteMultipartUploadOutcome(outcome.GetError()); |
296 | } |
297 | } |
298 | |
299 | CompleteMultipartUploadOutcomeCallable S3Client::CompleteMultipartUploadCallable(const CompleteMultipartUploadRequest& request) const |
300 | { |
301 | auto task = Aws::MakeShared< std::packaged_task< CompleteMultipartUploadOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CompleteMultipartUpload(request); } ); |
302 | auto packagedFunction = [task]() { (*task)(); }; |
303 | m_executor->Submit(packagedFunction); |
304 | return task->get_future(); |
305 | } |
306 | |
307 | void S3Client::CompleteMultipartUploadAsync(const CompleteMultipartUploadRequest& request, const CompleteMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
308 | { |
309 | m_executor->Submit( [this, request, handler, context](){ this->CompleteMultipartUploadAsyncHelper( request, handler, context ); } ); |
310 | } |
311 | |
312 | void S3Client::CompleteMultipartUploadAsyncHelper(const CompleteMultipartUploadRequest& request, const CompleteMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
313 | { |
314 | handler(this, request, CompleteMultipartUpload(request), context); |
315 | } |
316 | |
317 | CopyObjectOutcome S3Client::CopyObject(const CopyObjectRequest& request) const |
318 | { |
319 | if (!request.BucketHasBeenSet()) |
320 | { |
321 | AWS_LOGSTREAM_ERROR("CopyObject" , "Required field: Bucket, is not set" ); |
322 | return CopyObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
323 | } |
324 | if (!request.CopySourceHasBeenSet()) |
325 | { |
326 | AWS_LOGSTREAM_ERROR("CopyObject" , "Required field: CopySource, is not set" ); |
327 | return CopyObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [CopySource]" , false)); |
328 | } |
329 | if (!request.KeyHasBeenSet()) |
330 | { |
331 | AWS_LOGSTREAM_ERROR("CopyObject" , "Required field: Key, is not set" ); |
332 | return CopyObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
333 | } |
334 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
335 | if (!computeEndpointOutcome.IsSuccess()) |
336 | { |
337 | return CopyObjectOutcome(computeEndpointOutcome.GetError()); |
338 | } |
339 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
340 | Aws::StringStream ss; |
341 | ss << "/" ; |
342 | ss << request.GetKey(); |
343 | uri.SetPath(uri.GetPath() + ss.str()); |
344 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
345 | if(outcome.IsSuccess()) |
346 | { |
347 | return CopyObjectOutcome(CopyObjectResult(outcome.GetResult())); |
348 | } |
349 | else |
350 | { |
351 | return CopyObjectOutcome(outcome.GetError()); |
352 | } |
353 | } |
354 | |
355 | CopyObjectOutcomeCallable S3Client::CopyObjectCallable(const CopyObjectRequest& request) const |
356 | { |
357 | auto task = Aws::MakeShared< std::packaged_task< CopyObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CopyObject(request); } ); |
358 | auto packagedFunction = [task]() { (*task)(); }; |
359 | m_executor->Submit(packagedFunction); |
360 | return task->get_future(); |
361 | } |
362 | |
363 | void S3Client::CopyObjectAsync(const CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
364 | { |
365 | m_executor->Submit( [this, request, handler, context](){ this->CopyObjectAsyncHelper( request, handler, context ); } ); |
366 | } |
367 | |
368 | void S3Client::CopyObjectAsyncHelper(const CopyObjectRequest& request, const CopyObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
369 | { |
370 | handler(this, request, CopyObject(request), context); |
371 | } |
372 | |
373 | CreateBucketOutcome S3Client::CreateBucket(const CreateBucketRequest& request) const |
374 | { |
375 | if (!request.BucketHasBeenSet()) |
376 | { |
377 | AWS_LOGSTREAM_ERROR("CreateBucket" , "Required field: Bucket, is not set" ); |
378 | return CreateBucketOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
379 | } |
380 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(); |
381 | if (!computeEndpointOutcome.IsSuccess()) |
382 | { |
383 | return CreateBucketOutcome(computeEndpointOutcome.GetError()); |
384 | } |
385 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
386 | Aws::StringStream ss; |
387 | ss << "/" ; |
388 | ss << request.GetBucket(); |
389 | uri.SetPath(uri.GetPath() + ss.str()); |
390 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
391 | if(outcome.IsSuccess()) |
392 | { |
393 | return CreateBucketOutcome(CreateBucketResult(outcome.GetResult())); |
394 | } |
395 | else |
396 | { |
397 | return CreateBucketOutcome(outcome.GetError()); |
398 | } |
399 | } |
400 | |
401 | CreateBucketOutcomeCallable S3Client::CreateBucketCallable(const CreateBucketRequest& request) const |
402 | { |
403 | auto task = Aws::MakeShared< std::packaged_task< CreateBucketOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateBucket(request); } ); |
404 | auto packagedFunction = [task]() { (*task)(); }; |
405 | m_executor->Submit(packagedFunction); |
406 | return task->get_future(); |
407 | } |
408 | |
409 | void S3Client::CreateBucketAsync(const CreateBucketRequest& request, const CreateBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
410 | { |
411 | m_executor->Submit( [this, request, handler, context](){ this->CreateBucketAsyncHelper( request, handler, context ); } ); |
412 | } |
413 | |
414 | void S3Client::CreateBucketAsyncHelper(const CreateBucketRequest& request, const CreateBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
415 | { |
416 | handler(this, request, CreateBucket(request), context); |
417 | } |
418 | |
419 | CreateMultipartUploadOutcome S3Client::CreateMultipartUpload(const CreateMultipartUploadRequest& request) const |
420 | { |
421 | if (!request.BucketHasBeenSet()) |
422 | { |
423 | AWS_LOGSTREAM_ERROR("CreateMultipartUpload" , "Required field: Bucket, is not set" ); |
424 | return CreateMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
425 | } |
426 | if (!request.KeyHasBeenSet()) |
427 | { |
428 | AWS_LOGSTREAM_ERROR("CreateMultipartUpload" , "Required field: Key, is not set" ); |
429 | return CreateMultipartUploadOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
430 | } |
431 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
432 | if (!computeEndpointOutcome.IsSuccess()) |
433 | { |
434 | return CreateMultipartUploadOutcome(computeEndpointOutcome.GetError()); |
435 | } |
436 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
437 | Aws::StringStream ss; |
438 | ss << "/" ; |
439 | ss << request.GetKey(); |
440 | uri.SetPath(uri.GetPath() + ss.str()); |
441 | ss.str("?uploads" ); |
442 | uri.SetQueryString(ss.str()); |
443 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
444 | if(outcome.IsSuccess()) |
445 | { |
446 | return CreateMultipartUploadOutcome(CreateMultipartUploadResult(outcome.GetResult())); |
447 | } |
448 | else |
449 | { |
450 | return CreateMultipartUploadOutcome(outcome.GetError()); |
451 | } |
452 | } |
453 | |
454 | CreateMultipartUploadOutcomeCallable S3Client::CreateMultipartUploadCallable(const CreateMultipartUploadRequest& request) const |
455 | { |
456 | auto task = Aws::MakeShared< std::packaged_task< CreateMultipartUploadOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateMultipartUpload(request); } ); |
457 | auto packagedFunction = [task]() { (*task)(); }; |
458 | m_executor->Submit(packagedFunction); |
459 | return task->get_future(); |
460 | } |
461 | |
462 | void S3Client::CreateMultipartUploadAsync(const CreateMultipartUploadRequest& request, const CreateMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
463 | { |
464 | m_executor->Submit( [this, request, handler, context](){ this->CreateMultipartUploadAsyncHelper( request, handler, context ); } ); |
465 | } |
466 | |
467 | void S3Client::CreateMultipartUploadAsyncHelper(const CreateMultipartUploadRequest& request, const CreateMultipartUploadResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
468 | { |
469 | handler(this, request, CreateMultipartUpload(request), context); |
470 | } |
471 | |
472 | DeleteBucketOutcome S3Client::DeleteBucket(const DeleteBucketRequest& request) const |
473 | { |
474 | if (!request.BucketHasBeenSet()) |
475 | { |
476 | AWS_LOGSTREAM_ERROR("DeleteBucket" , "Required field: Bucket, is not set" ); |
477 | return DeleteBucketOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
478 | } |
479 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
480 | if (!computeEndpointOutcome.IsSuccess()) |
481 | { |
482 | return DeleteBucketOutcome(computeEndpointOutcome.GetError()); |
483 | } |
484 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
485 | Aws::StringStream ss; |
486 | uri.SetPath(uri.GetPath() + ss.str()); |
487 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
488 | if(outcome.IsSuccess()) |
489 | { |
490 | return DeleteBucketOutcome(NoResult()); |
491 | } |
492 | else |
493 | { |
494 | return DeleteBucketOutcome(outcome.GetError()); |
495 | } |
496 | } |
497 | |
498 | DeleteBucketOutcomeCallable S3Client::DeleteBucketCallable(const DeleteBucketRequest& request) const |
499 | { |
500 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucket(request); } ); |
501 | auto packagedFunction = [task]() { (*task)(); }; |
502 | m_executor->Submit(packagedFunction); |
503 | return task->get_future(); |
504 | } |
505 | |
506 | void S3Client::DeleteBucketAsync(const DeleteBucketRequest& request, const DeleteBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
507 | { |
508 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketAsyncHelper( request, handler, context ); } ); |
509 | } |
510 | |
511 | void S3Client::DeleteBucketAsyncHelper(const DeleteBucketRequest& request, const DeleteBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
512 | { |
513 | handler(this, request, DeleteBucket(request), context); |
514 | } |
515 | |
516 | DeleteBucketAnalyticsConfigurationOutcome S3Client::DeleteBucketAnalyticsConfiguration(const DeleteBucketAnalyticsConfigurationRequest& request) const |
517 | { |
518 | if (!request.BucketHasBeenSet()) |
519 | { |
520 | AWS_LOGSTREAM_ERROR("DeleteBucketAnalyticsConfiguration" , "Required field: Bucket, is not set" ); |
521 | return DeleteBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
522 | } |
523 | if (!request.IdHasBeenSet()) |
524 | { |
525 | AWS_LOGSTREAM_ERROR("DeleteBucketAnalyticsConfiguration" , "Required field: Id, is not set" ); |
526 | return DeleteBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
527 | } |
528 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
529 | if (!computeEndpointOutcome.IsSuccess()) |
530 | { |
531 | return DeleteBucketAnalyticsConfigurationOutcome(computeEndpointOutcome.GetError()); |
532 | } |
533 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
534 | Aws::StringStream ss; |
535 | ss.str("?analytics" ); |
536 | uri.SetQueryString(ss.str()); |
537 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
538 | if(outcome.IsSuccess()) |
539 | { |
540 | return DeleteBucketAnalyticsConfigurationOutcome(NoResult()); |
541 | } |
542 | else |
543 | { |
544 | return DeleteBucketAnalyticsConfigurationOutcome(outcome.GetError()); |
545 | } |
546 | } |
547 | |
548 | DeleteBucketAnalyticsConfigurationOutcomeCallable S3Client::DeleteBucketAnalyticsConfigurationCallable(const DeleteBucketAnalyticsConfigurationRequest& request) const |
549 | { |
550 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketAnalyticsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketAnalyticsConfiguration(request); } ); |
551 | auto packagedFunction = [task]() { (*task)(); }; |
552 | m_executor->Submit(packagedFunction); |
553 | return task->get_future(); |
554 | } |
555 | |
556 | void S3Client::DeleteBucketAnalyticsConfigurationAsync(const DeleteBucketAnalyticsConfigurationRequest& request, const DeleteBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
557 | { |
558 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketAnalyticsConfigurationAsyncHelper( request, handler, context ); } ); |
559 | } |
560 | |
561 | void S3Client::DeleteBucketAnalyticsConfigurationAsyncHelper(const DeleteBucketAnalyticsConfigurationRequest& request, const DeleteBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
562 | { |
563 | handler(this, request, DeleteBucketAnalyticsConfiguration(request), context); |
564 | } |
565 | |
566 | DeleteBucketCorsOutcome S3Client::DeleteBucketCors(const DeleteBucketCorsRequest& request) const |
567 | { |
568 | if (!request.BucketHasBeenSet()) |
569 | { |
570 | AWS_LOGSTREAM_ERROR("DeleteBucketCors" , "Required field: Bucket, is not set" ); |
571 | return DeleteBucketCorsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
572 | } |
573 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
574 | if (!computeEndpointOutcome.IsSuccess()) |
575 | { |
576 | return DeleteBucketCorsOutcome(computeEndpointOutcome.GetError()); |
577 | } |
578 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
579 | Aws::StringStream ss; |
580 | ss.str("?cors" ); |
581 | uri.SetQueryString(ss.str()); |
582 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
583 | if(outcome.IsSuccess()) |
584 | { |
585 | return DeleteBucketCorsOutcome(NoResult()); |
586 | } |
587 | else |
588 | { |
589 | return DeleteBucketCorsOutcome(outcome.GetError()); |
590 | } |
591 | } |
592 | |
593 | DeleteBucketCorsOutcomeCallable S3Client::DeleteBucketCorsCallable(const DeleteBucketCorsRequest& request) const |
594 | { |
595 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketCorsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketCors(request); } ); |
596 | auto packagedFunction = [task]() { (*task)(); }; |
597 | m_executor->Submit(packagedFunction); |
598 | return task->get_future(); |
599 | } |
600 | |
601 | void S3Client::DeleteBucketCorsAsync(const DeleteBucketCorsRequest& request, const DeleteBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
602 | { |
603 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketCorsAsyncHelper( request, handler, context ); } ); |
604 | } |
605 | |
606 | void S3Client::DeleteBucketCorsAsyncHelper(const DeleteBucketCorsRequest& request, const DeleteBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
607 | { |
608 | handler(this, request, DeleteBucketCors(request), context); |
609 | } |
610 | |
611 | DeleteBucketEncryptionOutcome S3Client::DeleteBucketEncryption(const DeleteBucketEncryptionRequest& request) const |
612 | { |
613 | if (!request.BucketHasBeenSet()) |
614 | { |
615 | AWS_LOGSTREAM_ERROR("DeleteBucketEncryption" , "Required field: Bucket, is not set" ); |
616 | return DeleteBucketEncryptionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
617 | } |
618 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
619 | if (!computeEndpointOutcome.IsSuccess()) |
620 | { |
621 | return DeleteBucketEncryptionOutcome(computeEndpointOutcome.GetError()); |
622 | } |
623 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
624 | Aws::StringStream ss; |
625 | ss.str("?encryption" ); |
626 | uri.SetQueryString(ss.str()); |
627 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
628 | if(outcome.IsSuccess()) |
629 | { |
630 | return DeleteBucketEncryptionOutcome(NoResult()); |
631 | } |
632 | else |
633 | { |
634 | return DeleteBucketEncryptionOutcome(outcome.GetError()); |
635 | } |
636 | } |
637 | |
638 | DeleteBucketEncryptionOutcomeCallable S3Client::DeleteBucketEncryptionCallable(const DeleteBucketEncryptionRequest& request) const |
639 | { |
640 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketEncryptionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketEncryption(request); } ); |
641 | auto packagedFunction = [task]() { (*task)(); }; |
642 | m_executor->Submit(packagedFunction); |
643 | return task->get_future(); |
644 | } |
645 | |
646 | void S3Client::DeleteBucketEncryptionAsync(const DeleteBucketEncryptionRequest& request, const DeleteBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
647 | { |
648 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketEncryptionAsyncHelper( request, handler, context ); } ); |
649 | } |
650 | |
651 | void S3Client::DeleteBucketEncryptionAsyncHelper(const DeleteBucketEncryptionRequest& request, const DeleteBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
652 | { |
653 | handler(this, request, DeleteBucketEncryption(request), context); |
654 | } |
655 | |
656 | DeleteBucketInventoryConfigurationOutcome S3Client::DeleteBucketInventoryConfiguration(const DeleteBucketInventoryConfigurationRequest& request) const |
657 | { |
658 | if (!request.BucketHasBeenSet()) |
659 | { |
660 | AWS_LOGSTREAM_ERROR("DeleteBucketInventoryConfiguration" , "Required field: Bucket, is not set" ); |
661 | return DeleteBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
662 | } |
663 | if (!request.IdHasBeenSet()) |
664 | { |
665 | AWS_LOGSTREAM_ERROR("DeleteBucketInventoryConfiguration" , "Required field: Id, is not set" ); |
666 | return DeleteBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
667 | } |
668 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
669 | if (!computeEndpointOutcome.IsSuccess()) |
670 | { |
671 | return DeleteBucketInventoryConfigurationOutcome(computeEndpointOutcome.GetError()); |
672 | } |
673 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
674 | Aws::StringStream ss; |
675 | ss.str("?inventory" ); |
676 | uri.SetQueryString(ss.str()); |
677 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
678 | if(outcome.IsSuccess()) |
679 | { |
680 | return DeleteBucketInventoryConfigurationOutcome(NoResult()); |
681 | } |
682 | else |
683 | { |
684 | return DeleteBucketInventoryConfigurationOutcome(outcome.GetError()); |
685 | } |
686 | } |
687 | |
688 | DeleteBucketInventoryConfigurationOutcomeCallable S3Client::DeleteBucketInventoryConfigurationCallable(const DeleteBucketInventoryConfigurationRequest& request) const |
689 | { |
690 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketInventoryConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketInventoryConfiguration(request); } ); |
691 | auto packagedFunction = [task]() { (*task)(); }; |
692 | m_executor->Submit(packagedFunction); |
693 | return task->get_future(); |
694 | } |
695 | |
696 | void S3Client::DeleteBucketInventoryConfigurationAsync(const DeleteBucketInventoryConfigurationRequest& request, const DeleteBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
697 | { |
698 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketInventoryConfigurationAsyncHelper( request, handler, context ); } ); |
699 | } |
700 | |
701 | void S3Client::DeleteBucketInventoryConfigurationAsyncHelper(const DeleteBucketInventoryConfigurationRequest& request, const DeleteBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
702 | { |
703 | handler(this, request, DeleteBucketInventoryConfiguration(request), context); |
704 | } |
705 | |
706 | DeleteBucketLifecycleOutcome S3Client::DeleteBucketLifecycle(const DeleteBucketLifecycleRequest& request) const |
707 | { |
708 | if (!request.BucketHasBeenSet()) |
709 | { |
710 | AWS_LOGSTREAM_ERROR("DeleteBucketLifecycle" , "Required field: Bucket, is not set" ); |
711 | return DeleteBucketLifecycleOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
712 | } |
713 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
714 | if (!computeEndpointOutcome.IsSuccess()) |
715 | { |
716 | return DeleteBucketLifecycleOutcome(computeEndpointOutcome.GetError()); |
717 | } |
718 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
719 | Aws::StringStream ss; |
720 | ss.str("?lifecycle" ); |
721 | uri.SetQueryString(ss.str()); |
722 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
723 | if(outcome.IsSuccess()) |
724 | { |
725 | return DeleteBucketLifecycleOutcome(NoResult()); |
726 | } |
727 | else |
728 | { |
729 | return DeleteBucketLifecycleOutcome(outcome.GetError()); |
730 | } |
731 | } |
732 | |
733 | DeleteBucketLifecycleOutcomeCallable S3Client::DeleteBucketLifecycleCallable(const DeleteBucketLifecycleRequest& request) const |
734 | { |
735 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketLifecycleOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketLifecycle(request); } ); |
736 | auto packagedFunction = [task]() { (*task)(); }; |
737 | m_executor->Submit(packagedFunction); |
738 | return task->get_future(); |
739 | } |
740 | |
741 | void S3Client::DeleteBucketLifecycleAsync(const DeleteBucketLifecycleRequest& request, const DeleteBucketLifecycleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
742 | { |
743 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketLifecycleAsyncHelper( request, handler, context ); } ); |
744 | } |
745 | |
746 | void S3Client::DeleteBucketLifecycleAsyncHelper(const DeleteBucketLifecycleRequest& request, const DeleteBucketLifecycleResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
747 | { |
748 | handler(this, request, DeleteBucketLifecycle(request), context); |
749 | } |
750 | |
751 | DeleteBucketMetricsConfigurationOutcome S3Client::DeleteBucketMetricsConfiguration(const DeleteBucketMetricsConfigurationRequest& request) const |
752 | { |
753 | if (!request.BucketHasBeenSet()) |
754 | { |
755 | AWS_LOGSTREAM_ERROR("DeleteBucketMetricsConfiguration" , "Required field: Bucket, is not set" ); |
756 | return DeleteBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
757 | } |
758 | if (!request.IdHasBeenSet()) |
759 | { |
760 | AWS_LOGSTREAM_ERROR("DeleteBucketMetricsConfiguration" , "Required field: Id, is not set" ); |
761 | return DeleteBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
762 | } |
763 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
764 | if (!computeEndpointOutcome.IsSuccess()) |
765 | { |
766 | return DeleteBucketMetricsConfigurationOutcome(computeEndpointOutcome.GetError()); |
767 | } |
768 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
769 | Aws::StringStream ss; |
770 | ss.str("?metrics" ); |
771 | uri.SetQueryString(ss.str()); |
772 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
773 | if(outcome.IsSuccess()) |
774 | { |
775 | return DeleteBucketMetricsConfigurationOutcome(NoResult()); |
776 | } |
777 | else |
778 | { |
779 | return DeleteBucketMetricsConfigurationOutcome(outcome.GetError()); |
780 | } |
781 | } |
782 | |
783 | DeleteBucketMetricsConfigurationOutcomeCallable S3Client::DeleteBucketMetricsConfigurationCallable(const DeleteBucketMetricsConfigurationRequest& request) const |
784 | { |
785 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketMetricsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketMetricsConfiguration(request); } ); |
786 | auto packagedFunction = [task]() { (*task)(); }; |
787 | m_executor->Submit(packagedFunction); |
788 | return task->get_future(); |
789 | } |
790 | |
791 | void S3Client::DeleteBucketMetricsConfigurationAsync(const DeleteBucketMetricsConfigurationRequest& request, const DeleteBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
792 | { |
793 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketMetricsConfigurationAsyncHelper( request, handler, context ); } ); |
794 | } |
795 | |
796 | void S3Client::DeleteBucketMetricsConfigurationAsyncHelper(const DeleteBucketMetricsConfigurationRequest& request, const DeleteBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
797 | { |
798 | handler(this, request, DeleteBucketMetricsConfiguration(request), context); |
799 | } |
800 | |
801 | DeleteBucketPolicyOutcome S3Client::DeleteBucketPolicy(const DeleteBucketPolicyRequest& request) const |
802 | { |
803 | if (!request.BucketHasBeenSet()) |
804 | { |
805 | AWS_LOGSTREAM_ERROR("DeleteBucketPolicy" , "Required field: Bucket, is not set" ); |
806 | return DeleteBucketPolicyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
807 | } |
808 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
809 | if (!computeEndpointOutcome.IsSuccess()) |
810 | { |
811 | return DeleteBucketPolicyOutcome(computeEndpointOutcome.GetError()); |
812 | } |
813 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
814 | Aws::StringStream ss; |
815 | ss.str("?policy" ); |
816 | uri.SetQueryString(ss.str()); |
817 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
818 | if(outcome.IsSuccess()) |
819 | { |
820 | return DeleteBucketPolicyOutcome(NoResult()); |
821 | } |
822 | else |
823 | { |
824 | return DeleteBucketPolicyOutcome(outcome.GetError()); |
825 | } |
826 | } |
827 | |
828 | DeleteBucketPolicyOutcomeCallable S3Client::DeleteBucketPolicyCallable(const DeleteBucketPolicyRequest& request) const |
829 | { |
830 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketPolicyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketPolicy(request); } ); |
831 | auto packagedFunction = [task]() { (*task)(); }; |
832 | m_executor->Submit(packagedFunction); |
833 | return task->get_future(); |
834 | } |
835 | |
836 | void S3Client::DeleteBucketPolicyAsync(const DeleteBucketPolicyRequest& request, const DeleteBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
837 | { |
838 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketPolicyAsyncHelper( request, handler, context ); } ); |
839 | } |
840 | |
841 | void S3Client::DeleteBucketPolicyAsyncHelper(const DeleteBucketPolicyRequest& request, const DeleteBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
842 | { |
843 | handler(this, request, DeleteBucketPolicy(request), context); |
844 | } |
845 | |
846 | DeleteBucketReplicationOutcome S3Client::DeleteBucketReplication(const DeleteBucketReplicationRequest& request) const |
847 | { |
848 | if (!request.BucketHasBeenSet()) |
849 | { |
850 | AWS_LOGSTREAM_ERROR("DeleteBucketReplication" , "Required field: Bucket, is not set" ); |
851 | return DeleteBucketReplicationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
852 | } |
853 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
854 | if (!computeEndpointOutcome.IsSuccess()) |
855 | { |
856 | return DeleteBucketReplicationOutcome(computeEndpointOutcome.GetError()); |
857 | } |
858 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
859 | Aws::StringStream ss; |
860 | ss.str("?replication" ); |
861 | uri.SetQueryString(ss.str()); |
862 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
863 | if(outcome.IsSuccess()) |
864 | { |
865 | return DeleteBucketReplicationOutcome(NoResult()); |
866 | } |
867 | else |
868 | { |
869 | return DeleteBucketReplicationOutcome(outcome.GetError()); |
870 | } |
871 | } |
872 | |
873 | DeleteBucketReplicationOutcomeCallable S3Client::DeleteBucketReplicationCallable(const DeleteBucketReplicationRequest& request) const |
874 | { |
875 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketReplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketReplication(request); } ); |
876 | auto packagedFunction = [task]() { (*task)(); }; |
877 | m_executor->Submit(packagedFunction); |
878 | return task->get_future(); |
879 | } |
880 | |
881 | void S3Client::DeleteBucketReplicationAsync(const DeleteBucketReplicationRequest& request, const DeleteBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
882 | { |
883 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketReplicationAsyncHelper( request, handler, context ); } ); |
884 | } |
885 | |
886 | void S3Client::DeleteBucketReplicationAsyncHelper(const DeleteBucketReplicationRequest& request, const DeleteBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
887 | { |
888 | handler(this, request, DeleteBucketReplication(request), context); |
889 | } |
890 | |
891 | DeleteBucketTaggingOutcome S3Client::DeleteBucketTagging(const DeleteBucketTaggingRequest& request) const |
892 | { |
893 | if (!request.BucketHasBeenSet()) |
894 | { |
895 | AWS_LOGSTREAM_ERROR("DeleteBucketTagging" , "Required field: Bucket, is not set" ); |
896 | return DeleteBucketTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
897 | } |
898 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
899 | if (!computeEndpointOutcome.IsSuccess()) |
900 | { |
901 | return DeleteBucketTaggingOutcome(computeEndpointOutcome.GetError()); |
902 | } |
903 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
904 | Aws::StringStream ss; |
905 | ss.str("?tagging" ); |
906 | uri.SetQueryString(ss.str()); |
907 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
908 | if(outcome.IsSuccess()) |
909 | { |
910 | return DeleteBucketTaggingOutcome(NoResult()); |
911 | } |
912 | else |
913 | { |
914 | return DeleteBucketTaggingOutcome(outcome.GetError()); |
915 | } |
916 | } |
917 | |
918 | DeleteBucketTaggingOutcomeCallable S3Client::DeleteBucketTaggingCallable(const DeleteBucketTaggingRequest& request) const |
919 | { |
920 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketTagging(request); } ); |
921 | auto packagedFunction = [task]() { (*task)(); }; |
922 | m_executor->Submit(packagedFunction); |
923 | return task->get_future(); |
924 | } |
925 | |
926 | void S3Client::DeleteBucketTaggingAsync(const DeleteBucketTaggingRequest& request, const DeleteBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
927 | { |
928 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketTaggingAsyncHelper( request, handler, context ); } ); |
929 | } |
930 | |
931 | void S3Client::DeleteBucketTaggingAsyncHelper(const DeleteBucketTaggingRequest& request, const DeleteBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
932 | { |
933 | handler(this, request, DeleteBucketTagging(request), context); |
934 | } |
935 | |
936 | DeleteBucketWebsiteOutcome S3Client::DeleteBucketWebsite(const DeleteBucketWebsiteRequest& request) const |
937 | { |
938 | if (!request.BucketHasBeenSet()) |
939 | { |
940 | AWS_LOGSTREAM_ERROR("DeleteBucketWebsite" , "Required field: Bucket, is not set" ); |
941 | return DeleteBucketWebsiteOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
942 | } |
943 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
944 | if (!computeEndpointOutcome.IsSuccess()) |
945 | { |
946 | return DeleteBucketWebsiteOutcome(computeEndpointOutcome.GetError()); |
947 | } |
948 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
949 | Aws::StringStream ss; |
950 | ss.str("?website" ); |
951 | uri.SetQueryString(ss.str()); |
952 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
953 | if(outcome.IsSuccess()) |
954 | { |
955 | return DeleteBucketWebsiteOutcome(NoResult()); |
956 | } |
957 | else |
958 | { |
959 | return DeleteBucketWebsiteOutcome(outcome.GetError()); |
960 | } |
961 | } |
962 | |
963 | DeleteBucketWebsiteOutcomeCallable S3Client::DeleteBucketWebsiteCallable(const DeleteBucketWebsiteRequest& request) const |
964 | { |
965 | auto task = Aws::MakeShared< std::packaged_task< DeleteBucketWebsiteOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteBucketWebsite(request); } ); |
966 | auto packagedFunction = [task]() { (*task)(); }; |
967 | m_executor->Submit(packagedFunction); |
968 | return task->get_future(); |
969 | } |
970 | |
971 | void S3Client::DeleteBucketWebsiteAsync(const DeleteBucketWebsiteRequest& request, const DeleteBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
972 | { |
973 | m_executor->Submit( [this, request, handler, context](){ this->DeleteBucketWebsiteAsyncHelper( request, handler, context ); } ); |
974 | } |
975 | |
976 | void S3Client::DeleteBucketWebsiteAsyncHelper(const DeleteBucketWebsiteRequest& request, const DeleteBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
977 | { |
978 | handler(this, request, DeleteBucketWebsite(request), context); |
979 | } |
980 | |
981 | DeleteObjectOutcome S3Client::DeleteObject(const DeleteObjectRequest& request) const |
982 | { |
983 | if (!request.BucketHasBeenSet()) |
984 | { |
985 | AWS_LOGSTREAM_ERROR("DeleteObject" , "Required field: Bucket, is not set" ); |
986 | return DeleteObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
987 | } |
988 | if (!request.KeyHasBeenSet()) |
989 | { |
990 | AWS_LOGSTREAM_ERROR("DeleteObject" , "Required field: Key, is not set" ); |
991 | return DeleteObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
992 | } |
993 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
994 | if (!computeEndpointOutcome.IsSuccess()) |
995 | { |
996 | return DeleteObjectOutcome(computeEndpointOutcome.GetError()); |
997 | } |
998 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
999 | Aws::StringStream ss; |
1000 | ss << "/" ; |
1001 | ss << request.GetKey(); |
1002 | uri.SetPath(uri.GetPath() + ss.str()); |
1003 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1004 | if(outcome.IsSuccess()) |
1005 | { |
1006 | return DeleteObjectOutcome(DeleteObjectResult(outcome.GetResult())); |
1007 | } |
1008 | else |
1009 | { |
1010 | return DeleteObjectOutcome(outcome.GetError()); |
1011 | } |
1012 | } |
1013 | |
1014 | DeleteObjectOutcomeCallable S3Client::DeleteObjectCallable(const DeleteObjectRequest& request) const |
1015 | { |
1016 | auto task = Aws::MakeShared< std::packaged_task< DeleteObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteObject(request); } ); |
1017 | auto packagedFunction = [task]() { (*task)(); }; |
1018 | m_executor->Submit(packagedFunction); |
1019 | return task->get_future(); |
1020 | } |
1021 | |
1022 | void S3Client::DeleteObjectAsync(const DeleteObjectRequest& request, const DeleteObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1023 | { |
1024 | m_executor->Submit( [this, request, handler, context](){ this->DeleteObjectAsyncHelper( request, handler, context ); } ); |
1025 | } |
1026 | |
1027 | void S3Client::DeleteObjectAsyncHelper(const DeleteObjectRequest& request, const DeleteObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1028 | { |
1029 | handler(this, request, DeleteObject(request), context); |
1030 | } |
1031 | |
1032 | DeleteObjectTaggingOutcome S3Client::DeleteObjectTagging(const DeleteObjectTaggingRequest& request) const |
1033 | { |
1034 | if (!request.BucketHasBeenSet()) |
1035 | { |
1036 | AWS_LOGSTREAM_ERROR("DeleteObjectTagging" , "Required field: Bucket, is not set" ); |
1037 | return DeleteObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1038 | } |
1039 | if (!request.KeyHasBeenSet()) |
1040 | { |
1041 | AWS_LOGSTREAM_ERROR("DeleteObjectTagging" , "Required field: Key, is not set" ); |
1042 | return DeleteObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
1043 | } |
1044 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1045 | if (!computeEndpointOutcome.IsSuccess()) |
1046 | { |
1047 | return DeleteObjectTaggingOutcome(computeEndpointOutcome.GetError()); |
1048 | } |
1049 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1050 | Aws::StringStream ss; |
1051 | ss << "/" ; |
1052 | ss << request.GetKey(); |
1053 | uri.SetPath(uri.GetPath() + ss.str()); |
1054 | ss.str("?tagging" ); |
1055 | uri.SetQueryString(ss.str()); |
1056 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1057 | if(outcome.IsSuccess()) |
1058 | { |
1059 | return DeleteObjectTaggingOutcome(DeleteObjectTaggingResult(outcome.GetResult())); |
1060 | } |
1061 | else |
1062 | { |
1063 | return DeleteObjectTaggingOutcome(outcome.GetError()); |
1064 | } |
1065 | } |
1066 | |
1067 | DeleteObjectTaggingOutcomeCallable S3Client::DeleteObjectTaggingCallable(const DeleteObjectTaggingRequest& request) const |
1068 | { |
1069 | auto task = Aws::MakeShared< std::packaged_task< DeleteObjectTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteObjectTagging(request); } ); |
1070 | auto packagedFunction = [task]() { (*task)(); }; |
1071 | m_executor->Submit(packagedFunction); |
1072 | return task->get_future(); |
1073 | } |
1074 | |
1075 | void S3Client::DeleteObjectTaggingAsync(const DeleteObjectTaggingRequest& request, const DeleteObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1076 | { |
1077 | m_executor->Submit( [this, request, handler, context](){ this->DeleteObjectTaggingAsyncHelper( request, handler, context ); } ); |
1078 | } |
1079 | |
1080 | void S3Client::DeleteObjectTaggingAsyncHelper(const DeleteObjectTaggingRequest& request, const DeleteObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1081 | { |
1082 | handler(this, request, DeleteObjectTagging(request), context); |
1083 | } |
1084 | |
1085 | DeleteObjectsOutcome S3Client::DeleteObjects(const DeleteObjectsRequest& request) const |
1086 | { |
1087 | if (!request.BucketHasBeenSet()) |
1088 | { |
1089 | AWS_LOGSTREAM_ERROR("DeleteObjects" , "Required field: Bucket, is not set" ); |
1090 | return DeleteObjectsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1091 | } |
1092 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1093 | if (!computeEndpointOutcome.IsSuccess()) |
1094 | { |
1095 | return DeleteObjectsOutcome(computeEndpointOutcome.GetError()); |
1096 | } |
1097 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1098 | Aws::StringStream ss; |
1099 | ss.str("?delete" ); |
1100 | uri.SetQueryString(ss.str()); |
1101 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1102 | if(outcome.IsSuccess()) |
1103 | { |
1104 | return DeleteObjectsOutcome(DeleteObjectsResult(outcome.GetResult())); |
1105 | } |
1106 | else |
1107 | { |
1108 | return DeleteObjectsOutcome(outcome.GetError()); |
1109 | } |
1110 | } |
1111 | |
1112 | DeleteObjectsOutcomeCallable S3Client::DeleteObjectsCallable(const DeleteObjectsRequest& request) const |
1113 | { |
1114 | auto task = Aws::MakeShared< std::packaged_task< DeleteObjectsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteObjects(request); } ); |
1115 | auto packagedFunction = [task]() { (*task)(); }; |
1116 | m_executor->Submit(packagedFunction); |
1117 | return task->get_future(); |
1118 | } |
1119 | |
1120 | void S3Client::DeleteObjectsAsync(const DeleteObjectsRequest& request, const DeleteObjectsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1121 | { |
1122 | m_executor->Submit( [this, request, handler, context](){ this->DeleteObjectsAsyncHelper( request, handler, context ); } ); |
1123 | } |
1124 | |
1125 | void S3Client::DeleteObjectsAsyncHelper(const DeleteObjectsRequest& request, const DeleteObjectsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1126 | { |
1127 | handler(this, request, DeleteObjects(request), context); |
1128 | } |
1129 | |
1130 | DeletePublicAccessBlockOutcome S3Client::DeletePublicAccessBlock(const DeletePublicAccessBlockRequest& request) const |
1131 | { |
1132 | if (!request.BucketHasBeenSet()) |
1133 | { |
1134 | AWS_LOGSTREAM_ERROR("DeletePublicAccessBlock" , "Required field: Bucket, is not set" ); |
1135 | return DeletePublicAccessBlockOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1136 | } |
1137 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1138 | if (!computeEndpointOutcome.IsSuccess()) |
1139 | { |
1140 | return DeletePublicAccessBlockOutcome(computeEndpointOutcome.GetError()); |
1141 | } |
1142 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1143 | Aws::StringStream ss; |
1144 | ss.str("?publicAccessBlock" ); |
1145 | uri.SetQueryString(ss.str()); |
1146 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1147 | if(outcome.IsSuccess()) |
1148 | { |
1149 | return DeletePublicAccessBlockOutcome(NoResult()); |
1150 | } |
1151 | else |
1152 | { |
1153 | return DeletePublicAccessBlockOutcome(outcome.GetError()); |
1154 | } |
1155 | } |
1156 | |
1157 | DeletePublicAccessBlockOutcomeCallable S3Client::DeletePublicAccessBlockCallable(const DeletePublicAccessBlockRequest& request) const |
1158 | { |
1159 | auto task = Aws::MakeShared< std::packaged_task< DeletePublicAccessBlockOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeletePublicAccessBlock(request); } ); |
1160 | auto packagedFunction = [task]() { (*task)(); }; |
1161 | m_executor->Submit(packagedFunction); |
1162 | return task->get_future(); |
1163 | } |
1164 | |
1165 | void S3Client::DeletePublicAccessBlockAsync(const DeletePublicAccessBlockRequest& request, const DeletePublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1166 | { |
1167 | m_executor->Submit( [this, request, handler, context](){ this->DeletePublicAccessBlockAsyncHelper( request, handler, context ); } ); |
1168 | } |
1169 | |
1170 | void S3Client::DeletePublicAccessBlockAsyncHelper(const DeletePublicAccessBlockRequest& request, const DeletePublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1171 | { |
1172 | handler(this, request, DeletePublicAccessBlock(request), context); |
1173 | } |
1174 | |
1175 | GetBucketAccelerateConfigurationOutcome S3Client::GetBucketAccelerateConfiguration(const GetBucketAccelerateConfigurationRequest& request) const |
1176 | { |
1177 | if (!request.BucketHasBeenSet()) |
1178 | { |
1179 | AWS_LOGSTREAM_ERROR("GetBucketAccelerateConfiguration" , "Required field: Bucket, is not set" ); |
1180 | return GetBucketAccelerateConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1181 | } |
1182 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1183 | if (!computeEndpointOutcome.IsSuccess()) |
1184 | { |
1185 | return GetBucketAccelerateConfigurationOutcome(computeEndpointOutcome.GetError()); |
1186 | } |
1187 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1188 | Aws::StringStream ss; |
1189 | ss.str("?accelerate" ); |
1190 | uri.SetQueryString(ss.str()); |
1191 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1192 | if(outcome.IsSuccess()) |
1193 | { |
1194 | return GetBucketAccelerateConfigurationOutcome(GetBucketAccelerateConfigurationResult(outcome.GetResult())); |
1195 | } |
1196 | else |
1197 | { |
1198 | return GetBucketAccelerateConfigurationOutcome(outcome.GetError()); |
1199 | } |
1200 | } |
1201 | |
1202 | GetBucketAccelerateConfigurationOutcomeCallable S3Client::GetBucketAccelerateConfigurationCallable(const GetBucketAccelerateConfigurationRequest& request) const |
1203 | { |
1204 | auto task = Aws::MakeShared< std::packaged_task< GetBucketAccelerateConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketAccelerateConfiguration(request); } ); |
1205 | auto packagedFunction = [task]() { (*task)(); }; |
1206 | m_executor->Submit(packagedFunction); |
1207 | return task->get_future(); |
1208 | } |
1209 | |
1210 | void S3Client::GetBucketAccelerateConfigurationAsync(const GetBucketAccelerateConfigurationRequest& request, const GetBucketAccelerateConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1211 | { |
1212 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketAccelerateConfigurationAsyncHelper( request, handler, context ); } ); |
1213 | } |
1214 | |
1215 | void S3Client::GetBucketAccelerateConfigurationAsyncHelper(const GetBucketAccelerateConfigurationRequest& request, const GetBucketAccelerateConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1216 | { |
1217 | handler(this, request, GetBucketAccelerateConfiguration(request), context); |
1218 | } |
1219 | |
1220 | GetBucketAclOutcome S3Client::GetBucketAcl(const GetBucketAclRequest& request) const |
1221 | { |
1222 | if (!request.BucketHasBeenSet()) |
1223 | { |
1224 | AWS_LOGSTREAM_ERROR("GetBucketAcl" , "Required field: Bucket, is not set" ); |
1225 | return GetBucketAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1226 | } |
1227 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1228 | if (!computeEndpointOutcome.IsSuccess()) |
1229 | { |
1230 | return GetBucketAclOutcome(computeEndpointOutcome.GetError()); |
1231 | } |
1232 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1233 | Aws::StringStream ss; |
1234 | ss.str("?acl" ); |
1235 | uri.SetQueryString(ss.str()); |
1236 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1237 | if(outcome.IsSuccess()) |
1238 | { |
1239 | return GetBucketAclOutcome(GetBucketAclResult(outcome.GetResult())); |
1240 | } |
1241 | else |
1242 | { |
1243 | return GetBucketAclOutcome(outcome.GetError()); |
1244 | } |
1245 | } |
1246 | |
1247 | GetBucketAclOutcomeCallable S3Client::GetBucketAclCallable(const GetBucketAclRequest& request) const |
1248 | { |
1249 | auto task = Aws::MakeShared< std::packaged_task< GetBucketAclOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketAcl(request); } ); |
1250 | auto packagedFunction = [task]() { (*task)(); }; |
1251 | m_executor->Submit(packagedFunction); |
1252 | return task->get_future(); |
1253 | } |
1254 | |
1255 | void S3Client::GetBucketAclAsync(const GetBucketAclRequest& request, const GetBucketAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1256 | { |
1257 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketAclAsyncHelper( request, handler, context ); } ); |
1258 | } |
1259 | |
1260 | void S3Client::GetBucketAclAsyncHelper(const GetBucketAclRequest& request, const GetBucketAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1261 | { |
1262 | handler(this, request, GetBucketAcl(request), context); |
1263 | } |
1264 | |
1265 | GetBucketAnalyticsConfigurationOutcome S3Client::GetBucketAnalyticsConfiguration(const GetBucketAnalyticsConfigurationRequest& request) const |
1266 | { |
1267 | if (!request.BucketHasBeenSet()) |
1268 | { |
1269 | AWS_LOGSTREAM_ERROR("GetBucketAnalyticsConfiguration" , "Required field: Bucket, is not set" ); |
1270 | return GetBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1271 | } |
1272 | if (!request.IdHasBeenSet()) |
1273 | { |
1274 | AWS_LOGSTREAM_ERROR("GetBucketAnalyticsConfiguration" , "Required field: Id, is not set" ); |
1275 | return GetBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
1276 | } |
1277 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1278 | if (!computeEndpointOutcome.IsSuccess()) |
1279 | { |
1280 | return GetBucketAnalyticsConfigurationOutcome(computeEndpointOutcome.GetError()); |
1281 | } |
1282 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1283 | Aws::StringStream ss; |
1284 | ss.str("?analytics" ); |
1285 | uri.SetQueryString(ss.str()); |
1286 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1287 | if(outcome.IsSuccess()) |
1288 | { |
1289 | return GetBucketAnalyticsConfigurationOutcome(GetBucketAnalyticsConfigurationResult(outcome.GetResult())); |
1290 | } |
1291 | else |
1292 | { |
1293 | return GetBucketAnalyticsConfigurationOutcome(outcome.GetError()); |
1294 | } |
1295 | } |
1296 | |
1297 | GetBucketAnalyticsConfigurationOutcomeCallable S3Client::GetBucketAnalyticsConfigurationCallable(const GetBucketAnalyticsConfigurationRequest& request) const |
1298 | { |
1299 | auto task = Aws::MakeShared< std::packaged_task< GetBucketAnalyticsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketAnalyticsConfiguration(request); } ); |
1300 | auto packagedFunction = [task]() { (*task)(); }; |
1301 | m_executor->Submit(packagedFunction); |
1302 | return task->get_future(); |
1303 | } |
1304 | |
1305 | void S3Client::GetBucketAnalyticsConfigurationAsync(const GetBucketAnalyticsConfigurationRequest& request, const GetBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1306 | { |
1307 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketAnalyticsConfigurationAsyncHelper( request, handler, context ); } ); |
1308 | } |
1309 | |
1310 | void S3Client::GetBucketAnalyticsConfigurationAsyncHelper(const GetBucketAnalyticsConfigurationRequest& request, const GetBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1311 | { |
1312 | handler(this, request, GetBucketAnalyticsConfiguration(request), context); |
1313 | } |
1314 | |
1315 | GetBucketCorsOutcome S3Client::GetBucketCors(const GetBucketCorsRequest& request) const |
1316 | { |
1317 | if (!request.BucketHasBeenSet()) |
1318 | { |
1319 | AWS_LOGSTREAM_ERROR("GetBucketCors" , "Required field: Bucket, is not set" ); |
1320 | return GetBucketCorsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1321 | } |
1322 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1323 | if (!computeEndpointOutcome.IsSuccess()) |
1324 | { |
1325 | return GetBucketCorsOutcome(computeEndpointOutcome.GetError()); |
1326 | } |
1327 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1328 | Aws::StringStream ss; |
1329 | ss.str("?cors" ); |
1330 | uri.SetQueryString(ss.str()); |
1331 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1332 | if(outcome.IsSuccess()) |
1333 | { |
1334 | return GetBucketCorsOutcome(GetBucketCorsResult(outcome.GetResult())); |
1335 | } |
1336 | else |
1337 | { |
1338 | return GetBucketCorsOutcome(outcome.GetError()); |
1339 | } |
1340 | } |
1341 | |
1342 | GetBucketCorsOutcomeCallable S3Client::GetBucketCorsCallable(const GetBucketCorsRequest& request) const |
1343 | { |
1344 | auto task = Aws::MakeShared< std::packaged_task< GetBucketCorsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketCors(request); } ); |
1345 | auto packagedFunction = [task]() { (*task)(); }; |
1346 | m_executor->Submit(packagedFunction); |
1347 | return task->get_future(); |
1348 | } |
1349 | |
1350 | void S3Client::GetBucketCorsAsync(const GetBucketCorsRequest& request, const GetBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1351 | { |
1352 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketCorsAsyncHelper( request, handler, context ); } ); |
1353 | } |
1354 | |
1355 | void S3Client::GetBucketCorsAsyncHelper(const GetBucketCorsRequest& request, const GetBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1356 | { |
1357 | handler(this, request, GetBucketCors(request), context); |
1358 | } |
1359 | |
1360 | GetBucketEncryptionOutcome S3Client::GetBucketEncryption(const GetBucketEncryptionRequest& request) const |
1361 | { |
1362 | if (!request.BucketHasBeenSet()) |
1363 | { |
1364 | AWS_LOGSTREAM_ERROR("GetBucketEncryption" , "Required field: Bucket, is not set" ); |
1365 | return GetBucketEncryptionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1366 | } |
1367 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1368 | if (!computeEndpointOutcome.IsSuccess()) |
1369 | { |
1370 | return GetBucketEncryptionOutcome(computeEndpointOutcome.GetError()); |
1371 | } |
1372 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1373 | Aws::StringStream ss; |
1374 | ss.str("?encryption" ); |
1375 | uri.SetQueryString(ss.str()); |
1376 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1377 | if(outcome.IsSuccess()) |
1378 | { |
1379 | return GetBucketEncryptionOutcome(GetBucketEncryptionResult(outcome.GetResult())); |
1380 | } |
1381 | else |
1382 | { |
1383 | return GetBucketEncryptionOutcome(outcome.GetError()); |
1384 | } |
1385 | } |
1386 | |
1387 | GetBucketEncryptionOutcomeCallable S3Client::GetBucketEncryptionCallable(const GetBucketEncryptionRequest& request) const |
1388 | { |
1389 | auto task = Aws::MakeShared< std::packaged_task< GetBucketEncryptionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketEncryption(request); } ); |
1390 | auto packagedFunction = [task]() { (*task)(); }; |
1391 | m_executor->Submit(packagedFunction); |
1392 | return task->get_future(); |
1393 | } |
1394 | |
1395 | void S3Client::GetBucketEncryptionAsync(const GetBucketEncryptionRequest& request, const GetBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1396 | { |
1397 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketEncryptionAsyncHelper( request, handler, context ); } ); |
1398 | } |
1399 | |
1400 | void S3Client::GetBucketEncryptionAsyncHelper(const GetBucketEncryptionRequest& request, const GetBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1401 | { |
1402 | handler(this, request, GetBucketEncryption(request), context); |
1403 | } |
1404 | |
1405 | GetBucketInventoryConfigurationOutcome S3Client::GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const |
1406 | { |
1407 | if (!request.BucketHasBeenSet()) |
1408 | { |
1409 | AWS_LOGSTREAM_ERROR("GetBucketInventoryConfiguration" , "Required field: Bucket, is not set" ); |
1410 | return GetBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1411 | } |
1412 | if (!request.IdHasBeenSet()) |
1413 | { |
1414 | AWS_LOGSTREAM_ERROR("GetBucketInventoryConfiguration" , "Required field: Id, is not set" ); |
1415 | return GetBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
1416 | } |
1417 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1418 | if (!computeEndpointOutcome.IsSuccess()) |
1419 | { |
1420 | return GetBucketInventoryConfigurationOutcome(computeEndpointOutcome.GetError()); |
1421 | } |
1422 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1423 | Aws::StringStream ss; |
1424 | ss.str("?inventory" ); |
1425 | uri.SetQueryString(ss.str()); |
1426 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1427 | if(outcome.IsSuccess()) |
1428 | { |
1429 | return GetBucketInventoryConfigurationOutcome(GetBucketInventoryConfigurationResult(outcome.GetResult())); |
1430 | } |
1431 | else |
1432 | { |
1433 | return GetBucketInventoryConfigurationOutcome(outcome.GetError()); |
1434 | } |
1435 | } |
1436 | |
1437 | GetBucketInventoryConfigurationOutcomeCallable S3Client::GetBucketInventoryConfigurationCallable(const GetBucketInventoryConfigurationRequest& request) const |
1438 | { |
1439 | auto task = Aws::MakeShared< std::packaged_task< GetBucketInventoryConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketInventoryConfiguration(request); } ); |
1440 | auto packagedFunction = [task]() { (*task)(); }; |
1441 | m_executor->Submit(packagedFunction); |
1442 | return task->get_future(); |
1443 | } |
1444 | |
1445 | void S3Client::GetBucketInventoryConfigurationAsync(const GetBucketInventoryConfigurationRequest& request, const GetBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1446 | { |
1447 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketInventoryConfigurationAsyncHelper( request, handler, context ); } ); |
1448 | } |
1449 | |
1450 | void S3Client::GetBucketInventoryConfigurationAsyncHelper(const GetBucketInventoryConfigurationRequest& request, const GetBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1451 | { |
1452 | handler(this, request, GetBucketInventoryConfiguration(request), context); |
1453 | } |
1454 | |
1455 | GetBucketLifecycleConfigurationOutcome S3Client::GetBucketLifecycleConfiguration(const GetBucketLifecycleConfigurationRequest& request) const |
1456 | { |
1457 | if (!request.BucketHasBeenSet()) |
1458 | { |
1459 | AWS_LOGSTREAM_ERROR("GetBucketLifecycleConfiguration" , "Required field: Bucket, is not set" ); |
1460 | return GetBucketLifecycleConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1461 | } |
1462 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1463 | if (!computeEndpointOutcome.IsSuccess()) |
1464 | { |
1465 | return GetBucketLifecycleConfigurationOutcome(computeEndpointOutcome.GetError()); |
1466 | } |
1467 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1468 | Aws::StringStream ss; |
1469 | ss.str("?lifecycle" ); |
1470 | uri.SetQueryString(ss.str()); |
1471 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1472 | if(outcome.IsSuccess()) |
1473 | { |
1474 | return GetBucketLifecycleConfigurationOutcome(GetBucketLifecycleConfigurationResult(outcome.GetResult())); |
1475 | } |
1476 | else |
1477 | { |
1478 | return GetBucketLifecycleConfigurationOutcome(outcome.GetError()); |
1479 | } |
1480 | } |
1481 | |
1482 | GetBucketLifecycleConfigurationOutcomeCallable S3Client::GetBucketLifecycleConfigurationCallable(const GetBucketLifecycleConfigurationRequest& request) const |
1483 | { |
1484 | auto task = Aws::MakeShared< std::packaged_task< GetBucketLifecycleConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketLifecycleConfiguration(request); } ); |
1485 | auto packagedFunction = [task]() { (*task)(); }; |
1486 | m_executor->Submit(packagedFunction); |
1487 | return task->get_future(); |
1488 | } |
1489 | |
1490 | void S3Client::GetBucketLifecycleConfigurationAsync(const GetBucketLifecycleConfigurationRequest& request, const GetBucketLifecycleConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1491 | { |
1492 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketLifecycleConfigurationAsyncHelper( request, handler, context ); } ); |
1493 | } |
1494 | |
1495 | void S3Client::GetBucketLifecycleConfigurationAsyncHelper(const GetBucketLifecycleConfigurationRequest& request, const GetBucketLifecycleConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1496 | { |
1497 | handler(this, request, GetBucketLifecycleConfiguration(request), context); |
1498 | } |
1499 | |
1500 | GetBucketLocationOutcome S3Client::GetBucketLocation(const GetBucketLocationRequest& request) const |
1501 | { |
1502 | if (!request.BucketHasBeenSet()) |
1503 | { |
1504 | AWS_LOGSTREAM_ERROR("GetBucketLocation" , "Required field: Bucket, is not set" ); |
1505 | return GetBucketLocationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1506 | } |
1507 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1508 | if (!computeEndpointOutcome.IsSuccess()) |
1509 | { |
1510 | return GetBucketLocationOutcome(computeEndpointOutcome.GetError()); |
1511 | } |
1512 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1513 | Aws::StringStream ss; |
1514 | ss.str("?location" ); |
1515 | uri.SetQueryString(ss.str()); |
1516 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1517 | if(outcome.IsSuccess()) |
1518 | { |
1519 | return GetBucketLocationOutcome(GetBucketLocationResult(outcome.GetResult())); |
1520 | } |
1521 | else |
1522 | { |
1523 | return GetBucketLocationOutcome(outcome.GetError()); |
1524 | } |
1525 | } |
1526 | |
1527 | GetBucketLocationOutcomeCallable S3Client::GetBucketLocationCallable(const GetBucketLocationRequest& request) const |
1528 | { |
1529 | auto task = Aws::MakeShared< std::packaged_task< GetBucketLocationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketLocation(request); } ); |
1530 | auto packagedFunction = [task]() { (*task)(); }; |
1531 | m_executor->Submit(packagedFunction); |
1532 | return task->get_future(); |
1533 | } |
1534 | |
1535 | void S3Client::GetBucketLocationAsync(const GetBucketLocationRequest& request, const GetBucketLocationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1536 | { |
1537 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketLocationAsyncHelper( request, handler, context ); } ); |
1538 | } |
1539 | |
1540 | void S3Client::GetBucketLocationAsyncHelper(const GetBucketLocationRequest& request, const GetBucketLocationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1541 | { |
1542 | handler(this, request, GetBucketLocation(request), context); |
1543 | } |
1544 | |
1545 | GetBucketLoggingOutcome S3Client::GetBucketLogging(const GetBucketLoggingRequest& request) const |
1546 | { |
1547 | if (!request.BucketHasBeenSet()) |
1548 | { |
1549 | AWS_LOGSTREAM_ERROR("GetBucketLogging" , "Required field: Bucket, is not set" ); |
1550 | return GetBucketLoggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1551 | } |
1552 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1553 | if (!computeEndpointOutcome.IsSuccess()) |
1554 | { |
1555 | return GetBucketLoggingOutcome(computeEndpointOutcome.GetError()); |
1556 | } |
1557 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1558 | Aws::StringStream ss; |
1559 | ss.str("?logging" ); |
1560 | uri.SetQueryString(ss.str()); |
1561 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1562 | if(outcome.IsSuccess()) |
1563 | { |
1564 | return GetBucketLoggingOutcome(GetBucketLoggingResult(outcome.GetResult())); |
1565 | } |
1566 | else |
1567 | { |
1568 | return GetBucketLoggingOutcome(outcome.GetError()); |
1569 | } |
1570 | } |
1571 | |
1572 | GetBucketLoggingOutcomeCallable S3Client::GetBucketLoggingCallable(const GetBucketLoggingRequest& request) const |
1573 | { |
1574 | auto task = Aws::MakeShared< std::packaged_task< GetBucketLoggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketLogging(request); } ); |
1575 | auto packagedFunction = [task]() { (*task)(); }; |
1576 | m_executor->Submit(packagedFunction); |
1577 | return task->get_future(); |
1578 | } |
1579 | |
1580 | void S3Client::GetBucketLoggingAsync(const GetBucketLoggingRequest& request, const GetBucketLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1581 | { |
1582 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketLoggingAsyncHelper( request, handler, context ); } ); |
1583 | } |
1584 | |
1585 | void S3Client::GetBucketLoggingAsyncHelper(const GetBucketLoggingRequest& request, const GetBucketLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1586 | { |
1587 | handler(this, request, GetBucketLogging(request), context); |
1588 | } |
1589 | |
1590 | GetBucketMetricsConfigurationOutcome S3Client::GetBucketMetricsConfiguration(const GetBucketMetricsConfigurationRequest& request) const |
1591 | { |
1592 | if (!request.BucketHasBeenSet()) |
1593 | { |
1594 | AWS_LOGSTREAM_ERROR("GetBucketMetricsConfiguration" , "Required field: Bucket, is not set" ); |
1595 | return GetBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1596 | } |
1597 | if (!request.IdHasBeenSet()) |
1598 | { |
1599 | AWS_LOGSTREAM_ERROR("GetBucketMetricsConfiguration" , "Required field: Id, is not set" ); |
1600 | return GetBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
1601 | } |
1602 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1603 | if (!computeEndpointOutcome.IsSuccess()) |
1604 | { |
1605 | return GetBucketMetricsConfigurationOutcome(computeEndpointOutcome.GetError()); |
1606 | } |
1607 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1608 | Aws::StringStream ss; |
1609 | ss.str("?metrics" ); |
1610 | uri.SetQueryString(ss.str()); |
1611 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1612 | if(outcome.IsSuccess()) |
1613 | { |
1614 | return GetBucketMetricsConfigurationOutcome(GetBucketMetricsConfigurationResult(outcome.GetResult())); |
1615 | } |
1616 | else |
1617 | { |
1618 | return GetBucketMetricsConfigurationOutcome(outcome.GetError()); |
1619 | } |
1620 | } |
1621 | |
1622 | GetBucketMetricsConfigurationOutcomeCallable S3Client::GetBucketMetricsConfigurationCallable(const GetBucketMetricsConfigurationRequest& request) const |
1623 | { |
1624 | auto task = Aws::MakeShared< std::packaged_task< GetBucketMetricsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketMetricsConfiguration(request); } ); |
1625 | auto packagedFunction = [task]() { (*task)(); }; |
1626 | m_executor->Submit(packagedFunction); |
1627 | return task->get_future(); |
1628 | } |
1629 | |
1630 | void S3Client::GetBucketMetricsConfigurationAsync(const GetBucketMetricsConfigurationRequest& request, const GetBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1631 | { |
1632 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketMetricsConfigurationAsyncHelper( request, handler, context ); } ); |
1633 | } |
1634 | |
1635 | void S3Client::GetBucketMetricsConfigurationAsyncHelper(const GetBucketMetricsConfigurationRequest& request, const GetBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1636 | { |
1637 | handler(this, request, GetBucketMetricsConfiguration(request), context); |
1638 | } |
1639 | |
1640 | GetBucketNotificationConfigurationOutcome S3Client::GetBucketNotificationConfiguration(const GetBucketNotificationConfigurationRequest& request) const |
1641 | { |
1642 | if (!request.BucketHasBeenSet()) |
1643 | { |
1644 | AWS_LOGSTREAM_ERROR("GetBucketNotificationConfiguration" , "Required field: Bucket, is not set" ); |
1645 | return GetBucketNotificationConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1646 | } |
1647 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1648 | if (!computeEndpointOutcome.IsSuccess()) |
1649 | { |
1650 | return GetBucketNotificationConfigurationOutcome(computeEndpointOutcome.GetError()); |
1651 | } |
1652 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1653 | Aws::StringStream ss; |
1654 | ss.str("?notification" ); |
1655 | uri.SetQueryString(ss.str()); |
1656 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1657 | if(outcome.IsSuccess()) |
1658 | { |
1659 | return GetBucketNotificationConfigurationOutcome(GetBucketNotificationConfigurationResult(outcome.GetResult())); |
1660 | } |
1661 | else |
1662 | { |
1663 | return GetBucketNotificationConfigurationOutcome(outcome.GetError()); |
1664 | } |
1665 | } |
1666 | |
1667 | GetBucketNotificationConfigurationOutcomeCallable S3Client::GetBucketNotificationConfigurationCallable(const GetBucketNotificationConfigurationRequest& request) const |
1668 | { |
1669 | auto task = Aws::MakeShared< std::packaged_task< GetBucketNotificationConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketNotificationConfiguration(request); } ); |
1670 | auto packagedFunction = [task]() { (*task)(); }; |
1671 | m_executor->Submit(packagedFunction); |
1672 | return task->get_future(); |
1673 | } |
1674 | |
1675 | void S3Client::GetBucketNotificationConfigurationAsync(const GetBucketNotificationConfigurationRequest& request, const GetBucketNotificationConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1676 | { |
1677 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketNotificationConfigurationAsyncHelper( request, handler, context ); } ); |
1678 | } |
1679 | |
1680 | void S3Client::GetBucketNotificationConfigurationAsyncHelper(const GetBucketNotificationConfigurationRequest& request, const GetBucketNotificationConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1681 | { |
1682 | handler(this, request, GetBucketNotificationConfiguration(request), context); |
1683 | } |
1684 | |
1685 | GetBucketPolicyOutcome S3Client::GetBucketPolicy(const GetBucketPolicyRequest& request) const |
1686 | { |
1687 | if (!request.BucketHasBeenSet()) |
1688 | { |
1689 | AWS_LOGSTREAM_ERROR("GetBucketPolicy" , "Required field: Bucket, is not set" ); |
1690 | return GetBucketPolicyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1691 | } |
1692 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1693 | if (!computeEndpointOutcome.IsSuccess()) |
1694 | { |
1695 | return GetBucketPolicyOutcome(computeEndpointOutcome.GetError()); |
1696 | } |
1697 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1698 | Aws::StringStream ss; |
1699 | ss.str("?policy" ); |
1700 | uri.SetQueryString(ss.str()); |
1701 | StreamOutcome outcome = MakeRequestWithUnparsedResponse(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1702 | if(outcome.IsSuccess()) |
1703 | { |
1704 | return GetBucketPolicyOutcome(GetBucketPolicyResult(outcome.GetResultWithOwnership())); |
1705 | } |
1706 | else |
1707 | { |
1708 | return GetBucketPolicyOutcome(outcome.GetError()); |
1709 | } |
1710 | } |
1711 | |
1712 | GetBucketPolicyOutcomeCallable S3Client::GetBucketPolicyCallable(const GetBucketPolicyRequest& request) const |
1713 | { |
1714 | auto task = Aws::MakeShared< std::packaged_task< GetBucketPolicyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketPolicy(request); } ); |
1715 | auto packagedFunction = [task]() { (*task)(); }; |
1716 | m_executor->Submit(packagedFunction); |
1717 | return task->get_future(); |
1718 | } |
1719 | |
1720 | void S3Client::GetBucketPolicyAsync(const GetBucketPolicyRequest& request, const GetBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1721 | { |
1722 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketPolicyAsyncHelper( request, handler, context ); } ); |
1723 | } |
1724 | |
1725 | void S3Client::GetBucketPolicyAsyncHelper(const GetBucketPolicyRequest& request, const GetBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1726 | { |
1727 | handler(this, request, GetBucketPolicy(request), context); |
1728 | } |
1729 | |
1730 | GetBucketPolicyStatusOutcome S3Client::GetBucketPolicyStatus(const GetBucketPolicyStatusRequest& request) const |
1731 | { |
1732 | if (!request.BucketHasBeenSet()) |
1733 | { |
1734 | AWS_LOGSTREAM_ERROR("GetBucketPolicyStatus" , "Required field: Bucket, is not set" ); |
1735 | return GetBucketPolicyStatusOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1736 | } |
1737 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1738 | if (!computeEndpointOutcome.IsSuccess()) |
1739 | { |
1740 | return GetBucketPolicyStatusOutcome(computeEndpointOutcome.GetError()); |
1741 | } |
1742 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1743 | Aws::StringStream ss; |
1744 | ss.str("?policyStatus" ); |
1745 | uri.SetQueryString(ss.str()); |
1746 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1747 | if(outcome.IsSuccess()) |
1748 | { |
1749 | return GetBucketPolicyStatusOutcome(GetBucketPolicyStatusResult(outcome.GetResult())); |
1750 | } |
1751 | else |
1752 | { |
1753 | return GetBucketPolicyStatusOutcome(outcome.GetError()); |
1754 | } |
1755 | } |
1756 | |
1757 | GetBucketPolicyStatusOutcomeCallable S3Client::GetBucketPolicyStatusCallable(const GetBucketPolicyStatusRequest& request) const |
1758 | { |
1759 | auto task = Aws::MakeShared< std::packaged_task< GetBucketPolicyStatusOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketPolicyStatus(request); } ); |
1760 | auto packagedFunction = [task]() { (*task)(); }; |
1761 | m_executor->Submit(packagedFunction); |
1762 | return task->get_future(); |
1763 | } |
1764 | |
1765 | void S3Client::GetBucketPolicyStatusAsync(const GetBucketPolicyStatusRequest& request, const GetBucketPolicyStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1766 | { |
1767 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketPolicyStatusAsyncHelper( request, handler, context ); } ); |
1768 | } |
1769 | |
1770 | void S3Client::GetBucketPolicyStatusAsyncHelper(const GetBucketPolicyStatusRequest& request, const GetBucketPolicyStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1771 | { |
1772 | handler(this, request, GetBucketPolicyStatus(request), context); |
1773 | } |
1774 | |
1775 | GetBucketReplicationOutcome S3Client::GetBucketReplication(const GetBucketReplicationRequest& request) const |
1776 | { |
1777 | if (!request.BucketHasBeenSet()) |
1778 | { |
1779 | AWS_LOGSTREAM_ERROR("GetBucketReplication" , "Required field: Bucket, is not set" ); |
1780 | return GetBucketReplicationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1781 | } |
1782 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1783 | if (!computeEndpointOutcome.IsSuccess()) |
1784 | { |
1785 | return GetBucketReplicationOutcome(computeEndpointOutcome.GetError()); |
1786 | } |
1787 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1788 | Aws::StringStream ss; |
1789 | ss.str("?replication" ); |
1790 | uri.SetQueryString(ss.str()); |
1791 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1792 | if(outcome.IsSuccess()) |
1793 | { |
1794 | return GetBucketReplicationOutcome(GetBucketReplicationResult(outcome.GetResult())); |
1795 | } |
1796 | else |
1797 | { |
1798 | return GetBucketReplicationOutcome(outcome.GetError()); |
1799 | } |
1800 | } |
1801 | |
1802 | GetBucketReplicationOutcomeCallable S3Client::GetBucketReplicationCallable(const GetBucketReplicationRequest& request) const |
1803 | { |
1804 | auto task = Aws::MakeShared< std::packaged_task< GetBucketReplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketReplication(request); } ); |
1805 | auto packagedFunction = [task]() { (*task)(); }; |
1806 | m_executor->Submit(packagedFunction); |
1807 | return task->get_future(); |
1808 | } |
1809 | |
1810 | void S3Client::GetBucketReplicationAsync(const GetBucketReplicationRequest& request, const GetBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1811 | { |
1812 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketReplicationAsyncHelper( request, handler, context ); } ); |
1813 | } |
1814 | |
1815 | void S3Client::GetBucketReplicationAsyncHelper(const GetBucketReplicationRequest& request, const GetBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1816 | { |
1817 | handler(this, request, GetBucketReplication(request), context); |
1818 | } |
1819 | |
1820 | GetBucketRequestPaymentOutcome S3Client::GetBucketRequestPayment(const GetBucketRequestPaymentRequest& request) const |
1821 | { |
1822 | if (!request.BucketHasBeenSet()) |
1823 | { |
1824 | AWS_LOGSTREAM_ERROR("GetBucketRequestPayment" , "Required field: Bucket, is not set" ); |
1825 | return GetBucketRequestPaymentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1826 | } |
1827 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1828 | if (!computeEndpointOutcome.IsSuccess()) |
1829 | { |
1830 | return GetBucketRequestPaymentOutcome(computeEndpointOutcome.GetError()); |
1831 | } |
1832 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1833 | Aws::StringStream ss; |
1834 | ss.str("?requestPayment" ); |
1835 | uri.SetQueryString(ss.str()); |
1836 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1837 | if(outcome.IsSuccess()) |
1838 | { |
1839 | return GetBucketRequestPaymentOutcome(GetBucketRequestPaymentResult(outcome.GetResult())); |
1840 | } |
1841 | else |
1842 | { |
1843 | return GetBucketRequestPaymentOutcome(outcome.GetError()); |
1844 | } |
1845 | } |
1846 | |
1847 | GetBucketRequestPaymentOutcomeCallable S3Client::GetBucketRequestPaymentCallable(const GetBucketRequestPaymentRequest& request) const |
1848 | { |
1849 | auto task = Aws::MakeShared< std::packaged_task< GetBucketRequestPaymentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketRequestPayment(request); } ); |
1850 | auto packagedFunction = [task]() { (*task)(); }; |
1851 | m_executor->Submit(packagedFunction); |
1852 | return task->get_future(); |
1853 | } |
1854 | |
1855 | void S3Client::GetBucketRequestPaymentAsync(const GetBucketRequestPaymentRequest& request, const GetBucketRequestPaymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1856 | { |
1857 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketRequestPaymentAsyncHelper( request, handler, context ); } ); |
1858 | } |
1859 | |
1860 | void S3Client::GetBucketRequestPaymentAsyncHelper(const GetBucketRequestPaymentRequest& request, const GetBucketRequestPaymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1861 | { |
1862 | handler(this, request, GetBucketRequestPayment(request), context); |
1863 | } |
1864 | |
1865 | GetBucketTaggingOutcome S3Client::GetBucketTagging(const GetBucketTaggingRequest& request) const |
1866 | { |
1867 | if (!request.BucketHasBeenSet()) |
1868 | { |
1869 | AWS_LOGSTREAM_ERROR("GetBucketTagging" , "Required field: Bucket, is not set" ); |
1870 | return GetBucketTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1871 | } |
1872 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1873 | if (!computeEndpointOutcome.IsSuccess()) |
1874 | { |
1875 | return GetBucketTaggingOutcome(computeEndpointOutcome.GetError()); |
1876 | } |
1877 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1878 | Aws::StringStream ss; |
1879 | ss.str("?tagging" ); |
1880 | uri.SetQueryString(ss.str()); |
1881 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1882 | if(outcome.IsSuccess()) |
1883 | { |
1884 | return GetBucketTaggingOutcome(GetBucketTaggingResult(outcome.GetResult())); |
1885 | } |
1886 | else |
1887 | { |
1888 | return GetBucketTaggingOutcome(outcome.GetError()); |
1889 | } |
1890 | } |
1891 | |
1892 | GetBucketTaggingOutcomeCallable S3Client::GetBucketTaggingCallable(const GetBucketTaggingRequest& request) const |
1893 | { |
1894 | auto task = Aws::MakeShared< std::packaged_task< GetBucketTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketTagging(request); } ); |
1895 | auto packagedFunction = [task]() { (*task)(); }; |
1896 | m_executor->Submit(packagedFunction); |
1897 | return task->get_future(); |
1898 | } |
1899 | |
1900 | void S3Client::GetBucketTaggingAsync(const GetBucketTaggingRequest& request, const GetBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1901 | { |
1902 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketTaggingAsyncHelper( request, handler, context ); } ); |
1903 | } |
1904 | |
1905 | void S3Client::GetBucketTaggingAsyncHelper(const GetBucketTaggingRequest& request, const GetBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1906 | { |
1907 | handler(this, request, GetBucketTagging(request), context); |
1908 | } |
1909 | |
1910 | GetBucketVersioningOutcome S3Client::GetBucketVersioning(const GetBucketVersioningRequest& request) const |
1911 | { |
1912 | if (!request.BucketHasBeenSet()) |
1913 | { |
1914 | AWS_LOGSTREAM_ERROR("GetBucketVersioning" , "Required field: Bucket, is not set" ); |
1915 | return GetBucketVersioningOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1916 | } |
1917 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1918 | if (!computeEndpointOutcome.IsSuccess()) |
1919 | { |
1920 | return GetBucketVersioningOutcome(computeEndpointOutcome.GetError()); |
1921 | } |
1922 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1923 | Aws::StringStream ss; |
1924 | ss.str("?versioning" ); |
1925 | uri.SetQueryString(ss.str()); |
1926 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1927 | if(outcome.IsSuccess()) |
1928 | { |
1929 | return GetBucketVersioningOutcome(GetBucketVersioningResult(outcome.GetResult())); |
1930 | } |
1931 | else |
1932 | { |
1933 | return GetBucketVersioningOutcome(outcome.GetError()); |
1934 | } |
1935 | } |
1936 | |
1937 | GetBucketVersioningOutcomeCallable S3Client::GetBucketVersioningCallable(const GetBucketVersioningRequest& request) const |
1938 | { |
1939 | auto task = Aws::MakeShared< std::packaged_task< GetBucketVersioningOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketVersioning(request); } ); |
1940 | auto packagedFunction = [task]() { (*task)(); }; |
1941 | m_executor->Submit(packagedFunction); |
1942 | return task->get_future(); |
1943 | } |
1944 | |
1945 | void S3Client::GetBucketVersioningAsync(const GetBucketVersioningRequest& request, const GetBucketVersioningResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1946 | { |
1947 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketVersioningAsyncHelper( request, handler, context ); } ); |
1948 | } |
1949 | |
1950 | void S3Client::GetBucketVersioningAsyncHelper(const GetBucketVersioningRequest& request, const GetBucketVersioningResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1951 | { |
1952 | handler(this, request, GetBucketVersioning(request), context); |
1953 | } |
1954 | |
1955 | GetBucketWebsiteOutcome S3Client::GetBucketWebsite(const GetBucketWebsiteRequest& request) const |
1956 | { |
1957 | if (!request.BucketHasBeenSet()) |
1958 | { |
1959 | AWS_LOGSTREAM_ERROR("GetBucketWebsite" , "Required field: Bucket, is not set" ); |
1960 | return GetBucketWebsiteOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
1961 | } |
1962 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
1963 | if (!computeEndpointOutcome.IsSuccess()) |
1964 | { |
1965 | return GetBucketWebsiteOutcome(computeEndpointOutcome.GetError()); |
1966 | } |
1967 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
1968 | Aws::StringStream ss; |
1969 | ss.str("?website" ); |
1970 | uri.SetQueryString(ss.str()); |
1971 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
1972 | if(outcome.IsSuccess()) |
1973 | { |
1974 | return GetBucketWebsiteOutcome(GetBucketWebsiteResult(outcome.GetResult())); |
1975 | } |
1976 | else |
1977 | { |
1978 | return GetBucketWebsiteOutcome(outcome.GetError()); |
1979 | } |
1980 | } |
1981 | |
1982 | GetBucketWebsiteOutcomeCallable S3Client::GetBucketWebsiteCallable(const GetBucketWebsiteRequest& request) const |
1983 | { |
1984 | auto task = Aws::MakeShared< std::packaged_task< GetBucketWebsiteOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetBucketWebsite(request); } ); |
1985 | auto packagedFunction = [task]() { (*task)(); }; |
1986 | m_executor->Submit(packagedFunction); |
1987 | return task->get_future(); |
1988 | } |
1989 | |
1990 | void S3Client::GetBucketWebsiteAsync(const GetBucketWebsiteRequest& request, const GetBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1991 | { |
1992 | m_executor->Submit( [this, request, handler, context](){ this->GetBucketWebsiteAsyncHelper( request, handler, context ); } ); |
1993 | } |
1994 | |
1995 | void S3Client::GetBucketWebsiteAsyncHelper(const GetBucketWebsiteRequest& request, const GetBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
1996 | { |
1997 | handler(this, request, GetBucketWebsite(request), context); |
1998 | } |
1999 | |
2000 | GetObjectOutcome S3Client::GetObject(const GetObjectRequest& request) const |
2001 | { |
2002 | if (!request.BucketHasBeenSet()) |
2003 | { |
2004 | AWS_LOGSTREAM_ERROR("GetObject" , "Required field: Bucket, is not set" ); |
2005 | return GetObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2006 | } |
2007 | if (!request.KeyHasBeenSet()) |
2008 | { |
2009 | AWS_LOGSTREAM_ERROR("GetObject" , "Required field: Key, is not set" ); |
2010 | return GetObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2011 | } |
2012 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2013 | if (!computeEndpointOutcome.IsSuccess()) |
2014 | { |
2015 | return GetObjectOutcome(computeEndpointOutcome.GetError()); |
2016 | } |
2017 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2018 | Aws::StringStream ss; |
2019 | ss << "/" ; |
2020 | ss << request.GetKey(); |
2021 | uri.SetPath(uri.GetPath() + ss.str()); |
2022 | StreamOutcome outcome = MakeRequestWithUnparsedResponse(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2023 | if(outcome.IsSuccess()) |
2024 | { |
2025 | return GetObjectOutcome(GetObjectResult(outcome.GetResultWithOwnership())); |
2026 | } |
2027 | else |
2028 | { |
2029 | return GetObjectOutcome(outcome.GetError()); |
2030 | } |
2031 | } |
2032 | |
2033 | GetObjectOutcomeCallable S3Client::GetObjectCallable(const GetObjectRequest& request) const |
2034 | { |
2035 | auto task = Aws::MakeShared< std::packaged_task< GetObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObject(request); } ); |
2036 | auto packagedFunction = [task]() { (*task)(); }; |
2037 | m_executor->Submit(packagedFunction); |
2038 | return task->get_future(); |
2039 | } |
2040 | |
2041 | void S3Client::GetObjectAsync(const GetObjectRequest& request, const GetObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2042 | { |
2043 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectAsyncHelper( request, handler, context ); } ); |
2044 | } |
2045 | |
2046 | void S3Client::GetObjectAsyncHelper(const GetObjectRequest& request, const GetObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2047 | { |
2048 | handler(this, request, GetObject(request), context); |
2049 | } |
2050 | |
2051 | GetObjectAclOutcome S3Client::GetObjectAcl(const GetObjectAclRequest& request) const |
2052 | { |
2053 | if (!request.BucketHasBeenSet()) |
2054 | { |
2055 | AWS_LOGSTREAM_ERROR("GetObjectAcl" , "Required field: Bucket, is not set" ); |
2056 | return GetObjectAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2057 | } |
2058 | if (!request.KeyHasBeenSet()) |
2059 | { |
2060 | AWS_LOGSTREAM_ERROR("GetObjectAcl" , "Required field: Key, is not set" ); |
2061 | return GetObjectAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2062 | } |
2063 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2064 | if (!computeEndpointOutcome.IsSuccess()) |
2065 | { |
2066 | return GetObjectAclOutcome(computeEndpointOutcome.GetError()); |
2067 | } |
2068 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2069 | Aws::StringStream ss; |
2070 | ss << "/" ; |
2071 | ss << request.GetKey(); |
2072 | uri.SetPath(uri.GetPath() + ss.str()); |
2073 | ss.str("?acl" ); |
2074 | uri.SetQueryString(ss.str()); |
2075 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2076 | if(outcome.IsSuccess()) |
2077 | { |
2078 | return GetObjectAclOutcome(GetObjectAclResult(outcome.GetResult())); |
2079 | } |
2080 | else |
2081 | { |
2082 | return GetObjectAclOutcome(outcome.GetError()); |
2083 | } |
2084 | } |
2085 | |
2086 | GetObjectAclOutcomeCallable S3Client::GetObjectAclCallable(const GetObjectAclRequest& request) const |
2087 | { |
2088 | auto task = Aws::MakeShared< std::packaged_task< GetObjectAclOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectAcl(request); } ); |
2089 | auto packagedFunction = [task]() { (*task)(); }; |
2090 | m_executor->Submit(packagedFunction); |
2091 | return task->get_future(); |
2092 | } |
2093 | |
2094 | void S3Client::GetObjectAclAsync(const GetObjectAclRequest& request, const GetObjectAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2095 | { |
2096 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectAclAsyncHelper( request, handler, context ); } ); |
2097 | } |
2098 | |
2099 | void S3Client::GetObjectAclAsyncHelper(const GetObjectAclRequest& request, const GetObjectAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2100 | { |
2101 | handler(this, request, GetObjectAcl(request), context); |
2102 | } |
2103 | |
2104 | GetObjectLegalHoldOutcome S3Client::GetObjectLegalHold(const GetObjectLegalHoldRequest& request) const |
2105 | { |
2106 | if (!request.BucketHasBeenSet()) |
2107 | { |
2108 | AWS_LOGSTREAM_ERROR("GetObjectLegalHold" , "Required field: Bucket, is not set" ); |
2109 | return GetObjectLegalHoldOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2110 | } |
2111 | if (!request.KeyHasBeenSet()) |
2112 | { |
2113 | AWS_LOGSTREAM_ERROR("GetObjectLegalHold" , "Required field: Key, is not set" ); |
2114 | return GetObjectLegalHoldOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2115 | } |
2116 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2117 | if (!computeEndpointOutcome.IsSuccess()) |
2118 | { |
2119 | return GetObjectLegalHoldOutcome(computeEndpointOutcome.GetError()); |
2120 | } |
2121 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2122 | Aws::StringStream ss; |
2123 | ss << "/" ; |
2124 | ss << request.GetKey(); |
2125 | uri.SetPath(uri.GetPath() + ss.str()); |
2126 | ss.str("?legal-hold" ); |
2127 | uri.SetQueryString(ss.str()); |
2128 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2129 | if(outcome.IsSuccess()) |
2130 | { |
2131 | return GetObjectLegalHoldOutcome(GetObjectLegalHoldResult(outcome.GetResult())); |
2132 | } |
2133 | else |
2134 | { |
2135 | return GetObjectLegalHoldOutcome(outcome.GetError()); |
2136 | } |
2137 | } |
2138 | |
2139 | GetObjectLegalHoldOutcomeCallable S3Client::GetObjectLegalHoldCallable(const GetObjectLegalHoldRequest& request) const |
2140 | { |
2141 | auto task = Aws::MakeShared< std::packaged_task< GetObjectLegalHoldOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectLegalHold(request); } ); |
2142 | auto packagedFunction = [task]() { (*task)(); }; |
2143 | m_executor->Submit(packagedFunction); |
2144 | return task->get_future(); |
2145 | } |
2146 | |
2147 | void S3Client::GetObjectLegalHoldAsync(const GetObjectLegalHoldRequest& request, const GetObjectLegalHoldResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2148 | { |
2149 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectLegalHoldAsyncHelper( request, handler, context ); } ); |
2150 | } |
2151 | |
2152 | void S3Client::GetObjectLegalHoldAsyncHelper(const GetObjectLegalHoldRequest& request, const GetObjectLegalHoldResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2153 | { |
2154 | handler(this, request, GetObjectLegalHold(request), context); |
2155 | } |
2156 | |
2157 | GetObjectLockConfigurationOutcome S3Client::GetObjectLockConfiguration(const GetObjectLockConfigurationRequest& request) const |
2158 | { |
2159 | if (!request.BucketHasBeenSet()) |
2160 | { |
2161 | AWS_LOGSTREAM_ERROR("GetObjectLockConfiguration" , "Required field: Bucket, is not set" ); |
2162 | return GetObjectLockConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2163 | } |
2164 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2165 | if (!computeEndpointOutcome.IsSuccess()) |
2166 | { |
2167 | return GetObjectLockConfigurationOutcome(computeEndpointOutcome.GetError()); |
2168 | } |
2169 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2170 | Aws::StringStream ss; |
2171 | ss.str("?object-lock" ); |
2172 | uri.SetQueryString(ss.str()); |
2173 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2174 | if(outcome.IsSuccess()) |
2175 | { |
2176 | return GetObjectLockConfigurationOutcome(GetObjectLockConfigurationResult(outcome.GetResult())); |
2177 | } |
2178 | else |
2179 | { |
2180 | return GetObjectLockConfigurationOutcome(outcome.GetError()); |
2181 | } |
2182 | } |
2183 | |
2184 | GetObjectLockConfigurationOutcomeCallable S3Client::GetObjectLockConfigurationCallable(const GetObjectLockConfigurationRequest& request) const |
2185 | { |
2186 | auto task = Aws::MakeShared< std::packaged_task< GetObjectLockConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectLockConfiguration(request); } ); |
2187 | auto packagedFunction = [task]() { (*task)(); }; |
2188 | m_executor->Submit(packagedFunction); |
2189 | return task->get_future(); |
2190 | } |
2191 | |
2192 | void S3Client::GetObjectLockConfigurationAsync(const GetObjectLockConfigurationRequest& request, const GetObjectLockConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2193 | { |
2194 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectLockConfigurationAsyncHelper( request, handler, context ); } ); |
2195 | } |
2196 | |
2197 | void S3Client::GetObjectLockConfigurationAsyncHelper(const GetObjectLockConfigurationRequest& request, const GetObjectLockConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2198 | { |
2199 | handler(this, request, GetObjectLockConfiguration(request), context); |
2200 | } |
2201 | |
2202 | GetObjectRetentionOutcome S3Client::GetObjectRetention(const GetObjectRetentionRequest& request) const |
2203 | { |
2204 | if (!request.BucketHasBeenSet()) |
2205 | { |
2206 | AWS_LOGSTREAM_ERROR("GetObjectRetention" , "Required field: Bucket, is not set" ); |
2207 | return GetObjectRetentionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2208 | } |
2209 | if (!request.KeyHasBeenSet()) |
2210 | { |
2211 | AWS_LOGSTREAM_ERROR("GetObjectRetention" , "Required field: Key, is not set" ); |
2212 | return GetObjectRetentionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2213 | } |
2214 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2215 | if (!computeEndpointOutcome.IsSuccess()) |
2216 | { |
2217 | return GetObjectRetentionOutcome(computeEndpointOutcome.GetError()); |
2218 | } |
2219 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2220 | Aws::StringStream ss; |
2221 | ss << "/" ; |
2222 | ss << request.GetKey(); |
2223 | uri.SetPath(uri.GetPath() + ss.str()); |
2224 | ss.str("?retention" ); |
2225 | uri.SetQueryString(ss.str()); |
2226 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2227 | if(outcome.IsSuccess()) |
2228 | { |
2229 | return GetObjectRetentionOutcome(GetObjectRetentionResult(outcome.GetResult())); |
2230 | } |
2231 | else |
2232 | { |
2233 | return GetObjectRetentionOutcome(outcome.GetError()); |
2234 | } |
2235 | } |
2236 | |
2237 | GetObjectRetentionOutcomeCallable S3Client::GetObjectRetentionCallable(const GetObjectRetentionRequest& request) const |
2238 | { |
2239 | auto task = Aws::MakeShared< std::packaged_task< GetObjectRetentionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectRetention(request); } ); |
2240 | auto packagedFunction = [task]() { (*task)(); }; |
2241 | m_executor->Submit(packagedFunction); |
2242 | return task->get_future(); |
2243 | } |
2244 | |
2245 | void S3Client::GetObjectRetentionAsync(const GetObjectRetentionRequest& request, const GetObjectRetentionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2246 | { |
2247 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectRetentionAsyncHelper( request, handler, context ); } ); |
2248 | } |
2249 | |
2250 | void S3Client::GetObjectRetentionAsyncHelper(const GetObjectRetentionRequest& request, const GetObjectRetentionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2251 | { |
2252 | handler(this, request, GetObjectRetention(request), context); |
2253 | } |
2254 | |
2255 | GetObjectTaggingOutcome S3Client::GetObjectTagging(const GetObjectTaggingRequest& request) const |
2256 | { |
2257 | if (!request.BucketHasBeenSet()) |
2258 | { |
2259 | AWS_LOGSTREAM_ERROR("GetObjectTagging" , "Required field: Bucket, is not set" ); |
2260 | return GetObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2261 | } |
2262 | if (!request.KeyHasBeenSet()) |
2263 | { |
2264 | AWS_LOGSTREAM_ERROR("GetObjectTagging" , "Required field: Key, is not set" ); |
2265 | return GetObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2266 | } |
2267 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2268 | if (!computeEndpointOutcome.IsSuccess()) |
2269 | { |
2270 | return GetObjectTaggingOutcome(computeEndpointOutcome.GetError()); |
2271 | } |
2272 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2273 | Aws::StringStream ss; |
2274 | ss << "/" ; |
2275 | ss << request.GetKey(); |
2276 | uri.SetPath(uri.GetPath() + ss.str()); |
2277 | ss.str("?tagging" ); |
2278 | uri.SetQueryString(ss.str()); |
2279 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2280 | if(outcome.IsSuccess()) |
2281 | { |
2282 | return GetObjectTaggingOutcome(GetObjectTaggingResult(outcome.GetResult())); |
2283 | } |
2284 | else |
2285 | { |
2286 | return GetObjectTaggingOutcome(outcome.GetError()); |
2287 | } |
2288 | } |
2289 | |
2290 | GetObjectTaggingOutcomeCallable S3Client::GetObjectTaggingCallable(const GetObjectTaggingRequest& request) const |
2291 | { |
2292 | auto task = Aws::MakeShared< std::packaged_task< GetObjectTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectTagging(request); } ); |
2293 | auto packagedFunction = [task]() { (*task)(); }; |
2294 | m_executor->Submit(packagedFunction); |
2295 | return task->get_future(); |
2296 | } |
2297 | |
2298 | void S3Client::GetObjectTaggingAsync(const GetObjectTaggingRequest& request, const GetObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2299 | { |
2300 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectTaggingAsyncHelper( request, handler, context ); } ); |
2301 | } |
2302 | |
2303 | void S3Client::GetObjectTaggingAsyncHelper(const GetObjectTaggingRequest& request, const GetObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2304 | { |
2305 | handler(this, request, GetObjectTagging(request), context); |
2306 | } |
2307 | |
2308 | GetObjectTorrentOutcome S3Client::GetObjectTorrent(const GetObjectTorrentRequest& request) const |
2309 | { |
2310 | if (!request.BucketHasBeenSet()) |
2311 | { |
2312 | AWS_LOGSTREAM_ERROR("GetObjectTorrent" , "Required field: Bucket, is not set" ); |
2313 | return GetObjectTorrentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2314 | } |
2315 | if (!request.KeyHasBeenSet()) |
2316 | { |
2317 | AWS_LOGSTREAM_ERROR("GetObjectTorrent" , "Required field: Key, is not set" ); |
2318 | return GetObjectTorrentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2319 | } |
2320 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2321 | if (!computeEndpointOutcome.IsSuccess()) |
2322 | { |
2323 | return GetObjectTorrentOutcome(computeEndpointOutcome.GetError()); |
2324 | } |
2325 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2326 | Aws::StringStream ss; |
2327 | ss << "/" ; |
2328 | ss << request.GetKey(); |
2329 | uri.SetPath(uri.GetPath() + ss.str()); |
2330 | ss.str("?torrent" ); |
2331 | uri.SetQueryString(ss.str()); |
2332 | StreamOutcome outcome = MakeRequestWithUnparsedResponse(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2333 | if(outcome.IsSuccess()) |
2334 | { |
2335 | return GetObjectTorrentOutcome(GetObjectTorrentResult(outcome.GetResultWithOwnership())); |
2336 | } |
2337 | else |
2338 | { |
2339 | return GetObjectTorrentOutcome(outcome.GetError()); |
2340 | } |
2341 | } |
2342 | |
2343 | GetObjectTorrentOutcomeCallable S3Client::GetObjectTorrentCallable(const GetObjectTorrentRequest& request) const |
2344 | { |
2345 | auto task = Aws::MakeShared< std::packaged_task< GetObjectTorrentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetObjectTorrent(request); } ); |
2346 | auto packagedFunction = [task]() { (*task)(); }; |
2347 | m_executor->Submit(packagedFunction); |
2348 | return task->get_future(); |
2349 | } |
2350 | |
2351 | void S3Client::GetObjectTorrentAsync(const GetObjectTorrentRequest& request, const GetObjectTorrentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2352 | { |
2353 | m_executor->Submit( [this, request, handler, context](){ this->GetObjectTorrentAsyncHelper( request, handler, context ); } ); |
2354 | } |
2355 | |
2356 | void S3Client::GetObjectTorrentAsyncHelper(const GetObjectTorrentRequest& request, const GetObjectTorrentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2357 | { |
2358 | handler(this, request, GetObjectTorrent(request), context); |
2359 | } |
2360 | |
2361 | GetPublicAccessBlockOutcome S3Client::GetPublicAccessBlock(const GetPublicAccessBlockRequest& request) const |
2362 | { |
2363 | if (!request.BucketHasBeenSet()) |
2364 | { |
2365 | AWS_LOGSTREAM_ERROR("GetPublicAccessBlock" , "Required field: Bucket, is not set" ); |
2366 | return GetPublicAccessBlockOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2367 | } |
2368 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2369 | if (!computeEndpointOutcome.IsSuccess()) |
2370 | { |
2371 | return GetPublicAccessBlockOutcome(computeEndpointOutcome.GetError()); |
2372 | } |
2373 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2374 | Aws::StringStream ss; |
2375 | ss.str("?publicAccessBlock" ); |
2376 | uri.SetQueryString(ss.str()); |
2377 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2378 | if(outcome.IsSuccess()) |
2379 | { |
2380 | return GetPublicAccessBlockOutcome(GetPublicAccessBlockResult(outcome.GetResult())); |
2381 | } |
2382 | else |
2383 | { |
2384 | return GetPublicAccessBlockOutcome(outcome.GetError()); |
2385 | } |
2386 | } |
2387 | |
2388 | GetPublicAccessBlockOutcomeCallable S3Client::GetPublicAccessBlockCallable(const GetPublicAccessBlockRequest& request) const |
2389 | { |
2390 | auto task = Aws::MakeShared< std::packaged_task< GetPublicAccessBlockOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetPublicAccessBlock(request); } ); |
2391 | auto packagedFunction = [task]() { (*task)(); }; |
2392 | m_executor->Submit(packagedFunction); |
2393 | return task->get_future(); |
2394 | } |
2395 | |
2396 | void S3Client::GetPublicAccessBlockAsync(const GetPublicAccessBlockRequest& request, const GetPublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2397 | { |
2398 | m_executor->Submit( [this, request, handler, context](){ this->GetPublicAccessBlockAsyncHelper( request, handler, context ); } ); |
2399 | } |
2400 | |
2401 | void S3Client::GetPublicAccessBlockAsyncHelper(const GetPublicAccessBlockRequest& request, const GetPublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2402 | { |
2403 | handler(this, request, GetPublicAccessBlock(request), context); |
2404 | } |
2405 | |
2406 | HeadBucketOutcome S3Client::HeadBucket(const HeadBucketRequest& request) const |
2407 | { |
2408 | if (!request.BucketHasBeenSet()) |
2409 | { |
2410 | AWS_LOGSTREAM_ERROR("HeadBucket" , "Required field: Bucket, is not set" ); |
2411 | return HeadBucketOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2412 | } |
2413 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2414 | if (!computeEndpointOutcome.IsSuccess()) |
2415 | { |
2416 | return HeadBucketOutcome(computeEndpointOutcome.GetError()); |
2417 | } |
2418 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2419 | Aws::StringStream ss; |
2420 | uri.SetPath(uri.GetPath() + ss.str()); |
2421 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_HEAD, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2422 | if(outcome.IsSuccess()) |
2423 | { |
2424 | return HeadBucketOutcome(NoResult()); |
2425 | } |
2426 | else |
2427 | { |
2428 | return HeadBucketOutcome(outcome.GetError()); |
2429 | } |
2430 | } |
2431 | |
2432 | HeadBucketOutcomeCallable S3Client::HeadBucketCallable(const HeadBucketRequest& request) const |
2433 | { |
2434 | auto task = Aws::MakeShared< std::packaged_task< HeadBucketOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->HeadBucket(request); } ); |
2435 | auto packagedFunction = [task]() { (*task)(); }; |
2436 | m_executor->Submit(packagedFunction); |
2437 | return task->get_future(); |
2438 | } |
2439 | |
2440 | void S3Client::HeadBucketAsync(const HeadBucketRequest& request, const HeadBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2441 | { |
2442 | m_executor->Submit( [this, request, handler, context](){ this->HeadBucketAsyncHelper( request, handler, context ); } ); |
2443 | } |
2444 | |
2445 | void S3Client::HeadBucketAsyncHelper(const HeadBucketRequest& request, const HeadBucketResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2446 | { |
2447 | handler(this, request, HeadBucket(request), context); |
2448 | } |
2449 | |
2450 | HeadObjectOutcome S3Client::HeadObject(const HeadObjectRequest& request) const |
2451 | { |
2452 | if (!request.BucketHasBeenSet()) |
2453 | { |
2454 | AWS_LOGSTREAM_ERROR("HeadObject" , "Required field: Bucket, is not set" ); |
2455 | return HeadObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2456 | } |
2457 | if (!request.KeyHasBeenSet()) |
2458 | { |
2459 | AWS_LOGSTREAM_ERROR("HeadObject" , "Required field: Key, is not set" ); |
2460 | return HeadObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2461 | } |
2462 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2463 | if (!computeEndpointOutcome.IsSuccess()) |
2464 | { |
2465 | return HeadObjectOutcome(computeEndpointOutcome.GetError()); |
2466 | } |
2467 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2468 | Aws::StringStream ss; |
2469 | ss << "/" ; |
2470 | ss << request.GetKey(); |
2471 | uri.SetPath(uri.GetPath() + ss.str()); |
2472 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_HEAD, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2473 | if(outcome.IsSuccess()) |
2474 | { |
2475 | return HeadObjectOutcome(HeadObjectResult(outcome.GetResult())); |
2476 | } |
2477 | else |
2478 | { |
2479 | return HeadObjectOutcome(outcome.GetError()); |
2480 | } |
2481 | } |
2482 | |
2483 | HeadObjectOutcomeCallable S3Client::HeadObjectCallable(const HeadObjectRequest& request) const |
2484 | { |
2485 | auto task = Aws::MakeShared< std::packaged_task< HeadObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->HeadObject(request); } ); |
2486 | auto packagedFunction = [task]() { (*task)(); }; |
2487 | m_executor->Submit(packagedFunction); |
2488 | return task->get_future(); |
2489 | } |
2490 | |
2491 | void S3Client::HeadObjectAsync(const HeadObjectRequest& request, const HeadObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2492 | { |
2493 | m_executor->Submit( [this, request, handler, context](){ this->HeadObjectAsyncHelper( request, handler, context ); } ); |
2494 | } |
2495 | |
2496 | void S3Client::HeadObjectAsyncHelper(const HeadObjectRequest& request, const HeadObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2497 | { |
2498 | handler(this, request, HeadObject(request), context); |
2499 | } |
2500 | |
2501 | ListBucketAnalyticsConfigurationsOutcome S3Client::ListBucketAnalyticsConfigurations(const ListBucketAnalyticsConfigurationsRequest& request) const |
2502 | { |
2503 | if (!request.BucketHasBeenSet()) |
2504 | { |
2505 | AWS_LOGSTREAM_ERROR("ListBucketAnalyticsConfigurations" , "Required field: Bucket, is not set" ); |
2506 | return ListBucketAnalyticsConfigurationsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2507 | } |
2508 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2509 | if (!computeEndpointOutcome.IsSuccess()) |
2510 | { |
2511 | return ListBucketAnalyticsConfigurationsOutcome(computeEndpointOutcome.GetError()); |
2512 | } |
2513 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2514 | Aws::StringStream ss; |
2515 | ss.str("?analytics" ); |
2516 | uri.SetQueryString(ss.str()); |
2517 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2518 | if(outcome.IsSuccess()) |
2519 | { |
2520 | return ListBucketAnalyticsConfigurationsOutcome(ListBucketAnalyticsConfigurationsResult(outcome.GetResult())); |
2521 | } |
2522 | else |
2523 | { |
2524 | return ListBucketAnalyticsConfigurationsOutcome(outcome.GetError()); |
2525 | } |
2526 | } |
2527 | |
2528 | ListBucketAnalyticsConfigurationsOutcomeCallable S3Client::ListBucketAnalyticsConfigurationsCallable(const ListBucketAnalyticsConfigurationsRequest& request) const |
2529 | { |
2530 | auto task = Aws::MakeShared< std::packaged_task< ListBucketAnalyticsConfigurationsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListBucketAnalyticsConfigurations(request); } ); |
2531 | auto packagedFunction = [task]() { (*task)(); }; |
2532 | m_executor->Submit(packagedFunction); |
2533 | return task->get_future(); |
2534 | } |
2535 | |
2536 | void S3Client::ListBucketAnalyticsConfigurationsAsync(const ListBucketAnalyticsConfigurationsRequest& request, const ListBucketAnalyticsConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2537 | { |
2538 | m_executor->Submit( [this, request, handler, context](){ this->ListBucketAnalyticsConfigurationsAsyncHelper( request, handler, context ); } ); |
2539 | } |
2540 | |
2541 | void S3Client::ListBucketAnalyticsConfigurationsAsyncHelper(const ListBucketAnalyticsConfigurationsRequest& request, const ListBucketAnalyticsConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2542 | { |
2543 | handler(this, request, ListBucketAnalyticsConfigurations(request), context); |
2544 | } |
2545 | |
2546 | ListBucketInventoryConfigurationsOutcome S3Client::ListBucketInventoryConfigurations(const ListBucketInventoryConfigurationsRequest& request) const |
2547 | { |
2548 | if (!request.BucketHasBeenSet()) |
2549 | { |
2550 | AWS_LOGSTREAM_ERROR("ListBucketInventoryConfigurations" , "Required field: Bucket, is not set" ); |
2551 | return ListBucketInventoryConfigurationsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2552 | } |
2553 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2554 | if (!computeEndpointOutcome.IsSuccess()) |
2555 | { |
2556 | return ListBucketInventoryConfigurationsOutcome(computeEndpointOutcome.GetError()); |
2557 | } |
2558 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2559 | Aws::StringStream ss; |
2560 | ss.str("?inventory" ); |
2561 | uri.SetQueryString(ss.str()); |
2562 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2563 | if(outcome.IsSuccess()) |
2564 | { |
2565 | return ListBucketInventoryConfigurationsOutcome(ListBucketInventoryConfigurationsResult(outcome.GetResult())); |
2566 | } |
2567 | else |
2568 | { |
2569 | return ListBucketInventoryConfigurationsOutcome(outcome.GetError()); |
2570 | } |
2571 | } |
2572 | |
2573 | ListBucketInventoryConfigurationsOutcomeCallable S3Client::ListBucketInventoryConfigurationsCallable(const ListBucketInventoryConfigurationsRequest& request) const |
2574 | { |
2575 | auto task = Aws::MakeShared< std::packaged_task< ListBucketInventoryConfigurationsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListBucketInventoryConfigurations(request); } ); |
2576 | auto packagedFunction = [task]() { (*task)(); }; |
2577 | m_executor->Submit(packagedFunction); |
2578 | return task->get_future(); |
2579 | } |
2580 | |
2581 | void S3Client::ListBucketInventoryConfigurationsAsync(const ListBucketInventoryConfigurationsRequest& request, const ListBucketInventoryConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2582 | { |
2583 | m_executor->Submit( [this, request, handler, context](){ this->ListBucketInventoryConfigurationsAsyncHelper( request, handler, context ); } ); |
2584 | } |
2585 | |
2586 | void S3Client::ListBucketInventoryConfigurationsAsyncHelper(const ListBucketInventoryConfigurationsRequest& request, const ListBucketInventoryConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2587 | { |
2588 | handler(this, request, ListBucketInventoryConfigurations(request), context); |
2589 | } |
2590 | |
2591 | ListBucketMetricsConfigurationsOutcome S3Client::ListBucketMetricsConfigurations(const ListBucketMetricsConfigurationsRequest& request) const |
2592 | { |
2593 | if (!request.BucketHasBeenSet()) |
2594 | { |
2595 | AWS_LOGSTREAM_ERROR("ListBucketMetricsConfigurations" , "Required field: Bucket, is not set" ); |
2596 | return ListBucketMetricsConfigurationsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2597 | } |
2598 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2599 | if (!computeEndpointOutcome.IsSuccess()) |
2600 | { |
2601 | return ListBucketMetricsConfigurationsOutcome(computeEndpointOutcome.GetError()); |
2602 | } |
2603 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2604 | Aws::StringStream ss; |
2605 | ss.str("?metrics" ); |
2606 | uri.SetQueryString(ss.str()); |
2607 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2608 | if(outcome.IsSuccess()) |
2609 | { |
2610 | return ListBucketMetricsConfigurationsOutcome(ListBucketMetricsConfigurationsResult(outcome.GetResult())); |
2611 | } |
2612 | else |
2613 | { |
2614 | return ListBucketMetricsConfigurationsOutcome(outcome.GetError()); |
2615 | } |
2616 | } |
2617 | |
2618 | ListBucketMetricsConfigurationsOutcomeCallable S3Client::ListBucketMetricsConfigurationsCallable(const ListBucketMetricsConfigurationsRequest& request) const |
2619 | { |
2620 | auto task = Aws::MakeShared< std::packaged_task< ListBucketMetricsConfigurationsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListBucketMetricsConfigurations(request); } ); |
2621 | auto packagedFunction = [task]() { (*task)(); }; |
2622 | m_executor->Submit(packagedFunction); |
2623 | return task->get_future(); |
2624 | } |
2625 | |
2626 | void S3Client::ListBucketMetricsConfigurationsAsync(const ListBucketMetricsConfigurationsRequest& request, const ListBucketMetricsConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2627 | { |
2628 | m_executor->Submit( [this, request, handler, context](){ this->ListBucketMetricsConfigurationsAsyncHelper( request, handler, context ); } ); |
2629 | } |
2630 | |
2631 | void S3Client::ListBucketMetricsConfigurationsAsyncHelper(const ListBucketMetricsConfigurationsRequest& request, const ListBucketMetricsConfigurationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2632 | { |
2633 | handler(this, request, ListBucketMetricsConfigurations(request), context); |
2634 | } |
2635 | |
2636 | ListBucketsOutcome S3Client::ListBuckets() const |
2637 | { |
2638 | Aws::StringStream ss; |
2639 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(); |
2640 | if (!computeEndpointOutcome.IsSuccess()) |
2641 | { |
2642 | return ListBucketsOutcome(computeEndpointOutcome.GetError()); |
2643 | } |
2644 | ss << computeEndpointOutcome.GetResult().first; |
2645 | XmlOutcome outcome = MakeRequest(ss.str(), Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, "ListBuckets" , computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2646 | if(outcome.IsSuccess()) |
2647 | { |
2648 | return ListBucketsOutcome(ListBucketsResult(outcome.GetResult())); |
2649 | } |
2650 | else |
2651 | { |
2652 | return ListBucketsOutcome(outcome.GetError()); |
2653 | } |
2654 | } |
2655 | |
2656 | ListBucketsOutcomeCallable S3Client::ListBucketsCallable() const |
2657 | { |
2658 | auto task = Aws::MakeShared< std::packaged_task< ListBucketsOutcome() > >(ALLOCATION_TAG, [this](){ return this->ListBuckets(); } ); |
2659 | auto packagedFunction = [task]() { (*task)(); }; |
2660 | m_executor->Submit(packagedFunction); |
2661 | return task->get_future(); |
2662 | } |
2663 | |
2664 | void S3Client::ListBucketsAsync(const ListBucketsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2665 | { |
2666 | m_executor->Submit( [this, handler, context](){ this->ListBucketsAsyncHelper( handler, context ); } ); |
2667 | } |
2668 | |
2669 | void S3Client::ListBucketsAsyncHelper(const ListBucketsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2670 | { |
2671 | handler(this, ListBuckets(), context); |
2672 | } |
2673 | |
2674 | ListMultipartUploadsOutcome S3Client::ListMultipartUploads(const ListMultipartUploadsRequest& request) const |
2675 | { |
2676 | if (!request.BucketHasBeenSet()) |
2677 | { |
2678 | AWS_LOGSTREAM_ERROR("ListMultipartUploads" , "Required field: Bucket, is not set" ); |
2679 | return ListMultipartUploadsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2680 | } |
2681 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2682 | if (!computeEndpointOutcome.IsSuccess()) |
2683 | { |
2684 | return ListMultipartUploadsOutcome(computeEndpointOutcome.GetError()); |
2685 | } |
2686 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2687 | Aws::StringStream ss; |
2688 | ss.str("?uploads" ); |
2689 | uri.SetQueryString(ss.str()); |
2690 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2691 | if(outcome.IsSuccess()) |
2692 | { |
2693 | return ListMultipartUploadsOutcome(ListMultipartUploadsResult(outcome.GetResult())); |
2694 | } |
2695 | else |
2696 | { |
2697 | return ListMultipartUploadsOutcome(outcome.GetError()); |
2698 | } |
2699 | } |
2700 | |
2701 | ListMultipartUploadsOutcomeCallable S3Client::ListMultipartUploadsCallable(const ListMultipartUploadsRequest& request) const |
2702 | { |
2703 | auto task = Aws::MakeShared< std::packaged_task< ListMultipartUploadsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListMultipartUploads(request); } ); |
2704 | auto packagedFunction = [task]() { (*task)(); }; |
2705 | m_executor->Submit(packagedFunction); |
2706 | return task->get_future(); |
2707 | } |
2708 | |
2709 | void S3Client::ListMultipartUploadsAsync(const ListMultipartUploadsRequest& request, const ListMultipartUploadsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2710 | { |
2711 | m_executor->Submit( [this, request, handler, context](){ this->ListMultipartUploadsAsyncHelper( request, handler, context ); } ); |
2712 | } |
2713 | |
2714 | void S3Client::ListMultipartUploadsAsyncHelper(const ListMultipartUploadsRequest& request, const ListMultipartUploadsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2715 | { |
2716 | handler(this, request, ListMultipartUploads(request), context); |
2717 | } |
2718 | |
2719 | ListObjectVersionsOutcome S3Client::ListObjectVersions(const ListObjectVersionsRequest& request) const |
2720 | { |
2721 | if (!request.BucketHasBeenSet()) |
2722 | { |
2723 | AWS_LOGSTREAM_ERROR("ListObjectVersions" , "Required field: Bucket, is not set" ); |
2724 | return ListObjectVersionsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2725 | } |
2726 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2727 | if (!computeEndpointOutcome.IsSuccess()) |
2728 | { |
2729 | return ListObjectVersionsOutcome(computeEndpointOutcome.GetError()); |
2730 | } |
2731 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2732 | Aws::StringStream ss; |
2733 | ss.str("?versions" ); |
2734 | uri.SetQueryString(ss.str()); |
2735 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2736 | if(outcome.IsSuccess()) |
2737 | { |
2738 | return ListObjectVersionsOutcome(ListObjectVersionsResult(outcome.GetResult())); |
2739 | } |
2740 | else |
2741 | { |
2742 | return ListObjectVersionsOutcome(outcome.GetError()); |
2743 | } |
2744 | } |
2745 | |
2746 | ListObjectVersionsOutcomeCallable S3Client::ListObjectVersionsCallable(const ListObjectVersionsRequest& request) const |
2747 | { |
2748 | auto task = Aws::MakeShared< std::packaged_task< ListObjectVersionsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListObjectVersions(request); } ); |
2749 | auto packagedFunction = [task]() { (*task)(); }; |
2750 | m_executor->Submit(packagedFunction); |
2751 | return task->get_future(); |
2752 | } |
2753 | |
2754 | void S3Client::ListObjectVersionsAsync(const ListObjectVersionsRequest& request, const ListObjectVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2755 | { |
2756 | m_executor->Submit( [this, request, handler, context](){ this->ListObjectVersionsAsyncHelper( request, handler, context ); } ); |
2757 | } |
2758 | |
2759 | void S3Client::ListObjectVersionsAsyncHelper(const ListObjectVersionsRequest& request, const ListObjectVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2760 | { |
2761 | handler(this, request, ListObjectVersions(request), context); |
2762 | } |
2763 | |
2764 | ListObjectsOutcome S3Client::ListObjects(const ListObjectsRequest& request) const |
2765 | { |
2766 | if (!request.BucketHasBeenSet()) |
2767 | { |
2768 | AWS_LOGSTREAM_ERROR("ListObjects" , "Required field: Bucket, is not set" ); |
2769 | return ListObjectsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2770 | } |
2771 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2772 | if (!computeEndpointOutcome.IsSuccess()) |
2773 | { |
2774 | return ListObjectsOutcome(computeEndpointOutcome.GetError()); |
2775 | } |
2776 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2777 | Aws::StringStream ss; |
2778 | uri.SetPath(uri.GetPath() + ss.str()); |
2779 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2780 | if(outcome.IsSuccess()) |
2781 | { |
2782 | return ListObjectsOutcome(ListObjectsResult(outcome.GetResult())); |
2783 | } |
2784 | else |
2785 | { |
2786 | return ListObjectsOutcome(outcome.GetError()); |
2787 | } |
2788 | } |
2789 | |
2790 | ListObjectsOutcomeCallable S3Client::ListObjectsCallable(const ListObjectsRequest& request) const |
2791 | { |
2792 | auto task = Aws::MakeShared< std::packaged_task< ListObjectsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListObjects(request); } ); |
2793 | auto packagedFunction = [task]() { (*task)(); }; |
2794 | m_executor->Submit(packagedFunction); |
2795 | return task->get_future(); |
2796 | } |
2797 | |
2798 | void S3Client::ListObjectsAsync(const ListObjectsRequest& request, const ListObjectsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2799 | { |
2800 | m_executor->Submit( [this, request, handler, context](){ this->ListObjectsAsyncHelper( request, handler, context ); } ); |
2801 | } |
2802 | |
2803 | void S3Client::ListObjectsAsyncHelper(const ListObjectsRequest& request, const ListObjectsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2804 | { |
2805 | handler(this, request, ListObjects(request), context); |
2806 | } |
2807 | |
2808 | ListObjectsV2Outcome S3Client::ListObjectsV2(const ListObjectsV2Request& request) const |
2809 | { |
2810 | if (!request.BucketHasBeenSet()) |
2811 | { |
2812 | AWS_LOGSTREAM_ERROR("ListObjectsV2" , "Required field: Bucket, is not set" ); |
2813 | return ListObjectsV2Outcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2814 | } |
2815 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2816 | if (!computeEndpointOutcome.IsSuccess()) |
2817 | { |
2818 | return ListObjectsV2Outcome(computeEndpointOutcome.GetError()); |
2819 | } |
2820 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2821 | Aws::StringStream ss; |
2822 | ss.str("?list-type=2" ); |
2823 | uri.SetQueryString(ss.str()); |
2824 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2825 | if(outcome.IsSuccess()) |
2826 | { |
2827 | return ListObjectsV2Outcome(ListObjectsV2Result(outcome.GetResult())); |
2828 | } |
2829 | else |
2830 | { |
2831 | return ListObjectsV2Outcome(outcome.GetError()); |
2832 | } |
2833 | } |
2834 | |
2835 | ListObjectsV2OutcomeCallable S3Client::ListObjectsV2Callable(const ListObjectsV2Request& request) const |
2836 | { |
2837 | auto task = Aws::MakeShared< std::packaged_task< ListObjectsV2Outcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListObjectsV2(request); } ); |
2838 | auto packagedFunction = [task]() { (*task)(); }; |
2839 | m_executor->Submit(packagedFunction); |
2840 | return task->get_future(); |
2841 | } |
2842 | |
2843 | void S3Client::ListObjectsV2Async(const ListObjectsV2Request& request, const ListObjectsV2ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2844 | { |
2845 | m_executor->Submit( [this, request, handler, context](){ this->ListObjectsV2AsyncHelper( request, handler, context ); } ); |
2846 | } |
2847 | |
2848 | void S3Client::ListObjectsV2AsyncHelper(const ListObjectsV2Request& request, const ListObjectsV2ResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2849 | { |
2850 | handler(this, request, ListObjectsV2(request), context); |
2851 | } |
2852 | |
2853 | ListPartsOutcome S3Client::ListParts(const ListPartsRequest& request) const |
2854 | { |
2855 | if (!request.BucketHasBeenSet()) |
2856 | { |
2857 | AWS_LOGSTREAM_ERROR("ListParts" , "Required field: Bucket, is not set" ); |
2858 | return ListPartsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2859 | } |
2860 | if (!request.KeyHasBeenSet()) |
2861 | { |
2862 | AWS_LOGSTREAM_ERROR("ListParts" , "Required field: Key, is not set" ); |
2863 | return ListPartsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
2864 | } |
2865 | if (!request.UploadIdHasBeenSet()) |
2866 | { |
2867 | AWS_LOGSTREAM_ERROR("ListParts" , "Required field: UploadId, is not set" ); |
2868 | return ListPartsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [UploadId]" , false)); |
2869 | } |
2870 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2871 | if (!computeEndpointOutcome.IsSuccess()) |
2872 | { |
2873 | return ListPartsOutcome(computeEndpointOutcome.GetError()); |
2874 | } |
2875 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2876 | Aws::StringStream ss; |
2877 | ss << "/" ; |
2878 | ss << request.GetKey(); |
2879 | uri.SetPath(uri.GetPath() + ss.str()); |
2880 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2881 | if(outcome.IsSuccess()) |
2882 | { |
2883 | return ListPartsOutcome(ListPartsResult(outcome.GetResult())); |
2884 | } |
2885 | else |
2886 | { |
2887 | return ListPartsOutcome(outcome.GetError()); |
2888 | } |
2889 | } |
2890 | |
2891 | ListPartsOutcomeCallable S3Client::ListPartsCallable(const ListPartsRequest& request) const |
2892 | { |
2893 | auto task = Aws::MakeShared< std::packaged_task< ListPartsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListParts(request); } ); |
2894 | auto packagedFunction = [task]() { (*task)(); }; |
2895 | m_executor->Submit(packagedFunction); |
2896 | return task->get_future(); |
2897 | } |
2898 | |
2899 | void S3Client::ListPartsAsync(const ListPartsRequest& request, const ListPartsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2900 | { |
2901 | m_executor->Submit( [this, request, handler, context](){ this->ListPartsAsyncHelper( request, handler, context ); } ); |
2902 | } |
2903 | |
2904 | void S3Client::ListPartsAsyncHelper(const ListPartsRequest& request, const ListPartsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2905 | { |
2906 | handler(this, request, ListParts(request), context); |
2907 | } |
2908 | |
2909 | PutBucketAccelerateConfigurationOutcome S3Client::PutBucketAccelerateConfiguration(const PutBucketAccelerateConfigurationRequest& request) const |
2910 | { |
2911 | if (!request.BucketHasBeenSet()) |
2912 | { |
2913 | AWS_LOGSTREAM_ERROR("PutBucketAccelerateConfiguration" , "Required field: Bucket, is not set" ); |
2914 | return PutBucketAccelerateConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2915 | } |
2916 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2917 | if (!computeEndpointOutcome.IsSuccess()) |
2918 | { |
2919 | return PutBucketAccelerateConfigurationOutcome(computeEndpointOutcome.GetError()); |
2920 | } |
2921 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2922 | Aws::StringStream ss; |
2923 | ss.str("?accelerate" ); |
2924 | uri.SetQueryString(ss.str()); |
2925 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2926 | if(outcome.IsSuccess()) |
2927 | { |
2928 | return PutBucketAccelerateConfigurationOutcome(NoResult()); |
2929 | } |
2930 | else |
2931 | { |
2932 | return PutBucketAccelerateConfigurationOutcome(outcome.GetError()); |
2933 | } |
2934 | } |
2935 | |
2936 | PutBucketAccelerateConfigurationOutcomeCallable S3Client::PutBucketAccelerateConfigurationCallable(const PutBucketAccelerateConfigurationRequest& request) const |
2937 | { |
2938 | auto task = Aws::MakeShared< std::packaged_task< PutBucketAccelerateConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketAccelerateConfiguration(request); } ); |
2939 | auto packagedFunction = [task]() { (*task)(); }; |
2940 | m_executor->Submit(packagedFunction); |
2941 | return task->get_future(); |
2942 | } |
2943 | |
2944 | void S3Client::PutBucketAccelerateConfigurationAsync(const PutBucketAccelerateConfigurationRequest& request, const PutBucketAccelerateConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2945 | { |
2946 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketAccelerateConfigurationAsyncHelper( request, handler, context ); } ); |
2947 | } |
2948 | |
2949 | void S3Client::PutBucketAccelerateConfigurationAsyncHelper(const PutBucketAccelerateConfigurationRequest& request, const PutBucketAccelerateConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2950 | { |
2951 | handler(this, request, PutBucketAccelerateConfiguration(request), context); |
2952 | } |
2953 | |
2954 | PutBucketAclOutcome S3Client::PutBucketAcl(const PutBucketAclRequest& request) const |
2955 | { |
2956 | if (!request.BucketHasBeenSet()) |
2957 | { |
2958 | AWS_LOGSTREAM_ERROR("PutBucketAcl" , "Required field: Bucket, is not set" ); |
2959 | return PutBucketAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
2960 | } |
2961 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
2962 | if (!computeEndpointOutcome.IsSuccess()) |
2963 | { |
2964 | return PutBucketAclOutcome(computeEndpointOutcome.GetError()); |
2965 | } |
2966 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
2967 | Aws::StringStream ss; |
2968 | ss.str("?acl" ); |
2969 | uri.SetQueryString(ss.str()); |
2970 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
2971 | if(outcome.IsSuccess()) |
2972 | { |
2973 | return PutBucketAclOutcome(NoResult()); |
2974 | } |
2975 | else |
2976 | { |
2977 | return PutBucketAclOutcome(outcome.GetError()); |
2978 | } |
2979 | } |
2980 | |
2981 | PutBucketAclOutcomeCallable S3Client::PutBucketAclCallable(const PutBucketAclRequest& request) const |
2982 | { |
2983 | auto task = Aws::MakeShared< std::packaged_task< PutBucketAclOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketAcl(request); } ); |
2984 | auto packagedFunction = [task]() { (*task)(); }; |
2985 | m_executor->Submit(packagedFunction); |
2986 | return task->get_future(); |
2987 | } |
2988 | |
2989 | void S3Client::PutBucketAclAsync(const PutBucketAclRequest& request, const PutBucketAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2990 | { |
2991 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketAclAsyncHelper( request, handler, context ); } ); |
2992 | } |
2993 | |
2994 | void S3Client::PutBucketAclAsyncHelper(const PutBucketAclRequest& request, const PutBucketAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
2995 | { |
2996 | handler(this, request, PutBucketAcl(request), context); |
2997 | } |
2998 | |
2999 | PutBucketAnalyticsConfigurationOutcome S3Client::PutBucketAnalyticsConfiguration(const PutBucketAnalyticsConfigurationRequest& request) const |
3000 | { |
3001 | if (!request.BucketHasBeenSet()) |
3002 | { |
3003 | AWS_LOGSTREAM_ERROR("PutBucketAnalyticsConfiguration" , "Required field: Bucket, is not set" ); |
3004 | return PutBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3005 | } |
3006 | if (!request.IdHasBeenSet()) |
3007 | { |
3008 | AWS_LOGSTREAM_ERROR("PutBucketAnalyticsConfiguration" , "Required field: Id, is not set" ); |
3009 | return PutBucketAnalyticsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
3010 | } |
3011 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3012 | if (!computeEndpointOutcome.IsSuccess()) |
3013 | { |
3014 | return PutBucketAnalyticsConfigurationOutcome(computeEndpointOutcome.GetError()); |
3015 | } |
3016 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3017 | Aws::StringStream ss; |
3018 | ss.str("?analytics" ); |
3019 | uri.SetQueryString(ss.str()); |
3020 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3021 | if(outcome.IsSuccess()) |
3022 | { |
3023 | return PutBucketAnalyticsConfigurationOutcome(NoResult()); |
3024 | } |
3025 | else |
3026 | { |
3027 | return PutBucketAnalyticsConfigurationOutcome(outcome.GetError()); |
3028 | } |
3029 | } |
3030 | |
3031 | PutBucketAnalyticsConfigurationOutcomeCallable S3Client::PutBucketAnalyticsConfigurationCallable(const PutBucketAnalyticsConfigurationRequest& request) const |
3032 | { |
3033 | auto task = Aws::MakeShared< std::packaged_task< PutBucketAnalyticsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketAnalyticsConfiguration(request); } ); |
3034 | auto packagedFunction = [task]() { (*task)(); }; |
3035 | m_executor->Submit(packagedFunction); |
3036 | return task->get_future(); |
3037 | } |
3038 | |
3039 | void S3Client::PutBucketAnalyticsConfigurationAsync(const PutBucketAnalyticsConfigurationRequest& request, const PutBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3040 | { |
3041 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketAnalyticsConfigurationAsyncHelper( request, handler, context ); } ); |
3042 | } |
3043 | |
3044 | void S3Client::PutBucketAnalyticsConfigurationAsyncHelper(const PutBucketAnalyticsConfigurationRequest& request, const PutBucketAnalyticsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3045 | { |
3046 | handler(this, request, PutBucketAnalyticsConfiguration(request), context); |
3047 | } |
3048 | |
3049 | PutBucketCorsOutcome S3Client::PutBucketCors(const PutBucketCorsRequest& request) const |
3050 | { |
3051 | if (!request.BucketHasBeenSet()) |
3052 | { |
3053 | AWS_LOGSTREAM_ERROR("PutBucketCors" , "Required field: Bucket, is not set" ); |
3054 | return PutBucketCorsOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3055 | } |
3056 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3057 | if (!computeEndpointOutcome.IsSuccess()) |
3058 | { |
3059 | return PutBucketCorsOutcome(computeEndpointOutcome.GetError()); |
3060 | } |
3061 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3062 | Aws::StringStream ss; |
3063 | ss.str("?cors" ); |
3064 | uri.SetQueryString(ss.str()); |
3065 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3066 | if(outcome.IsSuccess()) |
3067 | { |
3068 | return PutBucketCorsOutcome(NoResult()); |
3069 | } |
3070 | else |
3071 | { |
3072 | return PutBucketCorsOutcome(outcome.GetError()); |
3073 | } |
3074 | } |
3075 | |
3076 | PutBucketCorsOutcomeCallable S3Client::PutBucketCorsCallable(const PutBucketCorsRequest& request) const |
3077 | { |
3078 | auto task = Aws::MakeShared< std::packaged_task< PutBucketCorsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketCors(request); } ); |
3079 | auto packagedFunction = [task]() { (*task)(); }; |
3080 | m_executor->Submit(packagedFunction); |
3081 | return task->get_future(); |
3082 | } |
3083 | |
3084 | void S3Client::PutBucketCorsAsync(const PutBucketCorsRequest& request, const PutBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3085 | { |
3086 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketCorsAsyncHelper( request, handler, context ); } ); |
3087 | } |
3088 | |
3089 | void S3Client::PutBucketCorsAsyncHelper(const PutBucketCorsRequest& request, const PutBucketCorsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3090 | { |
3091 | handler(this, request, PutBucketCors(request), context); |
3092 | } |
3093 | |
3094 | PutBucketEncryptionOutcome S3Client::PutBucketEncryption(const PutBucketEncryptionRequest& request) const |
3095 | { |
3096 | if (!request.BucketHasBeenSet()) |
3097 | { |
3098 | AWS_LOGSTREAM_ERROR("PutBucketEncryption" , "Required field: Bucket, is not set" ); |
3099 | return PutBucketEncryptionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3100 | } |
3101 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3102 | if (!computeEndpointOutcome.IsSuccess()) |
3103 | { |
3104 | return PutBucketEncryptionOutcome(computeEndpointOutcome.GetError()); |
3105 | } |
3106 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3107 | Aws::StringStream ss; |
3108 | ss.str("?encryption" ); |
3109 | uri.SetQueryString(ss.str()); |
3110 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3111 | if(outcome.IsSuccess()) |
3112 | { |
3113 | return PutBucketEncryptionOutcome(NoResult()); |
3114 | } |
3115 | else |
3116 | { |
3117 | return PutBucketEncryptionOutcome(outcome.GetError()); |
3118 | } |
3119 | } |
3120 | |
3121 | PutBucketEncryptionOutcomeCallable S3Client::PutBucketEncryptionCallable(const PutBucketEncryptionRequest& request) const |
3122 | { |
3123 | auto task = Aws::MakeShared< std::packaged_task< PutBucketEncryptionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketEncryption(request); } ); |
3124 | auto packagedFunction = [task]() { (*task)(); }; |
3125 | m_executor->Submit(packagedFunction); |
3126 | return task->get_future(); |
3127 | } |
3128 | |
3129 | void S3Client::PutBucketEncryptionAsync(const PutBucketEncryptionRequest& request, const PutBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3130 | { |
3131 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketEncryptionAsyncHelper( request, handler, context ); } ); |
3132 | } |
3133 | |
3134 | void S3Client::PutBucketEncryptionAsyncHelper(const PutBucketEncryptionRequest& request, const PutBucketEncryptionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3135 | { |
3136 | handler(this, request, PutBucketEncryption(request), context); |
3137 | } |
3138 | |
3139 | PutBucketInventoryConfigurationOutcome S3Client::PutBucketInventoryConfiguration(const PutBucketInventoryConfigurationRequest& request) const |
3140 | { |
3141 | if (!request.BucketHasBeenSet()) |
3142 | { |
3143 | AWS_LOGSTREAM_ERROR("PutBucketInventoryConfiguration" , "Required field: Bucket, is not set" ); |
3144 | return PutBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3145 | } |
3146 | if (!request.IdHasBeenSet()) |
3147 | { |
3148 | AWS_LOGSTREAM_ERROR("PutBucketInventoryConfiguration" , "Required field: Id, is not set" ); |
3149 | return PutBucketInventoryConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
3150 | } |
3151 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3152 | if (!computeEndpointOutcome.IsSuccess()) |
3153 | { |
3154 | return PutBucketInventoryConfigurationOutcome(computeEndpointOutcome.GetError()); |
3155 | } |
3156 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3157 | Aws::StringStream ss; |
3158 | ss.str("?inventory" ); |
3159 | uri.SetQueryString(ss.str()); |
3160 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3161 | if(outcome.IsSuccess()) |
3162 | { |
3163 | return PutBucketInventoryConfigurationOutcome(NoResult()); |
3164 | } |
3165 | else |
3166 | { |
3167 | return PutBucketInventoryConfigurationOutcome(outcome.GetError()); |
3168 | } |
3169 | } |
3170 | |
3171 | PutBucketInventoryConfigurationOutcomeCallable S3Client::PutBucketInventoryConfigurationCallable(const PutBucketInventoryConfigurationRequest& request) const |
3172 | { |
3173 | auto task = Aws::MakeShared< std::packaged_task< PutBucketInventoryConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketInventoryConfiguration(request); } ); |
3174 | auto packagedFunction = [task]() { (*task)(); }; |
3175 | m_executor->Submit(packagedFunction); |
3176 | return task->get_future(); |
3177 | } |
3178 | |
3179 | void S3Client::PutBucketInventoryConfigurationAsync(const PutBucketInventoryConfigurationRequest& request, const PutBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3180 | { |
3181 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketInventoryConfigurationAsyncHelper( request, handler, context ); } ); |
3182 | } |
3183 | |
3184 | void S3Client::PutBucketInventoryConfigurationAsyncHelper(const PutBucketInventoryConfigurationRequest& request, const PutBucketInventoryConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3185 | { |
3186 | handler(this, request, PutBucketInventoryConfiguration(request), context); |
3187 | } |
3188 | |
3189 | PutBucketLifecycleConfigurationOutcome S3Client::PutBucketLifecycleConfiguration(const PutBucketLifecycleConfigurationRequest& request) const |
3190 | { |
3191 | if (!request.BucketHasBeenSet()) |
3192 | { |
3193 | AWS_LOGSTREAM_ERROR("PutBucketLifecycleConfiguration" , "Required field: Bucket, is not set" ); |
3194 | return PutBucketLifecycleConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3195 | } |
3196 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3197 | if (!computeEndpointOutcome.IsSuccess()) |
3198 | { |
3199 | return PutBucketLifecycleConfigurationOutcome(computeEndpointOutcome.GetError()); |
3200 | } |
3201 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3202 | Aws::StringStream ss; |
3203 | ss.str("?lifecycle" ); |
3204 | uri.SetQueryString(ss.str()); |
3205 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3206 | if(outcome.IsSuccess()) |
3207 | { |
3208 | return PutBucketLifecycleConfigurationOutcome(NoResult()); |
3209 | } |
3210 | else |
3211 | { |
3212 | return PutBucketLifecycleConfigurationOutcome(outcome.GetError()); |
3213 | } |
3214 | } |
3215 | |
3216 | PutBucketLifecycleConfigurationOutcomeCallable S3Client::PutBucketLifecycleConfigurationCallable(const PutBucketLifecycleConfigurationRequest& request) const |
3217 | { |
3218 | auto task = Aws::MakeShared< std::packaged_task< PutBucketLifecycleConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketLifecycleConfiguration(request); } ); |
3219 | auto packagedFunction = [task]() { (*task)(); }; |
3220 | m_executor->Submit(packagedFunction); |
3221 | return task->get_future(); |
3222 | } |
3223 | |
3224 | void S3Client::PutBucketLifecycleConfigurationAsync(const PutBucketLifecycleConfigurationRequest& request, const PutBucketLifecycleConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3225 | { |
3226 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketLifecycleConfigurationAsyncHelper( request, handler, context ); } ); |
3227 | } |
3228 | |
3229 | void S3Client::PutBucketLifecycleConfigurationAsyncHelper(const PutBucketLifecycleConfigurationRequest& request, const PutBucketLifecycleConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3230 | { |
3231 | handler(this, request, PutBucketLifecycleConfiguration(request), context); |
3232 | } |
3233 | |
3234 | PutBucketLoggingOutcome S3Client::PutBucketLogging(const PutBucketLoggingRequest& request) const |
3235 | { |
3236 | if (!request.BucketHasBeenSet()) |
3237 | { |
3238 | AWS_LOGSTREAM_ERROR("PutBucketLogging" , "Required field: Bucket, is not set" ); |
3239 | return PutBucketLoggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3240 | } |
3241 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3242 | if (!computeEndpointOutcome.IsSuccess()) |
3243 | { |
3244 | return PutBucketLoggingOutcome(computeEndpointOutcome.GetError()); |
3245 | } |
3246 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3247 | Aws::StringStream ss; |
3248 | ss.str("?logging" ); |
3249 | uri.SetQueryString(ss.str()); |
3250 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3251 | if(outcome.IsSuccess()) |
3252 | { |
3253 | return PutBucketLoggingOutcome(NoResult()); |
3254 | } |
3255 | else |
3256 | { |
3257 | return PutBucketLoggingOutcome(outcome.GetError()); |
3258 | } |
3259 | } |
3260 | |
3261 | PutBucketLoggingOutcomeCallable S3Client::PutBucketLoggingCallable(const PutBucketLoggingRequest& request) const |
3262 | { |
3263 | auto task = Aws::MakeShared< std::packaged_task< PutBucketLoggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketLogging(request); } ); |
3264 | auto packagedFunction = [task]() { (*task)(); }; |
3265 | m_executor->Submit(packagedFunction); |
3266 | return task->get_future(); |
3267 | } |
3268 | |
3269 | void S3Client::PutBucketLoggingAsync(const PutBucketLoggingRequest& request, const PutBucketLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3270 | { |
3271 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketLoggingAsyncHelper( request, handler, context ); } ); |
3272 | } |
3273 | |
3274 | void S3Client::PutBucketLoggingAsyncHelper(const PutBucketLoggingRequest& request, const PutBucketLoggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3275 | { |
3276 | handler(this, request, PutBucketLogging(request), context); |
3277 | } |
3278 | |
3279 | PutBucketMetricsConfigurationOutcome S3Client::PutBucketMetricsConfiguration(const PutBucketMetricsConfigurationRequest& request) const |
3280 | { |
3281 | if (!request.BucketHasBeenSet()) |
3282 | { |
3283 | AWS_LOGSTREAM_ERROR("PutBucketMetricsConfiguration" , "Required field: Bucket, is not set" ); |
3284 | return PutBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3285 | } |
3286 | if (!request.IdHasBeenSet()) |
3287 | { |
3288 | AWS_LOGSTREAM_ERROR("PutBucketMetricsConfiguration" , "Required field: Id, is not set" ); |
3289 | return PutBucketMetricsConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Id]" , false)); |
3290 | } |
3291 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3292 | if (!computeEndpointOutcome.IsSuccess()) |
3293 | { |
3294 | return PutBucketMetricsConfigurationOutcome(computeEndpointOutcome.GetError()); |
3295 | } |
3296 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3297 | Aws::StringStream ss; |
3298 | ss.str("?metrics" ); |
3299 | uri.SetQueryString(ss.str()); |
3300 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3301 | if(outcome.IsSuccess()) |
3302 | { |
3303 | return PutBucketMetricsConfigurationOutcome(NoResult()); |
3304 | } |
3305 | else |
3306 | { |
3307 | return PutBucketMetricsConfigurationOutcome(outcome.GetError()); |
3308 | } |
3309 | } |
3310 | |
3311 | PutBucketMetricsConfigurationOutcomeCallable S3Client::PutBucketMetricsConfigurationCallable(const PutBucketMetricsConfigurationRequest& request) const |
3312 | { |
3313 | auto task = Aws::MakeShared< std::packaged_task< PutBucketMetricsConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketMetricsConfiguration(request); } ); |
3314 | auto packagedFunction = [task]() { (*task)(); }; |
3315 | m_executor->Submit(packagedFunction); |
3316 | return task->get_future(); |
3317 | } |
3318 | |
3319 | void S3Client::PutBucketMetricsConfigurationAsync(const PutBucketMetricsConfigurationRequest& request, const PutBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3320 | { |
3321 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketMetricsConfigurationAsyncHelper( request, handler, context ); } ); |
3322 | } |
3323 | |
3324 | void S3Client::PutBucketMetricsConfigurationAsyncHelper(const PutBucketMetricsConfigurationRequest& request, const PutBucketMetricsConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3325 | { |
3326 | handler(this, request, PutBucketMetricsConfiguration(request), context); |
3327 | } |
3328 | |
3329 | PutBucketNotificationConfigurationOutcome S3Client::PutBucketNotificationConfiguration(const PutBucketNotificationConfigurationRequest& request) const |
3330 | { |
3331 | if (!request.BucketHasBeenSet()) |
3332 | { |
3333 | AWS_LOGSTREAM_ERROR("PutBucketNotificationConfiguration" , "Required field: Bucket, is not set" ); |
3334 | return PutBucketNotificationConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3335 | } |
3336 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3337 | if (!computeEndpointOutcome.IsSuccess()) |
3338 | { |
3339 | return PutBucketNotificationConfigurationOutcome(computeEndpointOutcome.GetError()); |
3340 | } |
3341 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3342 | Aws::StringStream ss; |
3343 | ss.str("?notification" ); |
3344 | uri.SetQueryString(ss.str()); |
3345 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3346 | if(outcome.IsSuccess()) |
3347 | { |
3348 | return PutBucketNotificationConfigurationOutcome(NoResult()); |
3349 | } |
3350 | else |
3351 | { |
3352 | return PutBucketNotificationConfigurationOutcome(outcome.GetError()); |
3353 | } |
3354 | } |
3355 | |
3356 | PutBucketNotificationConfigurationOutcomeCallable S3Client::PutBucketNotificationConfigurationCallable(const PutBucketNotificationConfigurationRequest& request) const |
3357 | { |
3358 | auto task = Aws::MakeShared< std::packaged_task< PutBucketNotificationConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketNotificationConfiguration(request); } ); |
3359 | auto packagedFunction = [task]() { (*task)(); }; |
3360 | m_executor->Submit(packagedFunction); |
3361 | return task->get_future(); |
3362 | } |
3363 | |
3364 | void S3Client::PutBucketNotificationConfigurationAsync(const PutBucketNotificationConfigurationRequest& request, const PutBucketNotificationConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3365 | { |
3366 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketNotificationConfigurationAsyncHelper( request, handler, context ); } ); |
3367 | } |
3368 | |
3369 | void S3Client::PutBucketNotificationConfigurationAsyncHelper(const PutBucketNotificationConfigurationRequest& request, const PutBucketNotificationConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3370 | { |
3371 | handler(this, request, PutBucketNotificationConfiguration(request), context); |
3372 | } |
3373 | |
3374 | PutBucketPolicyOutcome S3Client::PutBucketPolicy(const PutBucketPolicyRequest& request) const |
3375 | { |
3376 | if (!request.BucketHasBeenSet()) |
3377 | { |
3378 | AWS_LOGSTREAM_ERROR("PutBucketPolicy" , "Required field: Bucket, is not set" ); |
3379 | return PutBucketPolicyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3380 | } |
3381 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3382 | if (!computeEndpointOutcome.IsSuccess()) |
3383 | { |
3384 | return PutBucketPolicyOutcome(computeEndpointOutcome.GetError()); |
3385 | } |
3386 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3387 | Aws::StringStream ss; |
3388 | ss.str("?policy" ); |
3389 | uri.SetQueryString(ss.str()); |
3390 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3391 | if(outcome.IsSuccess()) |
3392 | { |
3393 | return PutBucketPolicyOutcome(NoResult()); |
3394 | } |
3395 | else |
3396 | { |
3397 | return PutBucketPolicyOutcome(outcome.GetError()); |
3398 | } |
3399 | } |
3400 | |
3401 | PutBucketPolicyOutcomeCallable S3Client::PutBucketPolicyCallable(const PutBucketPolicyRequest& request) const |
3402 | { |
3403 | auto task = Aws::MakeShared< std::packaged_task< PutBucketPolicyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketPolicy(request); } ); |
3404 | auto packagedFunction = [task]() { (*task)(); }; |
3405 | m_executor->Submit(packagedFunction); |
3406 | return task->get_future(); |
3407 | } |
3408 | |
3409 | void S3Client::PutBucketPolicyAsync(const PutBucketPolicyRequest& request, const PutBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3410 | { |
3411 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketPolicyAsyncHelper( request, handler, context ); } ); |
3412 | } |
3413 | |
3414 | void S3Client::PutBucketPolicyAsyncHelper(const PutBucketPolicyRequest& request, const PutBucketPolicyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3415 | { |
3416 | handler(this, request, PutBucketPolicy(request), context); |
3417 | } |
3418 | |
3419 | PutBucketReplicationOutcome S3Client::PutBucketReplication(const PutBucketReplicationRequest& request) const |
3420 | { |
3421 | if (!request.BucketHasBeenSet()) |
3422 | { |
3423 | AWS_LOGSTREAM_ERROR("PutBucketReplication" , "Required field: Bucket, is not set" ); |
3424 | return PutBucketReplicationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3425 | } |
3426 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3427 | if (!computeEndpointOutcome.IsSuccess()) |
3428 | { |
3429 | return PutBucketReplicationOutcome(computeEndpointOutcome.GetError()); |
3430 | } |
3431 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3432 | Aws::StringStream ss; |
3433 | ss.str("?replication" ); |
3434 | uri.SetQueryString(ss.str()); |
3435 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3436 | if(outcome.IsSuccess()) |
3437 | { |
3438 | return PutBucketReplicationOutcome(NoResult()); |
3439 | } |
3440 | else |
3441 | { |
3442 | return PutBucketReplicationOutcome(outcome.GetError()); |
3443 | } |
3444 | } |
3445 | |
3446 | PutBucketReplicationOutcomeCallable S3Client::PutBucketReplicationCallable(const PutBucketReplicationRequest& request) const |
3447 | { |
3448 | auto task = Aws::MakeShared< std::packaged_task< PutBucketReplicationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketReplication(request); } ); |
3449 | auto packagedFunction = [task]() { (*task)(); }; |
3450 | m_executor->Submit(packagedFunction); |
3451 | return task->get_future(); |
3452 | } |
3453 | |
3454 | void S3Client::PutBucketReplicationAsync(const PutBucketReplicationRequest& request, const PutBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3455 | { |
3456 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketReplicationAsyncHelper( request, handler, context ); } ); |
3457 | } |
3458 | |
3459 | void S3Client::PutBucketReplicationAsyncHelper(const PutBucketReplicationRequest& request, const PutBucketReplicationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3460 | { |
3461 | handler(this, request, PutBucketReplication(request), context); |
3462 | } |
3463 | |
3464 | PutBucketRequestPaymentOutcome S3Client::PutBucketRequestPayment(const PutBucketRequestPaymentRequest& request) const |
3465 | { |
3466 | if (!request.BucketHasBeenSet()) |
3467 | { |
3468 | AWS_LOGSTREAM_ERROR("PutBucketRequestPayment" , "Required field: Bucket, is not set" ); |
3469 | return PutBucketRequestPaymentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3470 | } |
3471 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3472 | if (!computeEndpointOutcome.IsSuccess()) |
3473 | { |
3474 | return PutBucketRequestPaymentOutcome(computeEndpointOutcome.GetError()); |
3475 | } |
3476 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3477 | Aws::StringStream ss; |
3478 | ss.str("?requestPayment" ); |
3479 | uri.SetQueryString(ss.str()); |
3480 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3481 | if(outcome.IsSuccess()) |
3482 | { |
3483 | return PutBucketRequestPaymentOutcome(NoResult()); |
3484 | } |
3485 | else |
3486 | { |
3487 | return PutBucketRequestPaymentOutcome(outcome.GetError()); |
3488 | } |
3489 | } |
3490 | |
3491 | PutBucketRequestPaymentOutcomeCallable S3Client::PutBucketRequestPaymentCallable(const PutBucketRequestPaymentRequest& request) const |
3492 | { |
3493 | auto task = Aws::MakeShared< std::packaged_task< PutBucketRequestPaymentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketRequestPayment(request); } ); |
3494 | auto packagedFunction = [task]() { (*task)(); }; |
3495 | m_executor->Submit(packagedFunction); |
3496 | return task->get_future(); |
3497 | } |
3498 | |
3499 | void S3Client::PutBucketRequestPaymentAsync(const PutBucketRequestPaymentRequest& request, const PutBucketRequestPaymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3500 | { |
3501 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketRequestPaymentAsyncHelper( request, handler, context ); } ); |
3502 | } |
3503 | |
3504 | void S3Client::PutBucketRequestPaymentAsyncHelper(const PutBucketRequestPaymentRequest& request, const PutBucketRequestPaymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3505 | { |
3506 | handler(this, request, PutBucketRequestPayment(request), context); |
3507 | } |
3508 | |
3509 | PutBucketTaggingOutcome S3Client::PutBucketTagging(const PutBucketTaggingRequest& request) const |
3510 | { |
3511 | if (!request.BucketHasBeenSet()) |
3512 | { |
3513 | AWS_LOGSTREAM_ERROR("PutBucketTagging" , "Required field: Bucket, is not set" ); |
3514 | return PutBucketTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3515 | } |
3516 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3517 | if (!computeEndpointOutcome.IsSuccess()) |
3518 | { |
3519 | return PutBucketTaggingOutcome(computeEndpointOutcome.GetError()); |
3520 | } |
3521 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3522 | Aws::StringStream ss; |
3523 | ss.str("?tagging" ); |
3524 | uri.SetQueryString(ss.str()); |
3525 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3526 | if(outcome.IsSuccess()) |
3527 | { |
3528 | return PutBucketTaggingOutcome(NoResult()); |
3529 | } |
3530 | else |
3531 | { |
3532 | return PutBucketTaggingOutcome(outcome.GetError()); |
3533 | } |
3534 | } |
3535 | |
3536 | PutBucketTaggingOutcomeCallable S3Client::PutBucketTaggingCallable(const PutBucketTaggingRequest& request) const |
3537 | { |
3538 | auto task = Aws::MakeShared< std::packaged_task< PutBucketTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketTagging(request); } ); |
3539 | auto packagedFunction = [task]() { (*task)(); }; |
3540 | m_executor->Submit(packagedFunction); |
3541 | return task->get_future(); |
3542 | } |
3543 | |
3544 | void S3Client::PutBucketTaggingAsync(const PutBucketTaggingRequest& request, const PutBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3545 | { |
3546 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketTaggingAsyncHelper( request, handler, context ); } ); |
3547 | } |
3548 | |
3549 | void S3Client::PutBucketTaggingAsyncHelper(const PutBucketTaggingRequest& request, const PutBucketTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3550 | { |
3551 | handler(this, request, PutBucketTagging(request), context); |
3552 | } |
3553 | |
3554 | PutBucketVersioningOutcome S3Client::PutBucketVersioning(const PutBucketVersioningRequest& request) const |
3555 | { |
3556 | if (!request.BucketHasBeenSet()) |
3557 | { |
3558 | AWS_LOGSTREAM_ERROR("PutBucketVersioning" , "Required field: Bucket, is not set" ); |
3559 | return PutBucketVersioningOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3560 | } |
3561 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3562 | if (!computeEndpointOutcome.IsSuccess()) |
3563 | { |
3564 | return PutBucketVersioningOutcome(computeEndpointOutcome.GetError()); |
3565 | } |
3566 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3567 | Aws::StringStream ss; |
3568 | ss.str("?versioning" ); |
3569 | uri.SetQueryString(ss.str()); |
3570 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3571 | if(outcome.IsSuccess()) |
3572 | { |
3573 | return PutBucketVersioningOutcome(NoResult()); |
3574 | } |
3575 | else |
3576 | { |
3577 | return PutBucketVersioningOutcome(outcome.GetError()); |
3578 | } |
3579 | } |
3580 | |
3581 | PutBucketVersioningOutcomeCallable S3Client::PutBucketVersioningCallable(const PutBucketVersioningRequest& request) const |
3582 | { |
3583 | auto task = Aws::MakeShared< std::packaged_task< PutBucketVersioningOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketVersioning(request); } ); |
3584 | auto packagedFunction = [task]() { (*task)(); }; |
3585 | m_executor->Submit(packagedFunction); |
3586 | return task->get_future(); |
3587 | } |
3588 | |
3589 | void S3Client::PutBucketVersioningAsync(const PutBucketVersioningRequest& request, const PutBucketVersioningResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3590 | { |
3591 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketVersioningAsyncHelper( request, handler, context ); } ); |
3592 | } |
3593 | |
3594 | void S3Client::PutBucketVersioningAsyncHelper(const PutBucketVersioningRequest& request, const PutBucketVersioningResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3595 | { |
3596 | handler(this, request, PutBucketVersioning(request), context); |
3597 | } |
3598 | |
3599 | PutBucketWebsiteOutcome S3Client::PutBucketWebsite(const PutBucketWebsiteRequest& request) const |
3600 | { |
3601 | if (!request.BucketHasBeenSet()) |
3602 | { |
3603 | AWS_LOGSTREAM_ERROR("PutBucketWebsite" , "Required field: Bucket, is not set" ); |
3604 | return PutBucketWebsiteOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3605 | } |
3606 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3607 | if (!computeEndpointOutcome.IsSuccess()) |
3608 | { |
3609 | return PutBucketWebsiteOutcome(computeEndpointOutcome.GetError()); |
3610 | } |
3611 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3612 | Aws::StringStream ss; |
3613 | ss.str("?website" ); |
3614 | uri.SetQueryString(ss.str()); |
3615 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3616 | if(outcome.IsSuccess()) |
3617 | { |
3618 | return PutBucketWebsiteOutcome(NoResult()); |
3619 | } |
3620 | else |
3621 | { |
3622 | return PutBucketWebsiteOutcome(outcome.GetError()); |
3623 | } |
3624 | } |
3625 | |
3626 | PutBucketWebsiteOutcomeCallable S3Client::PutBucketWebsiteCallable(const PutBucketWebsiteRequest& request) const |
3627 | { |
3628 | auto task = Aws::MakeShared< std::packaged_task< PutBucketWebsiteOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutBucketWebsite(request); } ); |
3629 | auto packagedFunction = [task]() { (*task)(); }; |
3630 | m_executor->Submit(packagedFunction); |
3631 | return task->get_future(); |
3632 | } |
3633 | |
3634 | void S3Client::PutBucketWebsiteAsync(const PutBucketWebsiteRequest& request, const PutBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3635 | { |
3636 | m_executor->Submit( [this, request, handler, context](){ this->PutBucketWebsiteAsyncHelper( request, handler, context ); } ); |
3637 | } |
3638 | |
3639 | void S3Client::PutBucketWebsiteAsyncHelper(const PutBucketWebsiteRequest& request, const PutBucketWebsiteResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3640 | { |
3641 | handler(this, request, PutBucketWebsite(request), context); |
3642 | } |
3643 | |
3644 | PutObjectOutcome S3Client::PutObject(const PutObjectRequest& request) const |
3645 | { |
3646 | if (!request.BucketHasBeenSet()) |
3647 | { |
3648 | AWS_LOGSTREAM_ERROR("PutObject" , "Required field: Bucket, is not set" ); |
3649 | return PutObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3650 | } |
3651 | if (!request.KeyHasBeenSet()) |
3652 | { |
3653 | AWS_LOGSTREAM_ERROR("PutObject" , "Required field: Key, is not set" ); |
3654 | return PutObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
3655 | } |
3656 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3657 | if (!computeEndpointOutcome.IsSuccess()) |
3658 | { |
3659 | return PutObjectOutcome(computeEndpointOutcome.GetError()); |
3660 | } |
3661 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3662 | Aws::StringStream ss; |
3663 | ss << "/" ; |
3664 | ss << request.GetKey(); |
3665 | uri.SetPath(uri.GetPath() + ss.str()); |
3666 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3667 | if(outcome.IsSuccess()) |
3668 | { |
3669 | return PutObjectOutcome(PutObjectResult(outcome.GetResult())); |
3670 | } |
3671 | else |
3672 | { |
3673 | return PutObjectOutcome(outcome.GetError()); |
3674 | } |
3675 | } |
3676 | |
3677 | PutObjectOutcomeCallable S3Client::PutObjectCallable(const PutObjectRequest& request) const |
3678 | { |
3679 | auto task = Aws::MakeShared< std::packaged_task< PutObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObject(request); } ); |
3680 | auto packagedFunction = [task]() { (*task)(); }; |
3681 | m_executor->Submit(packagedFunction); |
3682 | return task->get_future(); |
3683 | } |
3684 | |
3685 | void S3Client::PutObjectAsync(const PutObjectRequest& request, const PutObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3686 | { |
3687 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectAsyncHelper( request, handler, context ); } ); |
3688 | } |
3689 | |
3690 | void S3Client::PutObjectAsyncHelper(const PutObjectRequest& request, const PutObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3691 | { |
3692 | handler(this, request, PutObject(request), context); |
3693 | } |
3694 | |
3695 | PutObjectAclOutcome S3Client::PutObjectAcl(const PutObjectAclRequest& request) const |
3696 | { |
3697 | if (!request.BucketHasBeenSet()) |
3698 | { |
3699 | AWS_LOGSTREAM_ERROR("PutObjectAcl" , "Required field: Bucket, is not set" ); |
3700 | return PutObjectAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3701 | } |
3702 | if (!request.KeyHasBeenSet()) |
3703 | { |
3704 | AWS_LOGSTREAM_ERROR("PutObjectAcl" , "Required field: Key, is not set" ); |
3705 | return PutObjectAclOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
3706 | } |
3707 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3708 | if (!computeEndpointOutcome.IsSuccess()) |
3709 | { |
3710 | return PutObjectAclOutcome(computeEndpointOutcome.GetError()); |
3711 | } |
3712 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3713 | Aws::StringStream ss; |
3714 | ss << "/" ; |
3715 | ss << request.GetKey(); |
3716 | uri.SetPath(uri.GetPath() + ss.str()); |
3717 | ss.str("?acl" ); |
3718 | uri.SetQueryString(ss.str()); |
3719 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3720 | if(outcome.IsSuccess()) |
3721 | { |
3722 | return PutObjectAclOutcome(PutObjectAclResult(outcome.GetResult())); |
3723 | } |
3724 | else |
3725 | { |
3726 | return PutObjectAclOutcome(outcome.GetError()); |
3727 | } |
3728 | } |
3729 | |
3730 | PutObjectAclOutcomeCallable S3Client::PutObjectAclCallable(const PutObjectAclRequest& request) const |
3731 | { |
3732 | auto task = Aws::MakeShared< std::packaged_task< PutObjectAclOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObjectAcl(request); } ); |
3733 | auto packagedFunction = [task]() { (*task)(); }; |
3734 | m_executor->Submit(packagedFunction); |
3735 | return task->get_future(); |
3736 | } |
3737 | |
3738 | void S3Client::PutObjectAclAsync(const PutObjectAclRequest& request, const PutObjectAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3739 | { |
3740 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectAclAsyncHelper( request, handler, context ); } ); |
3741 | } |
3742 | |
3743 | void S3Client::PutObjectAclAsyncHelper(const PutObjectAclRequest& request, const PutObjectAclResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3744 | { |
3745 | handler(this, request, PutObjectAcl(request), context); |
3746 | } |
3747 | |
3748 | PutObjectLegalHoldOutcome S3Client::PutObjectLegalHold(const PutObjectLegalHoldRequest& request) const |
3749 | { |
3750 | if (!request.BucketHasBeenSet()) |
3751 | { |
3752 | AWS_LOGSTREAM_ERROR("PutObjectLegalHold" , "Required field: Bucket, is not set" ); |
3753 | return PutObjectLegalHoldOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3754 | } |
3755 | if (!request.KeyHasBeenSet()) |
3756 | { |
3757 | AWS_LOGSTREAM_ERROR("PutObjectLegalHold" , "Required field: Key, is not set" ); |
3758 | return PutObjectLegalHoldOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
3759 | } |
3760 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3761 | if (!computeEndpointOutcome.IsSuccess()) |
3762 | { |
3763 | return PutObjectLegalHoldOutcome(computeEndpointOutcome.GetError()); |
3764 | } |
3765 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3766 | Aws::StringStream ss; |
3767 | ss << "/" ; |
3768 | ss << request.GetKey(); |
3769 | uri.SetPath(uri.GetPath() + ss.str()); |
3770 | ss.str("?legal-hold" ); |
3771 | uri.SetQueryString(ss.str()); |
3772 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3773 | if(outcome.IsSuccess()) |
3774 | { |
3775 | return PutObjectLegalHoldOutcome(PutObjectLegalHoldResult(outcome.GetResult())); |
3776 | } |
3777 | else |
3778 | { |
3779 | return PutObjectLegalHoldOutcome(outcome.GetError()); |
3780 | } |
3781 | } |
3782 | |
3783 | PutObjectLegalHoldOutcomeCallable S3Client::PutObjectLegalHoldCallable(const PutObjectLegalHoldRequest& request) const |
3784 | { |
3785 | auto task = Aws::MakeShared< std::packaged_task< PutObjectLegalHoldOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObjectLegalHold(request); } ); |
3786 | auto packagedFunction = [task]() { (*task)(); }; |
3787 | m_executor->Submit(packagedFunction); |
3788 | return task->get_future(); |
3789 | } |
3790 | |
3791 | void S3Client::PutObjectLegalHoldAsync(const PutObjectLegalHoldRequest& request, const PutObjectLegalHoldResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3792 | { |
3793 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectLegalHoldAsyncHelper( request, handler, context ); } ); |
3794 | } |
3795 | |
3796 | void S3Client::PutObjectLegalHoldAsyncHelper(const PutObjectLegalHoldRequest& request, const PutObjectLegalHoldResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3797 | { |
3798 | handler(this, request, PutObjectLegalHold(request), context); |
3799 | } |
3800 | |
3801 | PutObjectLockConfigurationOutcome S3Client::PutObjectLockConfiguration(const PutObjectLockConfigurationRequest& request) const |
3802 | { |
3803 | if (!request.BucketHasBeenSet()) |
3804 | { |
3805 | AWS_LOGSTREAM_ERROR("PutObjectLockConfiguration" , "Required field: Bucket, is not set" ); |
3806 | return PutObjectLockConfigurationOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3807 | } |
3808 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3809 | if (!computeEndpointOutcome.IsSuccess()) |
3810 | { |
3811 | return PutObjectLockConfigurationOutcome(computeEndpointOutcome.GetError()); |
3812 | } |
3813 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3814 | Aws::StringStream ss; |
3815 | ss.str("?object-lock" ); |
3816 | uri.SetQueryString(ss.str()); |
3817 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3818 | if(outcome.IsSuccess()) |
3819 | { |
3820 | return PutObjectLockConfigurationOutcome(PutObjectLockConfigurationResult(outcome.GetResult())); |
3821 | } |
3822 | else |
3823 | { |
3824 | return PutObjectLockConfigurationOutcome(outcome.GetError()); |
3825 | } |
3826 | } |
3827 | |
3828 | PutObjectLockConfigurationOutcomeCallable S3Client::PutObjectLockConfigurationCallable(const PutObjectLockConfigurationRequest& request) const |
3829 | { |
3830 | auto task = Aws::MakeShared< std::packaged_task< PutObjectLockConfigurationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObjectLockConfiguration(request); } ); |
3831 | auto packagedFunction = [task]() { (*task)(); }; |
3832 | m_executor->Submit(packagedFunction); |
3833 | return task->get_future(); |
3834 | } |
3835 | |
3836 | void S3Client::PutObjectLockConfigurationAsync(const PutObjectLockConfigurationRequest& request, const PutObjectLockConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3837 | { |
3838 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectLockConfigurationAsyncHelper( request, handler, context ); } ); |
3839 | } |
3840 | |
3841 | void S3Client::PutObjectLockConfigurationAsyncHelper(const PutObjectLockConfigurationRequest& request, const PutObjectLockConfigurationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3842 | { |
3843 | handler(this, request, PutObjectLockConfiguration(request), context); |
3844 | } |
3845 | |
3846 | PutObjectRetentionOutcome S3Client::PutObjectRetention(const PutObjectRetentionRequest& request) const |
3847 | { |
3848 | if (!request.BucketHasBeenSet()) |
3849 | { |
3850 | AWS_LOGSTREAM_ERROR("PutObjectRetention" , "Required field: Bucket, is not set" ); |
3851 | return PutObjectRetentionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3852 | } |
3853 | if (!request.KeyHasBeenSet()) |
3854 | { |
3855 | AWS_LOGSTREAM_ERROR("PutObjectRetention" , "Required field: Key, is not set" ); |
3856 | return PutObjectRetentionOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
3857 | } |
3858 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3859 | if (!computeEndpointOutcome.IsSuccess()) |
3860 | { |
3861 | return PutObjectRetentionOutcome(computeEndpointOutcome.GetError()); |
3862 | } |
3863 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3864 | Aws::StringStream ss; |
3865 | ss << "/" ; |
3866 | ss << request.GetKey(); |
3867 | uri.SetPath(uri.GetPath() + ss.str()); |
3868 | ss.str("?retention" ); |
3869 | uri.SetQueryString(ss.str()); |
3870 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3871 | if(outcome.IsSuccess()) |
3872 | { |
3873 | return PutObjectRetentionOutcome(PutObjectRetentionResult(outcome.GetResult())); |
3874 | } |
3875 | else |
3876 | { |
3877 | return PutObjectRetentionOutcome(outcome.GetError()); |
3878 | } |
3879 | } |
3880 | |
3881 | PutObjectRetentionOutcomeCallable S3Client::PutObjectRetentionCallable(const PutObjectRetentionRequest& request) const |
3882 | { |
3883 | auto task = Aws::MakeShared< std::packaged_task< PutObjectRetentionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObjectRetention(request); } ); |
3884 | auto packagedFunction = [task]() { (*task)(); }; |
3885 | m_executor->Submit(packagedFunction); |
3886 | return task->get_future(); |
3887 | } |
3888 | |
3889 | void S3Client::PutObjectRetentionAsync(const PutObjectRetentionRequest& request, const PutObjectRetentionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3890 | { |
3891 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectRetentionAsyncHelper( request, handler, context ); } ); |
3892 | } |
3893 | |
3894 | void S3Client::PutObjectRetentionAsyncHelper(const PutObjectRetentionRequest& request, const PutObjectRetentionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3895 | { |
3896 | handler(this, request, PutObjectRetention(request), context); |
3897 | } |
3898 | |
3899 | PutObjectTaggingOutcome S3Client::PutObjectTagging(const PutObjectTaggingRequest& request) const |
3900 | { |
3901 | if (!request.BucketHasBeenSet()) |
3902 | { |
3903 | AWS_LOGSTREAM_ERROR("PutObjectTagging" , "Required field: Bucket, is not set" ); |
3904 | return PutObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3905 | } |
3906 | if (!request.KeyHasBeenSet()) |
3907 | { |
3908 | AWS_LOGSTREAM_ERROR("PutObjectTagging" , "Required field: Key, is not set" ); |
3909 | return PutObjectTaggingOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
3910 | } |
3911 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3912 | if (!computeEndpointOutcome.IsSuccess()) |
3913 | { |
3914 | return PutObjectTaggingOutcome(computeEndpointOutcome.GetError()); |
3915 | } |
3916 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3917 | Aws::StringStream ss; |
3918 | ss << "/" ; |
3919 | ss << request.GetKey(); |
3920 | uri.SetPath(uri.GetPath() + ss.str()); |
3921 | ss.str("?tagging" ); |
3922 | uri.SetQueryString(ss.str()); |
3923 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3924 | if(outcome.IsSuccess()) |
3925 | { |
3926 | return PutObjectTaggingOutcome(PutObjectTaggingResult(outcome.GetResult())); |
3927 | } |
3928 | else |
3929 | { |
3930 | return PutObjectTaggingOutcome(outcome.GetError()); |
3931 | } |
3932 | } |
3933 | |
3934 | PutObjectTaggingOutcomeCallable S3Client::PutObjectTaggingCallable(const PutObjectTaggingRequest& request) const |
3935 | { |
3936 | auto task = Aws::MakeShared< std::packaged_task< PutObjectTaggingOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutObjectTagging(request); } ); |
3937 | auto packagedFunction = [task]() { (*task)(); }; |
3938 | m_executor->Submit(packagedFunction); |
3939 | return task->get_future(); |
3940 | } |
3941 | |
3942 | void S3Client::PutObjectTaggingAsync(const PutObjectTaggingRequest& request, const PutObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3943 | { |
3944 | m_executor->Submit( [this, request, handler, context](){ this->PutObjectTaggingAsyncHelper( request, handler, context ); } ); |
3945 | } |
3946 | |
3947 | void S3Client::PutObjectTaggingAsyncHelper(const PutObjectTaggingRequest& request, const PutObjectTaggingResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3948 | { |
3949 | handler(this, request, PutObjectTagging(request), context); |
3950 | } |
3951 | |
3952 | PutPublicAccessBlockOutcome S3Client::PutPublicAccessBlock(const PutPublicAccessBlockRequest& request) const |
3953 | { |
3954 | if (!request.BucketHasBeenSet()) |
3955 | { |
3956 | AWS_LOGSTREAM_ERROR("PutPublicAccessBlock" , "Required field: Bucket, is not set" ); |
3957 | return PutPublicAccessBlockOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
3958 | } |
3959 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
3960 | if (!computeEndpointOutcome.IsSuccess()) |
3961 | { |
3962 | return PutPublicAccessBlockOutcome(computeEndpointOutcome.GetError()); |
3963 | } |
3964 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
3965 | Aws::StringStream ss; |
3966 | ss.str("?publicAccessBlock" ); |
3967 | uri.SetQueryString(ss.str()); |
3968 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
3969 | if(outcome.IsSuccess()) |
3970 | { |
3971 | return PutPublicAccessBlockOutcome(NoResult()); |
3972 | } |
3973 | else |
3974 | { |
3975 | return PutPublicAccessBlockOutcome(outcome.GetError()); |
3976 | } |
3977 | } |
3978 | |
3979 | PutPublicAccessBlockOutcomeCallable S3Client::PutPublicAccessBlockCallable(const PutPublicAccessBlockRequest& request) const |
3980 | { |
3981 | auto task = Aws::MakeShared< std::packaged_task< PutPublicAccessBlockOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->PutPublicAccessBlock(request); } ); |
3982 | auto packagedFunction = [task]() { (*task)(); }; |
3983 | m_executor->Submit(packagedFunction); |
3984 | return task->get_future(); |
3985 | } |
3986 | |
3987 | void S3Client::PutPublicAccessBlockAsync(const PutPublicAccessBlockRequest& request, const PutPublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3988 | { |
3989 | m_executor->Submit( [this, request, handler, context](){ this->PutPublicAccessBlockAsyncHelper( request, handler, context ); } ); |
3990 | } |
3991 | |
3992 | void S3Client::PutPublicAccessBlockAsyncHelper(const PutPublicAccessBlockRequest& request, const PutPublicAccessBlockResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
3993 | { |
3994 | handler(this, request, PutPublicAccessBlock(request), context); |
3995 | } |
3996 | |
3997 | RestoreObjectOutcome S3Client::RestoreObject(const RestoreObjectRequest& request) const |
3998 | { |
3999 | if (!request.BucketHasBeenSet()) |
4000 | { |
4001 | AWS_LOGSTREAM_ERROR("RestoreObject" , "Required field: Bucket, is not set" ); |
4002 | return RestoreObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
4003 | } |
4004 | if (!request.KeyHasBeenSet()) |
4005 | { |
4006 | AWS_LOGSTREAM_ERROR("RestoreObject" , "Required field: Key, is not set" ); |
4007 | return RestoreObjectOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
4008 | } |
4009 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
4010 | if (!computeEndpointOutcome.IsSuccess()) |
4011 | { |
4012 | return RestoreObjectOutcome(computeEndpointOutcome.GetError()); |
4013 | } |
4014 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
4015 | Aws::StringStream ss; |
4016 | ss << "/" ; |
4017 | ss << request.GetKey(); |
4018 | uri.SetPath(uri.GetPath() + ss.str()); |
4019 | ss.str("?restore" ); |
4020 | uri.SetQueryString(ss.str()); |
4021 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
4022 | if(outcome.IsSuccess()) |
4023 | { |
4024 | return RestoreObjectOutcome(RestoreObjectResult(outcome.GetResult())); |
4025 | } |
4026 | else |
4027 | { |
4028 | return RestoreObjectOutcome(outcome.GetError()); |
4029 | } |
4030 | } |
4031 | |
4032 | RestoreObjectOutcomeCallable S3Client::RestoreObjectCallable(const RestoreObjectRequest& request) const |
4033 | { |
4034 | auto task = Aws::MakeShared< std::packaged_task< RestoreObjectOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->RestoreObject(request); } ); |
4035 | auto packagedFunction = [task]() { (*task)(); }; |
4036 | m_executor->Submit(packagedFunction); |
4037 | return task->get_future(); |
4038 | } |
4039 | |
4040 | void S3Client::RestoreObjectAsync(const RestoreObjectRequest& request, const RestoreObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4041 | { |
4042 | m_executor->Submit( [this, request, handler, context](){ this->RestoreObjectAsyncHelper( request, handler, context ); } ); |
4043 | } |
4044 | |
4045 | void S3Client::RestoreObjectAsyncHelper(const RestoreObjectRequest& request, const RestoreObjectResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4046 | { |
4047 | handler(this, request, RestoreObject(request), context); |
4048 | } |
4049 | |
4050 | SelectObjectContentOutcome S3Client::SelectObjectContent(SelectObjectContentRequest& request) const |
4051 | { |
4052 | if (!request.BucketHasBeenSet()) |
4053 | { |
4054 | AWS_LOGSTREAM_ERROR("SelectObjectContent" , "Required field: Bucket, is not set" ); |
4055 | return SelectObjectContentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
4056 | } |
4057 | if (!request.KeyHasBeenSet()) |
4058 | { |
4059 | AWS_LOGSTREAM_ERROR("SelectObjectContent" , "Required field: Key, is not set" ); |
4060 | return SelectObjectContentOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
4061 | } |
4062 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
4063 | if (!computeEndpointOutcome.IsSuccess()) |
4064 | { |
4065 | return SelectObjectContentOutcome(computeEndpointOutcome.GetError()); |
4066 | } |
4067 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
4068 | Aws::StringStream ss; |
4069 | ss << "/" ; |
4070 | ss << request.GetKey(); |
4071 | uri.SetPath(uri.GetPath() + ss.str()); |
4072 | ss.str("?select&select-type=2" ); |
4073 | uri.SetQueryString(ss.str()); |
4074 | request.SetResponseStreamFactory( |
4075 | [&] { request.GetEventStreamDecoder().Reset(); return Aws::New<Aws::Utils::Event::EventDecoderStream>(ALLOCATION_TAG, request.GetEventStreamDecoder()); } |
4076 | ); |
4077 | XmlOutcome outcome = MakeRequestWithEventStream(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
4078 | if(outcome.IsSuccess()) |
4079 | { |
4080 | return SelectObjectContentOutcome(NoResult()); |
4081 | } |
4082 | else |
4083 | { |
4084 | return SelectObjectContentOutcome(outcome.GetError()); |
4085 | } |
4086 | } |
4087 | |
4088 | SelectObjectContentOutcomeCallable S3Client::SelectObjectContentCallable(SelectObjectContentRequest& request) const |
4089 | { |
4090 | auto task = Aws::MakeShared< std::packaged_task< SelectObjectContentOutcome() > >(ALLOCATION_TAG, [this, &request](){ return this->SelectObjectContent(request); } ); |
4091 | auto packagedFunction = [task]() { (*task)(); }; |
4092 | m_executor->Submit(packagedFunction); |
4093 | return task->get_future(); |
4094 | } |
4095 | |
4096 | void S3Client::SelectObjectContentAsync(SelectObjectContentRequest& request, const SelectObjectContentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4097 | { |
4098 | m_executor->Submit( [this, &request, handler, context](){ this->SelectObjectContentAsyncHelper( request, handler, context ); } ); |
4099 | } |
4100 | |
4101 | void S3Client::SelectObjectContentAsyncHelper(SelectObjectContentRequest& request, const SelectObjectContentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4102 | { |
4103 | handler(this, request, SelectObjectContent(request), context); |
4104 | } |
4105 | |
4106 | UploadPartOutcome S3Client::UploadPart(const UploadPartRequest& request) const |
4107 | { |
4108 | if (!request.BucketHasBeenSet()) |
4109 | { |
4110 | AWS_LOGSTREAM_ERROR("UploadPart" , "Required field: Bucket, is not set" ); |
4111 | return UploadPartOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
4112 | } |
4113 | if (!request.KeyHasBeenSet()) |
4114 | { |
4115 | AWS_LOGSTREAM_ERROR("UploadPart" , "Required field: Key, is not set" ); |
4116 | return UploadPartOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
4117 | } |
4118 | if (!request.PartNumberHasBeenSet()) |
4119 | { |
4120 | AWS_LOGSTREAM_ERROR("UploadPart" , "Required field: PartNumber, is not set" ); |
4121 | return UploadPartOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [PartNumber]" , false)); |
4122 | } |
4123 | if (!request.UploadIdHasBeenSet()) |
4124 | { |
4125 | AWS_LOGSTREAM_ERROR("UploadPart" , "Required field: UploadId, is not set" ); |
4126 | return UploadPartOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [UploadId]" , false)); |
4127 | } |
4128 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
4129 | if (!computeEndpointOutcome.IsSuccess()) |
4130 | { |
4131 | return UploadPartOutcome(computeEndpointOutcome.GetError()); |
4132 | } |
4133 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
4134 | Aws::StringStream ss; |
4135 | ss << "/" ; |
4136 | ss << request.GetKey(); |
4137 | uri.SetPath(uri.GetPath() + ss.str()); |
4138 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
4139 | if(outcome.IsSuccess()) |
4140 | { |
4141 | return UploadPartOutcome(UploadPartResult(outcome.GetResult())); |
4142 | } |
4143 | else |
4144 | { |
4145 | return UploadPartOutcome(outcome.GetError()); |
4146 | } |
4147 | } |
4148 | |
4149 | UploadPartOutcomeCallable S3Client::UploadPartCallable(const UploadPartRequest& request) const |
4150 | { |
4151 | auto task = Aws::MakeShared< std::packaged_task< UploadPartOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UploadPart(request); } ); |
4152 | auto packagedFunction = [task]() { (*task)(); }; |
4153 | m_executor->Submit(packagedFunction); |
4154 | return task->get_future(); |
4155 | } |
4156 | |
4157 | void S3Client::UploadPartAsync(const UploadPartRequest& request, const UploadPartResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4158 | { |
4159 | m_executor->Submit( [this, request, handler, context](){ this->UploadPartAsyncHelper( request, handler, context ); } ); |
4160 | } |
4161 | |
4162 | void S3Client::UploadPartAsyncHelper(const UploadPartRequest& request, const UploadPartResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4163 | { |
4164 | handler(this, request, UploadPart(request), context); |
4165 | } |
4166 | |
4167 | UploadPartCopyOutcome S3Client::UploadPartCopy(const UploadPartCopyRequest& request) const |
4168 | { |
4169 | if (!request.BucketHasBeenSet()) |
4170 | { |
4171 | AWS_LOGSTREAM_ERROR("UploadPartCopy" , "Required field: Bucket, is not set" ); |
4172 | return UploadPartCopyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Bucket]" , false)); |
4173 | } |
4174 | if (!request.CopySourceHasBeenSet()) |
4175 | { |
4176 | AWS_LOGSTREAM_ERROR("UploadPartCopy" , "Required field: CopySource, is not set" ); |
4177 | return UploadPartCopyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [CopySource]" , false)); |
4178 | } |
4179 | if (!request.KeyHasBeenSet()) |
4180 | { |
4181 | AWS_LOGSTREAM_ERROR("UploadPartCopy" , "Required field: Key, is not set" ); |
4182 | return UploadPartCopyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [Key]" , false)); |
4183 | } |
4184 | if (!request.PartNumberHasBeenSet()) |
4185 | { |
4186 | AWS_LOGSTREAM_ERROR("UploadPartCopy" , "Required field: PartNumber, is not set" ); |
4187 | return UploadPartCopyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [PartNumber]" , false)); |
4188 | } |
4189 | if (!request.UploadIdHasBeenSet()) |
4190 | { |
4191 | AWS_LOGSTREAM_ERROR("UploadPartCopy" , "Required field: UploadId, is not set" ); |
4192 | return UploadPartCopyOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::MISSING_PARAMETER, "MISSING_PARAMETER" , "Missing required field [UploadId]" , false)); |
4193 | } |
4194 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(request.GetBucket()); |
4195 | if (!computeEndpointOutcome.IsSuccess()) |
4196 | { |
4197 | return UploadPartCopyOutcome(computeEndpointOutcome.GetError()); |
4198 | } |
4199 | Aws::Http::URI uri = computeEndpointOutcome.GetResult().first; |
4200 | Aws::StringStream ss; |
4201 | ss << "/" ; |
4202 | ss << request.GetKey(); |
4203 | uri.SetPath(uri.GetPath() + ss.str()); |
4204 | XmlOutcome outcome = MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_PUT, Aws::Auth::SIGV4_SIGNER, computeEndpointOutcome.GetResult().second.c_str() /*signerRegionOverride*/); |
4205 | if(outcome.IsSuccess()) |
4206 | { |
4207 | return UploadPartCopyOutcome(UploadPartCopyResult(outcome.GetResult())); |
4208 | } |
4209 | else |
4210 | { |
4211 | return UploadPartCopyOutcome(outcome.GetError()); |
4212 | } |
4213 | } |
4214 | |
4215 | UploadPartCopyOutcomeCallable S3Client::UploadPartCopyCallable(const UploadPartCopyRequest& request) const |
4216 | { |
4217 | auto task = Aws::MakeShared< std::packaged_task< UploadPartCopyOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UploadPartCopy(request); } ); |
4218 | auto packagedFunction = [task]() { (*task)(); }; |
4219 | m_executor->Submit(packagedFunction); |
4220 | return task->get_future(); |
4221 | } |
4222 | |
4223 | void S3Client::UploadPartCopyAsync(const UploadPartCopyRequest& request, const UploadPartCopyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4224 | { |
4225 | m_executor->Submit( [this, request, handler, context](){ this->UploadPartCopyAsyncHelper( request, handler, context ); } ); |
4226 | } |
4227 | |
4228 | void S3Client::UploadPartCopyAsyncHelper(const UploadPartCopyRequest& request, const UploadPartCopyResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const |
4229 | { |
4230 | handler(this, request, UploadPartCopy(request), context); |
4231 | } |
4232 | |
4233 | |
4234 | |
4235 | |
4236 | #include<aws/core/platform/Environment.h> |
4237 | |
4238 | static const char US_EAST_1_REGIONAL_ENDPOINT_ENV_VAR[] = "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT" ; |
4239 | static const char US_EAST_1_REGIONAL_ENDPOINT_CONFIG_VAR[] = "s3_us_east_1_regional_endpoint" ; |
4240 | static const char S3_USE_ARN_REGION_ENVIRONMENT_VARIABLE[] = "AWS_S3_USE_ARN_REGION" ; |
4241 | static const char S3_USE_ARN_REGION_CONFIG_FILE_OPTION[] = "s3_use_arn_region" ; |
4242 | |
4243 | void S3Client::LoadS3SpecificConfig(const Aws::String& profile) |
4244 | { |
4245 | if (m_USEast1RegionalEndpointOption == Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET) |
4246 | { |
4247 | Aws::String option = Aws::Environment::GetEnv(US_EAST_1_REGIONAL_ENDPOINT_ENV_VAR); |
4248 | if (option.empty()) |
4249 | { |
4250 | option = Aws::Config::GetCachedConfigValue(profile, US_EAST_1_REGIONAL_ENDPOINT_CONFIG_VAR); |
4251 | } |
4252 | |
4253 | if (Aws::Utils::StringUtils::ToLower(option.c_str()) == "regional" ) |
4254 | { |
4255 | m_USEast1RegionalEndpointOption = Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION::REGIONAL; |
4256 | } |
4257 | else // defaults is legacy |
4258 | { |
4259 | m_USEast1RegionalEndpointOption = Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION::LEGACY; |
4260 | } |
4261 | } |
4262 | |
4263 | Aws::String s3UseArnRegion = Aws::Environment::GetEnv(S3_USE_ARN_REGION_ENVIRONMENT_VARIABLE); |
4264 | if (s3UseArnRegion.empty()) |
4265 | { |
4266 | s3UseArnRegion = Aws::Config::GetCachedConfigValue(profile, S3_USE_ARN_REGION_CONFIG_FILE_OPTION); |
4267 | } |
4268 | |
4269 | if (s3UseArnRegion == "true" ) |
4270 | { |
4271 | m_useArnRegion = true; |
4272 | } |
4273 | else |
4274 | { |
4275 | if (!s3UseArnRegion.empty() && s3UseArnRegion != "false" ) |
4276 | { |
4277 | AWS_LOGSTREAM_WARN("S3Client" , "AWS_S3_USE_ARN_REGION in environment variables or s3_use_arn_region in config file" |
4278 | << "should either be true of false if specified, otherwise turn off this flag by default." ); |
4279 | } |
4280 | m_useArnRegion = false; |
4281 | } |
4282 | } |
4283 | |
4284 | #include<aws/core/utils/HashingUtils.h> |
4285 | Aws::String S3Client::GeneratePresignedUrl(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, long long expirationInSeconds) |
4286 | { |
4287 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4288 | if (!computeEndpointOutcome.IsSuccess()) |
4289 | { |
4290 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4291 | return {}; |
4292 | } |
4293 | Aws::StringStream ss; |
4294 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4295 | URI uri(ss.str()); |
4296 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), expirationInSeconds); |
4297 | } |
4298 | |
4299 | Aws::String S3Client::GeneratePresignedUrl(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, const Http::HeaderValueCollection& , long long expirationInSeconds) |
4300 | { |
4301 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4302 | if (!computeEndpointOutcome.IsSuccess()) |
4303 | { |
4304 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4305 | return {}; |
4306 | } |
4307 | Aws::StringStream ss; |
4308 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4309 | URI uri(ss.str()); |
4310 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), customizedHeaders, expirationInSeconds); |
4311 | } |
4312 | |
4313 | Aws::String S3Client::GeneratePresignedUrlWithSSES3(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, long long expirationInSeconds) |
4314 | { |
4315 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4316 | if (!computeEndpointOutcome.IsSuccess()) |
4317 | { |
4318 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4319 | return {}; |
4320 | } |
4321 | Aws::StringStream ss; |
4322 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4323 | URI uri(ss.str()); |
4324 | Aws::Http::HeaderValueCollection ; |
4325 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::AES256)); |
4326 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), headers, expirationInSeconds); |
4327 | } |
4328 | |
4329 | Aws::String S3Client::GeneratePresignedUrlWithSSES3(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, Http::HeaderValueCollection , long long expirationInSeconds) |
4330 | { |
4331 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4332 | if (!computeEndpointOutcome.IsSuccess()) |
4333 | { |
4334 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4335 | return {}; |
4336 | } |
4337 | Aws::StringStream ss; |
4338 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4339 | URI uri(ss.str()); |
4340 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::AES256)); |
4341 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), customizedHeaders, expirationInSeconds); |
4342 | } |
4343 | |
4344 | Aws::String S3Client::GeneratePresignedUrlWithSSEKMS(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, const Aws::String& kmsMasterKeyId, long long expirationInSeconds) |
4345 | { |
4346 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4347 | if (!computeEndpointOutcome.IsSuccess()) |
4348 | { |
4349 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4350 | return {}; |
4351 | } |
4352 | Aws::StringStream ss; |
4353 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4354 | URI uri(ss.str()); |
4355 | Aws::Http::HeaderValueCollection ; |
4356 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::aws_kms)); |
4357 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_AWS_KMS_KEY_ID, kmsMasterKeyId); |
4358 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), headers, expirationInSeconds); |
4359 | } |
4360 | |
4361 | Aws::String S3Client::GeneratePresignedUrlWithSSEKMS(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, Http::HeaderValueCollection , const Aws::String& kmsMasterKeyId, long long expirationInSeconds) |
4362 | { |
4363 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4364 | if (!computeEndpointOutcome.IsSuccess()) |
4365 | { |
4366 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4367 | return {}; |
4368 | } |
4369 | Aws::StringStream ss; |
4370 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4371 | URI uri(ss.str()); |
4372 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::aws_kms)); |
4373 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_AWS_KMS_KEY_ID, kmsMasterKeyId); |
4374 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), customizedHeaders, expirationInSeconds); |
4375 | } |
4376 | |
4377 | Aws::String S3Client::GeneratePresignedUrlWithSSEC(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, const Aws::String& base64EncodedAES256Key, long long expirationInSeconds) |
4378 | { |
4379 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4380 | if (!computeEndpointOutcome.IsSuccess()) |
4381 | { |
4382 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4383 | return {}; |
4384 | } |
4385 | Aws::StringStream ss; |
4386 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4387 | URI uri(ss.str()); |
4388 | Aws::Http::HeaderValueCollection ; |
4389 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::AES256)); |
4390 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY, base64EncodedAES256Key); |
4391 | Aws::Utils::ByteBuffer buffer = Aws::Utils::HashingUtils::Base64Decode(base64EncodedAES256Key); |
4392 | Aws::String strBuffer(reinterpret_cast<char*>(buffer.GetUnderlyingData()), buffer.GetLength()); |
4393 | headers.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5, Aws::Utils::HashingUtils::Base64Encode(Aws::Utils::HashingUtils::CalculateMD5(strBuffer))); |
4394 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), headers, expirationInSeconds); |
4395 | } |
4396 | |
4397 | Aws::String S3Client::GeneratePresignedUrlWithSSEC(const Aws::String& bucket, const Aws::String& key, Aws::Http::HttpMethod method, Http::HeaderValueCollection , const Aws::String& base64EncodedAES256Key, long long expirationInSeconds) |
4398 | { |
4399 | ComputeEndpointOutcome computeEndpointOutcome = ComputeEndpointString(bucket); |
4400 | if (!computeEndpointOutcome.IsSuccess()) |
4401 | { |
4402 | AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Presigned URL generating failed. Encountered error: " << computeEndpointOutcome.GetError()); |
4403 | return {}; |
4404 | } |
4405 | Aws::StringStream ss; |
4406 | ss << computeEndpointOutcome.GetResult().first << "/" << key; |
4407 | URI uri(ss.str()); |
4408 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM, Aws::S3::Model::ServerSideEncryptionMapper::GetNameForServerSideEncryption(Aws::S3::Model::ServerSideEncryption::AES256)); |
4409 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY, base64EncodedAES256Key); |
4410 | Aws::Utils::ByteBuffer buffer = Aws::Utils::HashingUtils::Base64Decode(base64EncodedAES256Key); |
4411 | Aws::String strBuffer(reinterpret_cast<char*>(buffer.GetUnderlyingData()), buffer.GetLength()); |
4412 | customizedHeaders.emplace(Aws::S3::SSEHeaders::SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5, Aws::Utils::HashingUtils::Base64Encode(Aws::Utils::HashingUtils::CalculateMD5(strBuffer))); |
4413 | return AWSClient::GeneratePresignedUrl(uri, method, computeEndpointOutcome.GetResult().second.c_str(), customizedHeaders, expirationInSeconds); |
4414 | } |
4415 | |
4416 | ComputeEndpointOutcome S3Client::ComputeEndpointString(const Aws::String& bucketOrArn) const |
4417 | { |
4418 | Aws::StringStream ss; |
4419 | Aws::String bucket = bucketOrArn; |
4420 | Aws::String signerRegion = m_region; |
4421 | S3ARN arn(bucketOrArn); |
4422 | |
4423 | if (arn) |
4424 | { |
4425 | if (m_useCustomEndpoint) |
4426 | { |
4427 | return ComputeEndpointOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::VALIDATION, "VALIDATION" , |
4428 | "Custom endpoint is not compatible with Access Point ARN in Bucket field." , false)); |
4429 | } |
4430 | |
4431 | if (!m_useVirtualAddressing) |
4432 | { |
4433 | return ComputeEndpointOutcome(Aws::Client::AWSError<S3Errors>(S3Errors::VALIDATION, "VALIDATION" , |
4434 | "Path style addressing is not compatible with Access Point ARN in Bucket field, please consider using virtual addressing for this client instead." , false)); |
4435 | } |
4436 | |
4437 | S3ARNOutcome s3ArnOutcome = m_useArnRegion ? arn.Validate() : arn.Validate(m_region.c_str()); |
4438 | if (!s3ArnOutcome.IsSuccess()) |
4439 | { |
4440 | return ComputeEndpointOutcome(s3ArnOutcome.GetError()); |
4441 | } |
4442 | if (arn.GetResourceType() == ARNResourceType::ACCESSPOINT) |
4443 | { |
4444 | ss << m_scheme << "://" << S3Endpoint::ForAccessPointArn(arn, m_useArnRegion ? "" : m_region, m_useDualStack); |
4445 | signerRegion = m_useArnRegion ? arn.GetRegion() : m_region; |
4446 | if (signerRegion == "fips-us-gov-west-1" ) |
4447 | { |
4448 | signerRegion = "us-gov-west-1" ; |
4449 | } |
4450 | return ComputeEndpointOutcome(EndpointRegionPair(ss.str(), signerRegion)); |
4451 | } |
4452 | } |
4453 | |
4454 | // when using virtual hosting of buckets, the bucket name has to follow some rules. |
4455 | // Mainly, it has to be a valid DNS label, and it must be lowercase. |
4456 | // For more information see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket |
4457 | if(m_useVirtualAddressing && Aws::Utils::IsValidDnsLabel(bucket) && |
4458 | bucket == Aws::Utils::StringUtils::ToLower(bucket.c_str())) |
4459 | { |
4460 | ss << m_scheme << "://" << bucket << "." << m_baseUri; |
4461 | } |
4462 | else |
4463 | { |
4464 | ss << m_scheme << "://" << m_baseUri << "/" << bucket; |
4465 | } |
4466 | |
4467 | if (m_region == "fips-us-gov-west-1" ) |
4468 | { |
4469 | signerRegion = "us-gov-west-1" ; |
4470 | } |
4471 | |
4472 | return ComputeEndpointOutcome(EndpointRegionPair(ss.str(), signerRegion)); |
4473 | } |
4474 | |
4475 | ComputeEndpointOutcome S3Client::ComputeEndpointString() const |
4476 | { |
4477 | Aws::String signerRegion = m_region; |
4478 | Aws::StringStream ss; |
4479 | ss << m_scheme << "://" << m_baseUri; |
4480 | if (m_region == "fips-us-gov-west-1" ) |
4481 | { |
4482 | signerRegion = "us-gov-west-1" ; |
4483 | } |
4484 | return ComputeEndpointOutcome(EndpointRegionPair(ss.str(), signerRegion)); |
4485 | } |
4486 | |
4487 | bool S3Client::MultipartUploadSupported() const |
4488 | { |
4489 | return true; |
4490 | } |
4491 | |