1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5 * the License. A copy of the License is located at
6 *
7 * http://aws.amazon.com/apache2.0
8 *
9 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11 * and limitations under the License.
12 */
13
14 package software.amazon.awssdk.services.s3;
15
16 import java.util.function.Consumer;
17 import software.amazon.awssdk.annotations.Generated;
18 import software.amazon.awssdk.annotations.SdkInternalApi;
19 import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
20 import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
21 import software.amazon.awssdk.awscore.exception.AwsServiceException;
22 import software.amazon.awssdk.core.ApiName;
23 import software.amazon.awssdk.core.Response;
24 import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
25 import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
26 import software.amazon.awssdk.core.client.handler.SyncClientHandler;
27 import software.amazon.awssdk.core.exception.SdkClientException;
28 import software.amazon.awssdk.core.http.HttpResponseHandler;
29 import software.amazon.awssdk.core.runtime.transform.StreamingRequestMarshaller;
30 import software.amazon.awssdk.core.sync.RequestBody;
31 import software.amazon.awssdk.core.sync.ResponseTransformer;
32 import software.amazon.awssdk.core.util.VersionInfo;
33 import software.amazon.awssdk.protocols.core.ExceptionMetadata;
34 import software.amazon.awssdk.protocols.xml.AwsS3ProtocolFactory;
35 import software.amazon.awssdk.protocols.xml.XmlOperationMetadata;
36 import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest;
37 import software.amazon.awssdk.services.s3.model.AbortMultipartUploadResponse;
38 import software.amazon.awssdk.services.s3.model.BucketAlreadyExistsException;
39 import software.amazon.awssdk.services.s3.model.BucketAlreadyOwnedByYouException;
40 import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest;
41 import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadResponse;
42 import software.amazon.awssdk.services.s3.model.CopyObjectRequest;
43 import software.amazon.awssdk.services.s3.model.CopyObjectResponse;
44 import software.amazon.awssdk.services.s3.model.CreateBucketRequest;
45 import software.amazon.awssdk.services.s3.model.CreateBucketResponse;
46 import software.amazon.awssdk.services.s3.model.CreateMultipartUploadRequest;
47 import software.amazon.awssdk.services.s3.model.CreateMultipartUploadResponse;
48 import software.amazon.awssdk.services.s3.model.DeleteBucketAnalyticsConfigurationRequest;
49 import software.amazon.awssdk.services.s3.model.DeleteBucketAnalyticsConfigurationResponse;
50 import software.amazon.awssdk.services.s3.model.DeleteBucketCorsRequest;
51 import software.amazon.awssdk.services.s3.model.DeleteBucketCorsResponse;
52 import software.amazon.awssdk.services.s3.model.DeleteBucketEncryptionRequest;
53 import software.amazon.awssdk.services.s3.model.DeleteBucketEncryptionResponse;
54 import software.amazon.awssdk.services.s3.model.DeleteBucketInventoryConfigurationRequest;
55 import software.amazon.awssdk.services.s3.model.DeleteBucketInventoryConfigurationResponse;
56 import software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleRequest;
57 import software.amazon.awssdk.services.s3.model.DeleteBucketLifecycleResponse;
58 import software.amazon.awssdk.services.s3.model.DeleteBucketMetricsConfigurationRequest;
59 import software.amazon.awssdk.services.s3.model.DeleteBucketMetricsConfigurationResponse;
60 import software.amazon.awssdk.services.s3.model.DeleteBucketPolicyRequest;
61 import software.amazon.awssdk.services.s3.model.DeleteBucketPolicyResponse;
62 import software.amazon.awssdk.services.s3.model.DeleteBucketReplicationRequest;
63 import software.amazon.awssdk.services.s3.model.DeleteBucketReplicationResponse;
64 import software.amazon.awssdk.services.s3.model.DeleteBucketRequest;
65 import software.amazon.awssdk.services.s3.model.DeleteBucketResponse;
66 import software.amazon.awssdk.services.s3.model.DeleteBucketTaggingRequest;
67 import software.amazon.awssdk.services.s3.model.DeleteBucketTaggingResponse;
68 import software.amazon.awssdk.services.s3.model.DeleteBucketWebsiteRequest;
69 import software.amazon.awssdk.services.s3.model.DeleteBucketWebsiteResponse;
70 import software.amazon.awssdk.services.s3.model.DeleteObjectRequest;
71 import software.amazon.awssdk.services.s3.model.DeleteObjectResponse;
72 import software.amazon.awssdk.services.s3.model.DeleteObjectTaggingRequest;
73 import software.amazon.awssdk.services.s3.model.DeleteObjectTaggingResponse;
74 import software.amazon.awssdk.services.s3.model.DeleteObjectsRequest;
75 import software.amazon.awssdk.services.s3.model.DeleteObjectsResponse;
76 import software.amazon.awssdk.services.s3.model.DeletePublicAccessBlockRequest;
77 import software.amazon.awssdk.services.s3.model.DeletePublicAccessBlockResponse;
78 import software.amazon.awssdk.services.s3.model.GetBucketAccelerateConfigurationRequest;
79 import software.amazon.awssdk.services.s3.model.GetBucketAccelerateConfigurationResponse;
80 import software.amazon.awssdk.services.s3.model.GetBucketAclRequest;
81 import software.amazon.awssdk.services.s3.model.GetBucketAclResponse;
82 import software.amazon.awssdk.services.s3.model.GetBucketAnalyticsConfigurationRequest;
83 import software.amazon.awssdk.services.s3.model.GetBucketAnalyticsConfigurationResponse;
84 import software.amazon.awssdk.services.s3.model.GetBucketCorsRequest;
85 import software.amazon.awssdk.services.s3.model.GetBucketCorsResponse;
86 import software.amazon.awssdk.services.s3.model.GetBucketEncryptionRequest;
87 import software.amazon.awssdk.services.s3.model.GetBucketEncryptionResponse;
88 import software.amazon.awssdk.services.s3.model.GetBucketInventoryConfigurationRequest;
89 import software.amazon.awssdk.services.s3.model.GetBucketInventoryConfigurationResponse;
90 import software.amazon.awssdk.services.s3.model.GetBucketLifecycleConfigurationRequest;
91 import software.amazon.awssdk.services.s3.model.GetBucketLifecycleConfigurationResponse;
92 import software.amazon.awssdk.services.s3.model.GetBucketLocationRequest;
93 import software.amazon.awssdk.services.s3.model.GetBucketLocationResponse;
94 import software.amazon.awssdk.services.s3.model.GetBucketLoggingRequest;
95 import software.amazon.awssdk.services.s3.model.GetBucketLoggingResponse;
96 import software.amazon.awssdk.services.s3.model.GetBucketMetricsConfigurationRequest;
97 import software.amazon.awssdk.services.s3.model.GetBucketMetricsConfigurationResponse;
98 import software.amazon.awssdk.services.s3.model.GetBucketNotificationConfigurationRequest;
99 import software.amazon.awssdk.services.s3.model.GetBucketNotificationConfigurationResponse;
100 import software.amazon.awssdk.services.s3.model.GetBucketPolicyRequest;
101 import software.amazon.awssdk.services.s3.model.GetBucketPolicyResponse;
102 import software.amazon.awssdk.services.s3.model.GetBucketPolicyStatusRequest;
103 import software.amazon.awssdk.services.s3.model.GetBucketPolicyStatusResponse;
104 import software.amazon.awssdk.services.s3.model.GetBucketReplicationRequest;
105 import software.amazon.awssdk.services.s3.model.GetBucketReplicationResponse;
106 import software.amazon.awssdk.services.s3.model.GetBucketRequestPaymentRequest;
107 import software.amazon.awssdk.services.s3.model.GetBucketRequestPaymentResponse;
108 import software.amazon.awssdk.services.s3.model.GetBucketTaggingRequest;
109 import software.amazon.awssdk.services.s3.model.GetBucketTaggingResponse;
110 import software.amazon.awssdk.services.s3.model.GetBucketVersioningRequest;
111 import software.amazon.awssdk.services.s3.model.GetBucketVersioningResponse;
112 import software.amazon.awssdk.services.s3.model.GetBucketWebsiteRequest;
113 import software.amazon.awssdk.services.s3.model.GetBucketWebsiteResponse;
114 import software.amazon.awssdk.services.s3.model.GetObjectAclRequest;
115 import software.amazon.awssdk.services.s3.model.GetObjectAclResponse;
116 import software.amazon.awssdk.services.s3.model.GetObjectLegalHoldRequest;
117 import software.amazon.awssdk.services.s3.model.GetObjectLegalHoldResponse;
118 import software.amazon.awssdk.services.s3.model.GetObjectLockConfigurationRequest;
119 import software.amazon.awssdk.services.s3.model.GetObjectLockConfigurationResponse;
120 import software.amazon.awssdk.services.s3.model.GetObjectRequest;
121 import software.amazon.awssdk.services.s3.model.GetObjectResponse;
122 import software.amazon.awssdk.services.s3.model.GetObjectRetentionRequest;
123 import software.amazon.awssdk.services.s3.model.GetObjectRetentionResponse;
124 import software.amazon.awssdk.services.s3.model.GetObjectTaggingRequest;
125 import software.amazon.awssdk.services.s3.model.GetObjectTaggingResponse;
126 import software.amazon.awssdk.services.s3.model.GetObjectTorrentRequest;
127 import software.amazon.awssdk.services.s3.model.GetObjectTorrentResponse;
128 import software.amazon.awssdk.services.s3.model.GetPublicAccessBlockRequest;
129 import software.amazon.awssdk.services.s3.model.GetPublicAccessBlockResponse;
130 import software.amazon.awssdk.services.s3.model.HeadBucketRequest;
131 import software.amazon.awssdk.services.s3.model.HeadBucketResponse;
132 import software.amazon.awssdk.services.s3.model.HeadObjectRequest;
133 import software.amazon.awssdk.services.s3.model.HeadObjectResponse;
134 import software.amazon.awssdk.services.s3.model.ListBucketAnalyticsConfigurationsRequest;
135 import software.amazon.awssdk.services.s3.model.ListBucketAnalyticsConfigurationsResponse;
136 import software.amazon.awssdk.services.s3.model.ListBucketInventoryConfigurationsRequest;
137 import software.amazon.awssdk.services.s3.model.ListBucketInventoryConfigurationsResponse;
138 import software.amazon.awssdk.services.s3.model.ListBucketMetricsConfigurationsRequest;
139 import software.amazon.awssdk.services.s3.model.ListBucketMetricsConfigurationsResponse;
140 import software.amazon.awssdk.services.s3.model.ListBucketsRequest;
141 import software.amazon.awssdk.services.s3.model.ListBucketsResponse;
142 import software.amazon.awssdk.services.s3.model.ListMultipartUploadsRequest;
143 import software.amazon.awssdk.services.s3.model.ListMultipartUploadsResponse;
144 import software.amazon.awssdk.services.s3.model.ListObjectVersionsRequest;
145 import software.amazon.awssdk.services.s3.model.ListObjectVersionsResponse;
146 import software.amazon.awssdk.services.s3.model.ListObjectsRequest;
147 import software.amazon.awssdk.services.s3.model.ListObjectsResponse;
148 import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
149 import software.amazon.awssdk.services.s3.model.ListObjectsV2Response;
150 import software.amazon.awssdk.services.s3.model.ListPartsRequest;
151 import software.amazon.awssdk.services.s3.model.ListPartsResponse;
152 import software.amazon.awssdk.services.s3.model.NoSuchBucketException;
153 import software.amazon.awssdk.services.s3.model.NoSuchKeyException;
154 import software.amazon.awssdk.services.s3.model.NoSuchUploadException;
155 import software.amazon.awssdk.services.s3.model.ObjectAlreadyInActiveTierErrorException;
156 import software.amazon.awssdk.services.s3.model.ObjectNotInActiveTierErrorException;
157 import software.amazon.awssdk.services.s3.model.PutBucketAccelerateConfigurationRequest;
158 import software.amazon.awssdk.services.s3.model.PutBucketAccelerateConfigurationResponse;
159 import software.amazon.awssdk.services.s3.model.PutBucketAclRequest;
160 import software.amazon.awssdk.services.s3.model.PutBucketAclResponse;
161 import software.amazon.awssdk.services.s3.model.PutBucketAnalyticsConfigurationRequest;
162 import software.amazon.awssdk.services.s3.model.PutBucketAnalyticsConfigurationResponse;
163 import software.amazon.awssdk.services.s3.model.PutBucketCorsRequest;
164 import software.amazon.awssdk.services.s3.model.PutBucketCorsResponse;
165 import software.amazon.awssdk.services.s3.model.PutBucketEncryptionRequest;
166 import software.amazon.awssdk.services.s3.model.PutBucketEncryptionResponse;
167 import software.amazon.awssdk.services.s3.model.PutBucketInventoryConfigurationRequest;
168 import software.amazon.awssdk.services.s3.model.PutBucketInventoryConfigurationResponse;
169 import software.amazon.awssdk.services.s3.model.PutBucketLifecycleConfigurationRequest;
170 import software.amazon.awssdk.services.s3.model.PutBucketLifecycleConfigurationResponse;
171 import software.amazon.awssdk.services.s3.model.PutBucketLoggingRequest;
172 import software.amazon.awssdk.services.s3.model.PutBucketLoggingResponse;
173 import software.amazon.awssdk.services.s3.model.PutBucketMetricsConfigurationRequest;
174 import software.amazon.awssdk.services.s3.model.PutBucketMetricsConfigurationResponse;
175 import software.amazon.awssdk.services.s3.model.PutBucketNotificationConfigurationRequest;
176 import software.amazon.awssdk.services.s3.model.PutBucketNotificationConfigurationResponse;
177 import software.amazon.awssdk.services.s3.model.PutBucketPolicyRequest;
178 import software.amazon.awssdk.services.s3.model.PutBucketPolicyResponse;
179 import software.amazon.awssdk.services.s3.model.PutBucketReplicationRequest;
180 import software.amazon.awssdk.services.s3.model.PutBucketReplicationResponse;
181 import software.amazon.awssdk.services.s3.model.PutBucketRequestPaymentRequest;
182 import software.amazon.awssdk.services.s3.model.PutBucketRequestPaymentResponse;
183 import software.amazon.awssdk.services.s3.model.PutBucketTaggingRequest;
184 import software.amazon.awssdk.services.s3.model.PutBucketTaggingResponse;
185 import software.amazon.awssdk.services.s3.model.PutBucketVersioningRequest;
186 import software.amazon.awssdk.services.s3.model.PutBucketVersioningResponse;
187 import software.amazon.awssdk.services.s3.model.PutBucketWebsiteRequest;
188 import software.amazon.awssdk.services.s3.model.PutBucketWebsiteResponse;
189 import software.amazon.awssdk.services.s3.model.PutObjectAclRequest;
190 import software.amazon.awssdk.services.s3.model.PutObjectAclResponse;
191 import software.amazon.awssdk.services.s3.model.PutObjectLegalHoldRequest;
192 import software.amazon.awssdk.services.s3.model.PutObjectLegalHoldResponse;
193 import software.amazon.awssdk.services.s3.model.PutObjectLockConfigurationRequest;
194 import software.amazon.awssdk.services.s3.model.PutObjectLockConfigurationResponse;
195 import software.amazon.awssdk.services.s3.model.PutObjectRequest;
196 import software.amazon.awssdk.services.s3.model.PutObjectResponse;
197 import software.amazon.awssdk.services.s3.model.PutObjectRetentionRequest;
198 import software.amazon.awssdk.services.s3.model.PutObjectRetentionResponse;
199 import software.amazon.awssdk.services.s3.model.PutObjectTaggingRequest;
200 import software.amazon.awssdk.services.s3.model.PutObjectTaggingResponse;
201 import software.amazon.awssdk.services.s3.model.PutPublicAccessBlockRequest;
202 import software.amazon.awssdk.services.s3.model.PutPublicAccessBlockResponse;
203 import software.amazon.awssdk.services.s3.model.RestoreObjectRequest;
204 import software.amazon.awssdk.services.s3.model.RestoreObjectResponse;
205 import software.amazon.awssdk.services.s3.model.S3Exception;
206 import software.amazon.awssdk.services.s3.model.S3Request;
207 import software.amazon.awssdk.services.s3.model.UploadPartCopyRequest;
208 import software.amazon.awssdk.services.s3.model.UploadPartCopyResponse;
209 import software.amazon.awssdk.services.s3.model.UploadPartRequest;
210 import software.amazon.awssdk.services.s3.model.UploadPartResponse;
211 import software.amazon.awssdk.services.s3.paginators.ListMultipartUploadsIterable;
212 import software.amazon.awssdk.services.s3.paginators.ListObjectVersionsIterable;
213 import software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable;
214 import software.amazon.awssdk.services.s3.paginators.ListPartsIterable;
215 import software.amazon.awssdk.services.s3.transform.AbortMultipartUploadRequestMarshaller;
216 import software.amazon.awssdk.services.s3.transform.CompleteMultipartUploadRequestMarshaller;
217 import software.amazon.awssdk.services.s3.transform.CopyObjectRequestMarshaller;
218 import software.amazon.awssdk.services.s3.transform.CreateBucketRequestMarshaller;
219 import software.amazon.awssdk.services.s3.transform.CreateMultipartUploadRequestMarshaller;
220 import software.amazon.awssdk.services.s3.transform.DeleteBucketAnalyticsConfigurationRequestMarshaller;
221 import software.amazon.awssdk.services.s3.transform.DeleteBucketCorsRequestMarshaller;
222 import software.amazon.awssdk.services.s3.transform.DeleteBucketEncryptionRequestMarshaller;
223 import software.amazon.awssdk.services.s3.transform.DeleteBucketInventoryConfigurationRequestMarshaller;
224 import software.amazon.awssdk.services.s3.transform.DeleteBucketLifecycleRequestMarshaller;
225 import software.amazon.awssdk.services.s3.transform.DeleteBucketMetricsConfigurationRequestMarshaller;
226 import software.amazon.awssdk.services.s3.transform.DeleteBucketPolicyRequestMarshaller;
227 import software.amazon.awssdk.services.s3.transform.DeleteBucketReplicationRequestMarshaller;
228 import software.amazon.awssdk.services.s3.transform.DeleteBucketRequestMarshaller;
229 import software.amazon.awssdk.services.s3.transform.DeleteBucketTaggingRequestMarshaller;
230 import software.amazon.awssdk.services.s3.transform.DeleteBucketWebsiteRequestMarshaller;
231 import software.amazon.awssdk.services.s3.transform.DeleteObjectRequestMarshaller;
232 import software.amazon.awssdk.services.s3.transform.DeleteObjectTaggingRequestMarshaller;
233 import software.amazon.awssdk.services.s3.transform.DeleteObjectsRequestMarshaller;
234 import software.amazon.awssdk.services.s3.transform.DeletePublicAccessBlockRequestMarshaller;
235 import software.amazon.awssdk.services.s3.transform.GetBucketAccelerateConfigurationRequestMarshaller;
236 import software.amazon.awssdk.services.s3.transform.GetBucketAclRequestMarshaller;
237 import software.amazon.awssdk.services.s3.transform.GetBucketAnalyticsConfigurationRequestMarshaller;
238 import software.amazon.awssdk.services.s3.transform.GetBucketCorsRequestMarshaller;
239 import software.amazon.awssdk.services.s3.transform.GetBucketEncryptionRequestMarshaller;
240 import software.amazon.awssdk.services.s3.transform.GetBucketInventoryConfigurationRequestMarshaller;
241 import software.amazon.awssdk.services.s3.transform.GetBucketLifecycleConfigurationRequestMarshaller;
242 import software.amazon.awssdk.services.s3.transform.GetBucketLocationRequestMarshaller;
243 import software.amazon.awssdk.services.s3.transform.GetBucketLoggingRequestMarshaller;
244 import software.amazon.awssdk.services.s3.transform.GetBucketMetricsConfigurationRequestMarshaller;
245 import software.amazon.awssdk.services.s3.transform.GetBucketNotificationConfigurationRequestMarshaller;
246 import software.amazon.awssdk.services.s3.transform.GetBucketPolicyRequestMarshaller;
247 import software.amazon.awssdk.services.s3.transform.GetBucketPolicyStatusRequestMarshaller;
248 import software.amazon.awssdk.services.s3.transform.GetBucketReplicationRequestMarshaller;
249 import software.amazon.awssdk.services.s3.transform.GetBucketRequestPaymentRequestMarshaller;
250 import software.amazon.awssdk.services.s3.transform.GetBucketTaggingRequestMarshaller;
251 import software.amazon.awssdk.services.s3.transform.GetBucketVersioningRequestMarshaller;
252 import software.amazon.awssdk.services.s3.transform.GetBucketWebsiteRequestMarshaller;
253 import software.amazon.awssdk.services.s3.transform.GetObjectAclRequestMarshaller;
254 import software.amazon.awssdk.services.s3.transform.GetObjectLegalHoldRequestMarshaller;
255 import software.amazon.awssdk.services.s3.transform.GetObjectLockConfigurationRequestMarshaller;
256 import software.amazon.awssdk.services.s3.transform.GetObjectRequestMarshaller;
257 import software.amazon.awssdk.services.s3.transform.GetObjectRetentionRequestMarshaller;
258 import software.amazon.awssdk.services.s3.transform.GetObjectTaggingRequestMarshaller;
259 import software.amazon.awssdk.services.s3.transform.GetObjectTorrentRequestMarshaller;
260 import software.amazon.awssdk.services.s3.transform.GetPublicAccessBlockRequestMarshaller;
261 import software.amazon.awssdk.services.s3.transform.HeadBucketRequestMarshaller;
262 import software.amazon.awssdk.services.s3.transform.HeadObjectRequestMarshaller;
263 import software.amazon.awssdk.services.s3.transform.ListBucketAnalyticsConfigurationsRequestMarshaller;
264 import software.amazon.awssdk.services.s3.transform.ListBucketInventoryConfigurationsRequestMarshaller;
265 import software.amazon.awssdk.services.s3.transform.ListBucketMetricsConfigurationsRequestMarshaller;
266 import software.amazon.awssdk.services.s3.transform.ListBucketsRequestMarshaller;
267 import software.amazon.awssdk.services.s3.transform.ListMultipartUploadsRequestMarshaller;
268 import software.amazon.awssdk.services.s3.transform.ListObjectVersionsRequestMarshaller;
269 import software.amazon.awssdk.services.s3.transform.ListObjectsRequestMarshaller;
270 import software.amazon.awssdk.services.s3.transform.ListObjectsV2RequestMarshaller;
271 import software.amazon.awssdk.services.s3.transform.ListPartsRequestMarshaller;
272 import software.amazon.awssdk.services.s3.transform.PutBucketAccelerateConfigurationRequestMarshaller;
273 import software.amazon.awssdk.services.s3.transform.PutBucketAclRequestMarshaller;
274 import software.amazon.awssdk.services.s3.transform.PutBucketAnalyticsConfigurationRequestMarshaller;
275 import software.amazon.awssdk.services.s3.transform.PutBucketCorsRequestMarshaller;
276 import software.amazon.awssdk.services.s3.transform.PutBucketEncryptionRequestMarshaller;
277 import software.amazon.awssdk.services.s3.transform.PutBucketInventoryConfigurationRequestMarshaller;
278 import software.amazon.awssdk.services.s3.transform.PutBucketLifecycleConfigurationRequestMarshaller;
279 import software.amazon.awssdk.services.s3.transform.PutBucketLoggingRequestMarshaller;
280 import software.amazon.awssdk.services.s3.transform.PutBucketMetricsConfigurationRequestMarshaller;
281 import software.amazon.awssdk.services.s3.transform.PutBucketNotificationConfigurationRequestMarshaller;
282 import software.amazon.awssdk.services.s3.transform.PutBucketPolicyRequestMarshaller;
283 import software.amazon.awssdk.services.s3.transform.PutBucketReplicationRequestMarshaller;
284 import software.amazon.awssdk.services.s3.transform.PutBucketRequestPaymentRequestMarshaller;
285 import software.amazon.awssdk.services.s3.transform.PutBucketTaggingRequestMarshaller;
286 import software.amazon.awssdk.services.s3.transform.PutBucketVersioningRequestMarshaller;
287 import software.amazon.awssdk.services.s3.transform.PutBucketWebsiteRequestMarshaller;
288 import software.amazon.awssdk.services.s3.transform.PutObjectAclRequestMarshaller;
289 import software.amazon.awssdk.services.s3.transform.PutObjectLegalHoldRequestMarshaller;
290 import software.amazon.awssdk.services.s3.transform.PutObjectLockConfigurationRequestMarshaller;
291 import software.amazon.awssdk.services.s3.transform.PutObjectRequestMarshaller;
292 import software.amazon.awssdk.services.s3.transform.PutObjectRetentionRequestMarshaller;
293 import software.amazon.awssdk.services.s3.transform.PutObjectTaggingRequestMarshaller;
294 import software.amazon.awssdk.services.s3.transform.PutPublicAccessBlockRequestMarshaller;
295 import software.amazon.awssdk.services.s3.transform.RestoreObjectRequestMarshaller;
296 import software.amazon.awssdk.services.s3.transform.UploadPartCopyRequestMarshaller;
297 import software.amazon.awssdk.services.s3.transform.UploadPartRequestMarshaller;
298
299 /**
300 * Internal implementation of {@link S3Client}.
301 *
302 * @see S3Client#builder()
303 */
304 @Generated("software.amazon.awssdk:codegen")
305 @SdkInternalApi
306 final class DefaultS3Client implements S3Client {
307 private final SyncClientHandler clientHandler;
308
309 private final AwsS3ProtocolFactory protocolFactory;
310
311 private final SdkClientConfiguration clientConfiguration;
312
313 protected DefaultS3Client(SdkClientConfiguration clientConfiguration) {
314 this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
315 this.clientConfiguration = clientConfiguration;
316 this.protocolFactory = init();
317 }
318
319 @Override
320 public final String serviceName() {
321 return SERVICE_NAME;
322 }
323
324 /**
325 * <p>
326 * This operation aborts a multipart upload. After a multipart upload is aborted, no additional parts can be
327 * uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if
328 * any part uploads are currently in progress, those part uploads might or might not succeed. As a result, it might
329 * be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by
330 * all parts.
331 * </p>
332 * <p>
333 * To verify that all parts have been removed, so you don't get charged for the part storage, you should call the
334 * <a>ListParts</a> operation and ensure that the parts list is empty.
335 * </p>
336 * <p>
337 * For information about permissions required to use the multipart upload API, see <a
338 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
339 * Permissions</a>.
340 * </p>
341 * <p>
342 * The following operations are related to <code>AbortMultipartUpload</code>:
343 * </p>
344 * <ul>
345 * <li>
346 * <p>
347 * <a>CreateMultipartUpload</a>
348 * </p>
349 * </li>
350 * <li>
351 * <p>
352 * <a>UploadPart</a>
353 * </p>
354 * </li>
355 * <li>
356 * <p>
357 * <a>CompleteMultipartUpload</a>
358 * </p>
359 * </li>
360 * <li>
361 * <p>
362 * <a>ListParts</a>
363 * </p>
364 * </li>
365 * <li>
366 * <p>
367 * <a>ListMultipartUploads</a>
368 * </p>
369 * </li>
370 * </ul>
371 *
372 * @param abortMultipartUploadRequest
373 * @return Result of the AbortMultipartUpload operation returned by the service.
374 * @throws NoSuchUploadException
375 * The specified multipart upload does not exist.
376 * @throws SdkException
377 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
378 * catch all scenarios.
379 * @throws SdkClientException
380 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
381 * @throws S3Exception
382 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
383 * @sample S3Client.AbortMultipartUpload
384 */
385 @Override
386 public AbortMultipartUploadResponse abortMultipartUpload(AbortMultipartUploadRequest abortMultipartUploadRequest)
387 throws NoSuchUploadException, AwsServiceException, SdkClientException, S3Exception {
388
389 HttpResponseHandler<Response<AbortMultipartUploadResponse>> responseHandler = protocolFactory
390 .createCombinedResponseHandler(AbortMultipartUploadResponse::builder,
391 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
392
393 return clientHandler.execute(new ClientExecutionParams<AbortMultipartUploadRequest, AbortMultipartUploadResponse>()
394 .withOperationName("AbortMultipartUpload").withCombinedResponseHandler(responseHandler)
395 .withInput(abortMultipartUploadRequest)
396 .withMarshaller(new AbortMultipartUploadRequestMarshaller(protocolFactory)));
397 }
398
399 /**
400 * <p>
401 * Completes a multipart upload by assembling previously uploaded parts.
402 * </p>
403 * <p>
404 * You first initiate the multipart upload and then upload all parts using the <a>UploadPart</a> operation. After
405 * successfully uploading all relevant parts of an upload, you call this operation to complete the upload. Upon
406 * receiving this request, Amazon S3 concatenates all the parts in ascending order by part number to create a new
407 * object. In the Complete Multipart Upload request, you must provide the parts list. You must ensure that the parts
408 * list is complete. This operation concatenates the parts that you provide in the list. For each part in the list,
409 * you must provide the part number and the <code>ETag</code> value, returned after that part was uploaded.
410 * </p>
411 * <p>
412 * Processing of a Complete Multipart Upload request could take several minutes to complete. After Amazon S3 begins
413 * processing the request, it sends an HTTP response header that specifies a 200 OK response. While processing is in
414 * progress, Amazon S3 periodically sends white space characters to keep the connection from timing out. Because a
415 * request could fail after the initial 200 OK response has been sent, it is important that you check the response
416 * body to determine whether the request succeeded.
417 * </p>
418 * <p>
419 * Note that if <code>CompleteMultipartUpload</code> fails, applications should be prepared to retry the failed
420 * requests. For more information, see <a
421 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html">Amazon S3 Error Best
422 * Practices</a>.
423 * </p>
424 * <p>
425 * For more information about multipart uploads, see <a
426 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
427 * Upload</a>.
428 * </p>
429 * <p>
430 * For information about permissions required to use the multipart upload API, see <a
431 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
432 * Permissions</a>.
433 * </p>
434 * <p>
435 * <code>GetBucketLifecycle</code> has the following special errors:
436 * </p>
437 * <ul>
438 * <li>
439 * <p>
440 * Error code: <code>EntityTooSmall</code>
441 * </p>
442 * <ul>
443 * <li>
444 * <p>
445 * Description: Your proposed upload is smaller than the minimum allowed object size. Each part must be at least 5
446 * MB in size, except the last part.
447 * </p>
448 * </li>
449 * <li>
450 * <p>
451 * 400 Bad Request
452 * </p>
453 * </li>
454 * </ul>
455 * </li>
456 * <li>
457 * <p>
458 * Error code: <code>InvalidPart</code>
459 * </p>
460 * <ul>
461 * <li>
462 * <p>
463 * Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the
464 * specified entity tag might not have matched the part's entity tag.
465 * </p>
466 * </li>
467 * <li>
468 * <p>
469 * 400 Bad Request
470 * </p>
471 * </li>
472 * </ul>
473 * </li>
474 * <li>
475 * <p>
476 * Error code: <code>InvalidPartOrder</code>
477 * </p>
478 * <ul>
479 * <li>
480 * <p>
481 * Description: The list of parts was not in ascending order. The parts list must be specified in order by part
482 * number.
483 * </p>
484 * </li>
485 * <li>
486 * <p>
487 * 400 Bad Request
488 * </p>
489 * </li>
490 * </ul>
491 * </li>
492 * <li>
493 * <p>
494 * Error code: <code>NoSuchUpload</code>
495 * </p>
496 * <ul>
497 * <li>
498 * <p>
499 * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart
500 * upload might have been aborted or completed.
501 * </p>
502 * </li>
503 * <li>
504 * <p>
505 * 404 Not Found
506 * </p>
507 * </li>
508 * </ul>
509 * </li>
510 * </ul>
511 * <p>
512 * The following operations are related to <code>CompleteMultipartUpload</code>:
513 * </p>
514 * <ul>
515 * <li>
516 * <p>
517 * <a>CreateMultipartUpload</a>
518 * </p>
519 * </li>
520 * <li>
521 * <p>
522 * <a>UploadPart</a>
523 * </p>
524 * </li>
525 * <li>
526 * <p>
527 * <a>AbortMultipartUpload</a>
528 * </p>
529 * </li>
530 * <li>
531 * <p>
532 * <a>ListParts</a>
533 * </p>
534 * </li>
535 * <li>
536 * <p>
537 * <a>ListMultipartUploads</a>
538 * </p>
539 * </li>
540 * </ul>
541 *
542 * @param completeMultipartUploadRequest
543 * @return Result of the CompleteMultipartUpload operation returned by the service.
544 * @throws SdkException
545 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
546 * catch all scenarios.
547 * @throws SdkClientException
548 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
549 * @throws S3Exception
550 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
551 * @sample S3Client.CompleteMultipartUpload
552 */
553 @Override
554 public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest completeMultipartUploadRequest)
555 throws AwsServiceException, SdkClientException, S3Exception {
556
557 HttpResponseHandler<Response<CompleteMultipartUploadResponse>> responseHandler = protocolFactory
558 .createCombinedResponseHandler(CompleteMultipartUploadResponse::builder,
559 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
560
561 return clientHandler.execute(new ClientExecutionParams<CompleteMultipartUploadRequest, CompleteMultipartUploadResponse>()
562 .withOperationName("CompleteMultipartUpload").withCombinedResponseHandler(responseHandler)
563 .withInput(completeMultipartUploadRequest)
564 .withMarshaller(new CompleteMultipartUploadRequestMarshaller(protocolFactory)));
565 }
566
567 /**
568 * <p>
569 * Creates a copy of an object that is already stored in Amazon S3.
570 * </p>
571 * <note>
572 * <p>
573 * You can store individual objects of up to 5 TB in Amazon S3. You create a copy of your object up to 5 GB in size
574 * in a single atomic operation using this API. However, to copy an object greater than 5 GB, you must use the
575 * multipart upload Upload Part - Copy API. For more information, see <a
576 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html">Copy Object Using the
577 * REST Multipart Upload API</a>.
578 * </p>
579 * </note>
580 * <p>
581 * All copy requests must be authenticated. Additionally, you must have <i>read</i> access to the source object and
582 * <i>write</i> access to the destination bucket. For more information, see <a
583 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html">REST Authentication</a>. Both the
584 * Region that you want to copy the object from and the Region that you want to copy the object to must be enabled
585 * for your account.
586 * </p>
587 * <p>
588 * A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the
589 * files. If the error occurs before the copy operation starts, you receive a standard Amazon S3 error. If the error
590 * occurs during the copy operation, the error response is embedded in the <code>200 OK</code> response. This means
591 * that a <code>200 OK</code> response can contain either a success or an error. Design your application to parse
592 * the contents of the response and handle it appropriately.
593 * </p>
594 * <p>
595 * If the copy is successful, you receive a response with information about the copied object.
596 * </p>
597 * <note>
598 * <p>
599 * If the request is an HTTP 1.1 request, the response is chunk encoded. If it were not, it would not contain the
600 * content-length, and you would need to read the entire body.
601 * </p>
602 * </note>
603 * <p>
604 * The copy request charge is based on the storage class and Region that you specify for the destination object. For
605 * pricing information, see <a href="https://aws.amazon.com/s3/pricing/">Amazon S3 pricing</a>.
606 * </p>
607 * <important>
608 * <p>
609 * Amazon S3 transfer acceleration does not support cross-Region copies. If you request a cross-Region copy using a
610 * transfer acceleration endpoint, you get a 400 <code>Bad Request</code> error. For more information, see <a
611 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html">Transfer Acceleration</a>.
612 * </p>
613 * </important>
614 * <p>
615 * <b>Metadata</b>
616 * </p>
617 * <p>
618 * When copying an object, you can preserve all metadata (default) or specify new metadata. However, the ACL is not
619 * preserved and is set to private for the user making the request. To override the default ACL setting, specify a
620 * new ACL when generating a copy request. For more information, see <a
621 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html">Using ACLs</a>.
622 * </p>
623 * <p>
624 * To specify whether you want the object metadata copied from the source object or replaced with metadata provided
625 * in the request, you can optionally add the <code>x-amz-metadata-directive</code> header. When you grant
626 * permissions, you can use the <code>s3:x-amz-metadata-directive</code> condition key to enforce certain metadata
627 * behavior when objects are uploaded. For more information, see <a
628 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html">Specifying Conditions in a
629 * Policy</a> in the <i>Amazon S3 Developer Guide</i>. For a complete list of Amazon S3-specific condition keys, see
630 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html">Actions, Resources, and Condition
631 * Keys for Amazon S3</a>.
632 * </p>
633 * <p>
634 * <b> <code>x-amz-copy-source-if</code> Headers</b>
635 * </p>
636 * <p>
637 * To only copy an object under certain conditions, such as whether the <code>Etag</code> matches or whether the
638 * object was modified before or after a specified date, use the following request parameters:
639 * </p>
640 * <ul>
641 * <li>
642 * <p>
643 * <code>x-amz-copy-source-if-match</code>
644 * </p>
645 * </li>
646 * <li>
647 * <p>
648 * <code>x-amz-copy-source-if-none-match</code>
649 * </p>
650 * </li>
651 * <li>
652 * <p>
653 * <code>x-amz-copy-source-if-unmodified-since</code>
654 * </p>
655 * </li>
656 * <li>
657 * <p>
658 * <code>x-amz-copy-source-if-modified-since</code>
659 * </p>
660 * </li>
661 * </ul>
662 * <p>
663 * If both the <code>x-amz-copy-source-if-match</code> and <code>x-amz-copy-source-if-unmodified-since</code>
664 * headers are present in the request and evaluate as follows, Amazon S3 returns <code>200 OK</code> and copies the
665 * data:
666 * </p>
667 * <ul>
668 * <li>
669 * <p>
670 * <code>x-amz-copy-source-if-match</code> condition evaluates to true
671 * </p>
672 * </li>
673 * <li>
674 * <p>
675 * <code>x-amz-copy-source-if-unmodified-since</code> condition evaluates to false
676 * </p>
677 * </li>
678 * </ul>
679 * <p>
680 * If both the <code>x-amz-copy-source-if-none-match</code> and <code>x-amz-copy-source-if-modified-since</code>
681 * headers are present in the request and evaluate as follows, Amazon S3 returns the
682 * <code>412 Precondition Failed</code> response code:
683 * </p>
684 * <ul>
685 * <li>
686 * <p>
687 * <code>x-amz-copy-source-if-none-match</code> condition evaluates to false
688 * </p>
689 * </li>
690 * <li>
691 * <p>
692 * <code>x-amz-copy-source-if-modified-since</code> condition evaluates to true
693 * </p>
694 * </li>
695 * </ul>
696 * <note>
697 * <p>
698 * All headers with the <code>x-amz-</code> prefix, including <code>x-amz-copy-source</code>, must be signed.
699 * </p>
700 * </note>
701 * <p>
702 * <b>Encryption</b>
703 * </p>
704 * <p>
705 * The source object that you are copying can be encrypted or unencrypted. The source object can be encrypted with
706 * server-side encryption using AWS managed encryption keys (SSE-S3 or SSE-KMS) or by using a customer-provided
707 * encryption key. With server-side encryption, Amazon S3 encrypts your data as it writes it to disks in its data
708 * centers and decrypts the data when you access it.
709 * </p>
710 * <p>
711 * You can optionally use the appropriate encryption-related headers to request server-side encryption for the
712 * target object. You have the option to provide your own encryption key or use SSE-S3 or SSE-KMS, regardless of the
713 * form of server-side encryption that was used to encrypt the source object. You can even request encryption if the
714 * source object was not encrypted. For more information about server-side encryption, see <a
715 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html">Using Server-Side
716 * Encryption</a>.
717 * </p>
718 * <p>
719 * <b>Access Control List (ACL)-Specific Request Headers</b>
720 * </p>
721 * <p>
722 * When copying an object, you can optionally use headers to grant ACL-based permissions. By default, all objects
723 * are private. Only the owner has full access control. When adding a new object, you can grant permissions to
724 * individual AWS accounts or to predefined groups defined by Amazon S3. These permissions are then added to the ACL
725 * on the object. For more information, see <a
726 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL) Overview</a>
727 * and <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html">Managing ACLs Using the
728 * REST API</a>.
729 * </p>
730 * <p>
731 * <b>Storage Class Options</b>
732 * </p>
733 * <p>
734 * You can use the <code>CopyObject</code> operation to change the storage class of an object that is already stored
735 * in Amazon S3 using the <code>StorageClass</code> parameter. For more information, see <a
736 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a> in the
737 * <i>Amazon S3 Service Developer Guide</i>.
738 * </p>
739 * <p>
740 * <b>Versioning</b>
741 * </p>
742 * <p>
743 * By default, <code>x-amz-copy-source</code> identifies the current version of an object to copy. If the current
744 * version is a delete marker, Amazon S3 behaves as if the object was deleted. To copy a different version, use the
745 * <code>versionId</code> subresource.
746 * </p>
747 * <p>
748 * If you enable versioning on the target bucket, Amazon S3 generates a unique version ID for the object being
749 * copied. This version ID is different from the version ID of the source object. Amazon S3 returns the version ID
750 * of the copied object in the <code>x-amz-version-id</code> response header in the response.
751 * </p>
752 * <p>
753 * If you do not enable versioning or suspend it on the target bucket, the version ID that Amazon S3 generates is
754 * always null.
755 * </p>
756 * <p>
757 * If the source object's storage class is GLACIER, you must restore a copy of this object before you can use it as
758 * a source object for the copy operation. For more information, see .
759 * </p>
760 * <p>
761 * The following operations are related to <code>CopyObject</code>:
762 * </p>
763 * <ul>
764 * <li>
765 * <p>
766 * <a>PutObject</a>
767 * </p>
768 * </li>
769 * <li>
770 * <p>
771 * <a>GetObject</a>
772 * </p>
773 * </li>
774 * </ul>
775 * <p>
776 * For more information, see <a
777 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html">Copying Objects</a>.
778 * </p>
779 *
780 * @param copyObjectRequest
781 * @return Result of the CopyObject operation returned by the service.
782 * @throws ObjectNotInActiveTierErrorException
783 * The source object of the COPY operation is not in the active tier and is only stored in Amazon S3
784 * Glacier.
785 * @throws SdkException
786 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
787 * catch all scenarios.
788 * @throws SdkClientException
789 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
790 * @throws S3Exception
791 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
792 * @sample S3Client.CopyObject
793 */
794 @Override
795 public CopyObjectResponse copyObject(CopyObjectRequest copyObjectRequest) throws ObjectNotInActiveTierErrorException,
796 AwsServiceException, SdkClientException, S3Exception {
797
798 HttpResponseHandler<Response<CopyObjectResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
799 CopyObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
800
801 return clientHandler.execute(new ClientExecutionParams<CopyObjectRequest, CopyObjectResponse>()
802 .withOperationName("CopyObject").withCombinedResponseHandler(responseHandler).withInput(copyObjectRequest)
803 .withMarshaller(new CopyObjectRequestMarshaller(protocolFactory)));
804 }
805
806 /**
807 * <p>
808 * Creates a new bucket. To create a bucket, you must register with Amazon S3 and have a valid AWS Access Key ID to
809 * authenticate requests. Anonymous requests are never allowed to create buckets. By creating the bucket, you become
810 * the bucket owner.
811 * </p>
812 * <p>
813 * Not every string is an acceptable bucket name. For information on bucket naming restrictions, see <a
814 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html">Working with Amazon S3 Buckets</a>.
815 * </p>
816 * <p>
817 * By default, the bucket is created in the US East (N. Virginia) Region. You can optionally specify a Region in the
818 * request body. You might choose a Region to optimize latency, minimize costs, or address regulatory requirements.
819 * For example, if you reside in Europe, you will probably find it advantageous to create buckets in the Europe
820 * (Ireland) Region. For more information, see <a
821 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro">How to Select a
822 * Region for Your Buckets</a>.
823 * </p>
824 * <note>
825 * <p>
826 * If you send your create bucket request to the <code>s3.amazonaws.com</code> endpoint, the request goes to the
827 * us-east-1 Region. Accordingly, the signature calculations in Signature Version 4 must use us-east-1 as the
828 * Region, even if the location constraint in the request specifies another Region where the bucket is to be
829 * created. If you create a bucket in a Region other than US East (N. Virginia), your application must be able to
830 * handle 307 redirect. For more information, see <a
831 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html">Virtual Hosting of Buckets</a>.
832 * </p>
833 * </note>
834 * <p>
835 * When creating a bucket using this operation, you can optionally specify the accounts or groups that should be
836 * granted specific permissions on the bucket. There are two ways to grant the appropriate permissions using the
837 * request headers.
838 * </p>
839 * <ul>
840 * <li>
841 * <p>
842 * Specify a canned ACL using the <code>x-amz-acl</code> request header. Amazon S3 supports a set of predefined
843 * ACLs, known as <i>canned ACLs</i>. Each canned ACL has a predefined set of grantees and permissions. For more
844 * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned
845 * ACL</a>.
846 * </p>
847 * </li>
848 * <li>
849 * <p>
850 * Specify access permissions explicitly using the <code>x-amz-grant-read</code>, <code>x-amz-grant-write</code>,
851 * <code>x-amz-grant-read-acp</code>, <code>x-amz-grant-write-acp</code>, and <code>x-amz-grant-full-control</code>
852 * headers. These headers map to the set of permissions Amazon S3 supports in an ACL. For more information, see <a
853 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL) Overview</a>.
854 * </p>
855 * <p>
856 * You specify each grantee as a type=value pair, where the type is one of the following:
857 * </p>
858 * <ul>
859 * <li>
860 * <p>
861 * <code>id</code> – if the value specified is the canonical user ID of an AWS account
862 * </p>
863 * </li>
864 * <li>
865 * <p>
866 * <code>uri</code> – if you are granting permissions to a predefined group
867 * </p>
868 * </li>
869 * <li>
870 * <p>
871 * <code>emailAddress</code> – if the value specified is the email address of an AWS account
872 * </p>
873 * <note>
874 * <p>
875 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
876 * </p>
877 * <ul>
878 * <li>
879 * <p>
880 * US East (N. Virginia)
881 * </p>
882 * </li>
883 * <li>
884 * <p>
885 * US West (N. California)
886 * </p>
887 * </li>
888 * <li>
889 * <p>
890 * US West (Oregon)
891 * </p>
892 * </li>
893 * <li>
894 * <p>
895 * Asia Pacific (Singapore)
896 * </p>
897 * </li>
898 * <li>
899 * <p>
900 * Asia Pacific (Sydney)
901 * </p>
902 * </li>
903 * <li>
904 * <p>
905 * Asia Pacific (Tokyo)
906 * </p>
907 * </li>
908 * <li>
909 * <p>
910 * Europe (Ireland)
911 * </p>
912 * </li>
913 * <li>
914 * <p>
915 * South America (São Paulo)
916 * </p>
917 * </li>
918 * </ul>
919 * <p>
920 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
921 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
922 * General Reference.
923 * </p>
924 * </note></li>
925 * </ul>
926 * <p>
927 * For example, the following <code>x-amz-grant-read</code> header grants the AWS accounts identified by account IDs
928 * permissions to read object data and its metadata:
929 * </p>
930 * <p>
931 * <code>x-amz-grant-read: id="11112222333", id="444455556666" </code>
932 * </p>
933 * </li>
934 * </ul>
935 * <note>
936 * <p>
937 * You can use either a canned ACL or specify access permissions explicitly. You cannot do both.
938 * </p>
939 * </note>
940 * <p>
941 * The following operations are related to <code>CreateBucket</code>:
942 * </p>
943 * <ul>
944 * <li>
945 * <p>
946 * <a>PutObject</a>
947 * </p>
948 * </li>
949 * <li>
950 * <p>
951 * <a>DeleteBucket</a>
952 * </p>
953 * </li>
954 * </ul>
955 *
956 * @param createBucketRequest
957 * @return Result of the CreateBucket operation returned by the service.
958 * @throws BucketAlreadyExistsException
959 * The requested bucket name is not available. The bucket namespace is shared by all users of the system.
960 * Please select a different name and try again.
961 * @throws BucketAlreadyOwnedByYouException
962 * The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all AWS
963 * Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing
964 * bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket
965 * access control lists (ACLs).
966 * @throws SdkException
967 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
968 * catch all scenarios.
969 * @throws SdkClientException
970 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
971 * @throws S3Exception
972 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
973 * @sample S3Client.CreateBucket
974 */
975 @Override
976 public CreateBucketResponse createBucket(CreateBucketRequest createBucketRequest) throws BucketAlreadyExistsException,
977 BucketAlreadyOwnedByYouException, AwsServiceException, SdkClientException, S3Exception {
978
979 HttpResponseHandler<Response<CreateBucketResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
980 CreateBucketResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
981
982 return clientHandler.execute(new ClientExecutionParams<CreateBucketRequest, CreateBucketResponse>()
983 .withOperationName("CreateBucket").withCombinedResponseHandler(responseHandler).withInput(createBucketRequest)
984 .withMarshaller(new CreateBucketRequestMarshaller(protocolFactory)));
985 }
986
987 /**
988 * <p>
989 * This operation initiates a multipart upload and returns an upload ID. This upload ID is used to associate all of
990 * the parts in the specific multipart upload. You specify this upload ID in each of your subsequent upload part
991 * requests (see <a>UploadPart</a>). You also include this upload ID in the final request to either complete or
992 * abort the multipart upload request.
993 * </p>
994 * <p>
995 * For more information about multipart uploads, see <a
996 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html">Multipart Upload Overview</a>.
997 * </p>
998 * <p>
999 * If you have configured a lifecycle rule to abort incomplete multipart uploads, the upload must complete within
1000 * the number of days specified in the bucket lifecycle configuration. Otherwise, the incomplete multipart upload
1001 * becomes eligible for an abort operation and Amazon S3 aborts the multipart upload. For more information, see <a
1002 * href
1003 * ="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config">
1004 * Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy</a>.
1005 * </p>
1006 * <p>
1007 * For information about the permissions required to use the multipart upload API, see <a
1008 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
1009 * Permissions</a>.
1010 * </p>
1011 * <p>
1012 * For request signing, multipart upload is just a series of regular requests. You initiate a multipart upload, send
1013 * one or more requests to upload parts, and then complete the multipart upload process. You sign each request
1014 * individually. There is nothing special about signing multipart upload requests. For more information about
1015 * signing, see <a
1016 * href="https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">Authenticating
1017 * Requests (AWS Signature Version 4)</a>.
1018 * </p>
1019 * <note>
1020 * <p>
1021 * After you initiate a multipart upload and upload one or more parts, to stop being charged for storing the
1022 * uploaded parts, you must either complete or abort the multipart upload. Amazon S3 frees up the space used to
1023 * store the parts and stop charging you for storing them only after you either complete or abort a multipart
1024 * upload.
1025 * </p>
1026 * </note>
1027 * <p>
1028 * You can optionally request server-side encryption. For server-side encryption, Amazon S3 encrypts your data as it
1029 * writes it to disks in its data centers and decrypts it when you access it. You can provide your own encryption
1030 * key, or use AWS Key Management Service (AWS KMS) customer master keys (CMKs) or Amazon S3-managed encryption
1031 * keys. If you choose to provide your own encryption key, the request headers you provide in <a>UploadPart</a>) and
1032 * <a>UploadPartCopy</a>) requests must match the headers you used in the request to initiate the upload by using
1033 * <code>CreateMultipartUpload</code>.
1034 * </p>
1035 * <p>
1036 * To perform a multipart upload with encryption using an AWS KMS CMK, the requester must have permission to the
1037 * <code>kms:Encrypt</code>, <code>kms:Decrypt</code>, <code>kms:ReEncrypt*</code>,
1038 * <code>kms:GenerateDataKey*</code>, and <code>kms:DescribeKey</code> actions on the key. These permissions are
1039 * required because Amazon S3 must decrypt and read data from the encrypted file parts before it completes the
1040 * multipart upload.
1041 * </p>
1042 * <p>
1043 * If your AWS Identity and Access Management (IAM) user or role is in the same AWS account as the AWS KMS CMK, then
1044 * you must have these permissions on the key policy. If your IAM user or role belongs to a different account than
1045 * the key, then you must have the permissions on both the key policy and your IAM user or role.
1046 * </p>
1047 * <p>
1048 * For more information, see <a
1049 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html">Protecting Data Using
1050 * Server-Side Encryption</a>.
1051 * </p>
1052 * <dl>
1053 * <dt>Access Permissions</dt>
1054 * <dd>
1055 * <p>
1056 * When copying an object, you can optionally specify the accounts or groups that should be granted specific
1057 * permissions on the new object. There are two ways to grant the permissions using the request headers:
1058 * </p>
1059 * <ul>
1060 * <li>
1061 * <p>
1062 * Specify a canned ACL with the <code>x-amz-acl</code> request header. For more information, see <a
1063 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned ACL</a>.
1064 * </p>
1065 * </li>
1066 * <li>
1067 * <p>
1068 * Specify access permissions explicitly with the <code>x-amz-grant-read</code>, <code>x-amz-grant-read-acp</code>,
1069 * <code>x-amz-grant-write-acp</code>, and <code>x-amz-grant-full-control</code> headers. These parameters map to
1070 * the set of permissions that Amazon S3 supports in an ACL. For more information, see <a
1071 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL) Overview</a>.
1072 * </p>
1073 * </li>
1074 * </ul>
1075 * <p>
1076 * You can use either a canned ACL or specify access permissions explicitly. You cannot do both.
1077 * </p>
1078 * </dd>
1079 * <dt>Server-Side- Encryption-Specific Request Headers</dt>
1080 * <dd>
1081 * <p>
1082 * You can optionally tell Amazon S3 to encrypt data at rest using server-side encryption. Server-side encryption is
1083 * for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and
1084 * decrypts it when you access it. The option you use depends on whether you want to use AWS managed encryption keys
1085 * or provide your own encryption key.
1086 * </p>
1087 * <ul>
1088 * <li>
1089 * <p>
1090 * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) stored in AWS Key Management Service (AWS
1091 * KMS) – If you want AWS to manage the keys used to encrypt data, specify the following headers in the request.
1092 * </p>
1093 * <ul>
1094 * <li>
1095 * <p>
1096 * x-amz-server-side-encryption
1097 * </p>
1098 * </li>
1099 * <li>
1100 * <p>
1101 * x-amz-server-side-encryption-aws-kms-key-id
1102 * </p>
1103 * </li>
1104 * <li>
1105 * <p>
1106 * x-amz-server-side-encryption-context
1107 * </p>
1108 * </li>
1109 * </ul>
1110 * <note>
1111 * <p>
1112 * If you specify <code>x-amz-server-side-encryption:aws:kms</code>, but don't provide
1113 * <code>x-amz-server-side-encryption-aws-kms-key-id</code>, Amazon S3 uses the AWS managed CMK in AWS KMS to
1114 * protect the data.
1115 * </p>
1116 * </note> <important>
1117 * <p>
1118 * All GET and PUT requests for an object protected by AWS KMS fail if you don't make them with SSL or by using
1119 * SigV4.
1120 * </p>
1121 * </important>
1122 * <p>
1123 * For more information about server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see <a
1124 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html">Protecting Data Using Server-Side
1125 * Encryption with CMKs stored in AWS KMS</a>.
1126 * </p>
1127 * </li>
1128 * <li>
1129 * <p>
1130 * Use customer-provided encryption keys – If you want to manage your own encryption keys, provide all the following
1131 * headers in the request.
1132 * </p>
1133 * <ul>
1134 * <li>
1135 * <p>
1136 * x-amz-server-side-encryption-customer-algorithm
1137 * </p>
1138 * </li>
1139 * <li>
1140 * <p>
1141 * x-amz-server-side-encryption-customer-key
1142 * </p>
1143 * </li>
1144 * <li>
1145 * <p>
1146 * x-amz-server-side-encryption-customer-key-MD5
1147 * </p>
1148 * </li>
1149 * </ul>
1150 * <p>
1151 * For more information about server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see <a
1152 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html">Protecting Data Using Server-Side
1153 * Encryption with CMKs stored in AWS KMS</a>.
1154 * </p>
1155 * </li>
1156 * </ul>
1157 * </dd>
1158 * <dt>Access-Control-List (ACL)-Specific Request Headers</dt>
1159 * <dd>
1160 * <p>
1161 * You also can use the following access control–related headers with this operation. By default, all objects are
1162 * private. Only the owner has full access control. When adding a new object, you can grant permissions to
1163 * individual AWS accounts or to predefined groups defined by Amazon S3. These permissions are then added to the
1164 * access control list (ACL) on the object. For more information, see <a
1165 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html">Using ACLs</a>. With this
1166 * operation, you can grant access permissions using one of the following two methods:
1167 * </p>
1168 * <ul>
1169 * <li>
1170 * <p>
1171 * Specify a canned ACL (<code>x-amz-acl</code>) — Amazon S3 supports a set of predefined ACLs, known as <i>canned
1172 * ACLs</i>. Each canned ACL has a predefined set of grantees and permissions. For more information, see <a
1173 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned ACL</a>.
1174 * </p>
1175 * </li>
1176 * <li>
1177 * <p>
1178 * Specify access permissions explicitly — To explicitly grant access permissions to specific AWS accounts or
1179 * groups, use the following headers. Each header maps to specific permissions that Amazon S3 supports in an ACL.
1180 * For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access
1181 * Control List (ACL) Overview</a>. In the header, you specify a list of grantees who get the specific permission.
1182 * To grant permissions explicitly, use:
1183 * </p>
1184 * <ul>
1185 * <li>
1186 * <p>
1187 * x-amz-grant-read
1188 * </p>
1189 * </li>
1190 * <li>
1191 * <p>
1192 * x-amz-grant-write
1193 * </p>
1194 * </li>
1195 * <li>
1196 * <p>
1197 * x-amz-grant-read-acp
1198 * </p>
1199 * </li>
1200 * <li>
1201 * <p>
1202 * x-amz-grant-write-acp
1203 * </p>
1204 * </li>
1205 * <li>
1206 * <p>
1207 * x-amz-grant-full-control
1208 * </p>
1209 * </li>
1210 * </ul>
1211 * <p>
1212 * You specify each grantee as a type=value pair, where the type is one of the following:
1213 * </p>
1214 * <ul>
1215 * <li>
1216 * <p>
1217 * <code>id</code> – if the value specified is the canonical user ID of an AWS account
1218 * </p>
1219 * </li>
1220 * <li>
1221 * <p>
1222 * <code>uri</code> – if you are granting permissions to a predefined group
1223 * </p>
1224 * </li>
1225 * <li>
1226 * <p>
1227 * <code>emailAddress</code> – if the value specified is the email address of an AWS account
1228 * </p>
1229 * <note>
1230 * <p>
1231 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
1232 * </p>
1233 * <ul>
1234 * <li>
1235 * <p>
1236 * US East (N. Virginia)
1237 * </p>
1238 * </li>
1239 * <li>
1240 * <p>
1241 * US West (N. California)
1242 * </p>
1243 * </li>
1244 * <li>
1245 * <p>
1246 * US West (Oregon)
1247 * </p>
1248 * </li>
1249 * <li>
1250 * <p>
1251 * Asia Pacific (Singapore)
1252 * </p>
1253 * </li>
1254 * <li>
1255 * <p>
1256 * Asia Pacific (Sydney)
1257 * </p>
1258 * </li>
1259 * <li>
1260 * <p>
1261 * Asia Pacific (Tokyo)
1262 * </p>
1263 * </li>
1264 * <li>
1265 * <p>
1266 * Europe (Ireland)
1267 * </p>
1268 * </li>
1269 * <li>
1270 * <p>
1271 * South America (São Paulo)
1272 * </p>
1273 * </li>
1274 * </ul>
1275 * <p>
1276 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
1277 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
1278 * General Reference.
1279 * </p>
1280 * </note></li>
1281 * </ul>
1282 * <p>
1283 * For example, the following <code>x-amz-grant-read</code> header grants the AWS accounts identified by account IDs
1284 * permissions to read object data and its metadata:
1285 * </p>
1286 * <p>
1287 * <code>x-amz-grant-read: id="11112222333", id="444455556666" </code>
1288 * </p>
1289 * </li>
1290 * </ul>
1291 * </dd>
1292 * </dl>
1293 * <p>
1294 * The following operations are related to <code>CreateMultipartUpload</code>:
1295 * </p>
1296 * <ul>
1297 * <li>
1298 * <p>
1299 * <a>UploadPart</a>
1300 * </p>
1301 * </li>
1302 * <li>
1303 * <p>
1304 * <a>CompleteMultipartUpload</a>
1305 * </p>
1306 * </li>
1307 * <li>
1308 * <p>
1309 * <a>AbortMultipartUpload</a>
1310 * </p>
1311 * </li>
1312 * <li>
1313 * <p>
1314 * <a>ListParts</a>
1315 * </p>
1316 * </li>
1317 * <li>
1318 * <p>
1319 * <a>ListMultipartUploads</a>
1320 * </p>
1321 * </li>
1322 * </ul>
1323 *
1324 * @param createMultipartUploadRequest
1325 * @return Result of the CreateMultipartUpload operation returned by the service.
1326 * @throws SdkException
1327 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1328 * catch all scenarios.
1329 * @throws SdkClientException
1330 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1331 * @throws S3Exception
1332 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1333 * @sample S3Client.CreateMultipartUpload
1334 */
1335 @Override
1336 public CreateMultipartUploadResponse createMultipartUpload(CreateMultipartUploadRequest createMultipartUploadRequest)
1337 throws AwsServiceException, SdkClientException, S3Exception {
1338
1339 HttpResponseHandler<Response<CreateMultipartUploadResponse>> responseHandler = protocolFactory
1340 .createCombinedResponseHandler(CreateMultipartUploadResponse::builder,
1341 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1342
1343 return clientHandler.execute(new ClientExecutionParams<CreateMultipartUploadRequest, CreateMultipartUploadResponse>()
1344 .withOperationName("CreateMultipartUpload").withCombinedResponseHandler(responseHandler)
1345 .withInput(createMultipartUploadRequest)
1346 .withMarshaller(new CreateMultipartUploadRequestMarshaller(protocolFactory)));
1347 }
1348
1349 /**
1350 * <p>
1351 * Deletes the bucket. All objects (including all object versions and delete markers) in the bucket must be deleted
1352 * before the bucket itself can be deleted.
1353 * </p>
1354 * <p class="title">
1355 * <b>Related Resources</b>
1356 * </p>
1357 * <ul>
1358 * <li>
1359 * <p>
1360 * </p></li>
1361 * <li>
1362 * <p>
1363 * </p></li>
1364 * </ul>
1365 *
1366 * @param deleteBucketRequest
1367 * @return Result of the DeleteBucket operation returned by the service.
1368 * @throws SdkException
1369 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1370 * catch all scenarios.
1371 * @throws SdkClientException
1372 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1373 * @throws S3Exception
1374 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1375 * @sample S3Client.DeleteBucket
1376 */
1377 @Override
1378 public DeleteBucketResponse deleteBucket(DeleteBucketRequest deleteBucketRequest) throws AwsServiceException,
1379 SdkClientException, S3Exception {
1380
1381 HttpResponseHandler<Response<DeleteBucketResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
1382 DeleteBucketResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1383
1384 return clientHandler.execute(new ClientExecutionParams<DeleteBucketRequest, DeleteBucketResponse>()
1385 .withOperationName("DeleteBucket").withCombinedResponseHandler(responseHandler).withInput(deleteBucketRequest)
1386 .withMarshaller(new DeleteBucketRequestMarshaller(protocolFactory)));
1387 }
1388
1389 /**
1390 * <p>
1391 * Deletes an analytics configuration for the bucket (specified by the analytics configuration ID).
1392 * </p>
1393 * <p>
1394 * To use this operation, you must have permissions to perform the <code>s3:PutAnalyticsConfiguration</code> action.
1395 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
1396 * information about permissions, see <a href=
1397 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
1398 * >Permissions Related to Bucket Subresource Operations</a> and <a
1399 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
1400 * Amazon S3 Resources</a>.
1401 * </p>
1402 * <p>
1403 * For information about the Amazon S3 analytics feature, see <a
1404 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html">Amazon S3 Analytics – Storage
1405 * Class Analysis</a>.
1406 * </p>
1407 * <p>
1408 * The following operations are related to <code>DeleteBucketAnalyticsConfiguration</code>:
1409 * </p>
1410 * <ul>
1411 * <li>
1412 * <p>
1413 * </p></li>
1414 * <li>
1415 * <p>
1416 * </p></li>
1417 * <li>
1418 * <p>
1419 * </p></li>
1420 * </ul>
1421 *
1422 * @param deleteBucketAnalyticsConfigurationRequest
1423 * @return Result of the DeleteBucketAnalyticsConfiguration operation returned by the service.
1424 * @throws SdkException
1425 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1426 * catch all scenarios.
1427 * @throws SdkClientException
1428 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1429 * @throws S3Exception
1430 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1431 * @sample S3Client.DeleteBucketAnalyticsConfiguration
1432 */
1433 @Override
1434 public DeleteBucketAnalyticsConfigurationResponse deleteBucketAnalyticsConfiguration(
1435 DeleteBucketAnalyticsConfigurationRequest deleteBucketAnalyticsConfigurationRequest) throws AwsServiceException,
1436 SdkClientException, S3Exception {
1437
1438 HttpResponseHandler<Response<DeleteBucketAnalyticsConfigurationResponse>> responseHandler = protocolFactory
1439 .createCombinedResponseHandler(DeleteBucketAnalyticsConfigurationResponse::builder,
1440 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1441
1442 return clientHandler
1443 .execute(new ClientExecutionParams<DeleteBucketAnalyticsConfigurationRequest, DeleteBucketAnalyticsConfigurationResponse>()
1444 .withOperationName("DeleteBucketAnalyticsConfiguration").withCombinedResponseHandler(responseHandler)
1445 .withInput(deleteBucketAnalyticsConfigurationRequest)
1446 .withMarshaller(new DeleteBucketAnalyticsConfigurationRequestMarshaller(protocolFactory)));
1447 }
1448
1449 /**
1450 * <p>
1451 * Deletes the <code>cors</code> configuration information set for the bucket.
1452 * </p>
1453 * <p>
1454 * To use this operation, you must have permission to perform the <code>s3:PutBucketCORS</code> action. The bucket
1455 * owner has this permission by default and can grant this permission to others.
1456 * </p>
1457 * <p>
1458 * For information about <code>cors</code>, see <a
1459 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html">Enabling Cross-Origin Resource Sharing</a> in
1460 * the <i>Amazon Simple Storage Service Developer Guide</i>.
1461 * </p>
1462 * <p class="title">
1463 * <b>Related Resources:</b>
1464 * </p>
1465 * <ul>
1466 * <li>
1467 * <p>
1468 * </p></li>
1469 * <li>
1470 * <p>
1471 * <a>RESTOPTIONSobject</a>
1472 * </p>
1473 * </li>
1474 * </ul>
1475 *
1476 * @param deleteBucketCorsRequest
1477 * @return Result of the DeleteBucketCors operation returned by the service.
1478 * @throws SdkException
1479 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1480 * catch all scenarios.
1481 * @throws SdkClientException
1482 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1483 * @throws S3Exception
1484 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1485 * @sample S3Client.DeleteBucketCors
1486 */
1487 @Override
1488 public DeleteBucketCorsResponse deleteBucketCors(DeleteBucketCorsRequest deleteBucketCorsRequest) throws AwsServiceException,
1489 SdkClientException, S3Exception {
1490
1491 HttpResponseHandler<Response<DeleteBucketCorsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
1492 DeleteBucketCorsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1493
1494 return clientHandler.execute(new ClientExecutionParams<DeleteBucketCorsRequest, DeleteBucketCorsResponse>()
1495 .withOperationName("DeleteBucketCors").withCombinedResponseHandler(responseHandler)
1496 .withInput(deleteBucketCorsRequest).withMarshaller(new DeleteBucketCorsRequestMarshaller(protocolFactory)));
1497 }
1498
1499 /**
1500 * <p>
1501 * This implementation of the DELETE operation removes default encryption from the bucket. For information about the
1502 * Amazon S3 default encryption feature, see <a
1503 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon S3 Default Bucket
1504 * Encryption</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
1505 * </p>
1506 * <p>
1507 * To use this operation, you must have permissions to perform the <code>s3:PutEncryptionConfiguration</code>
1508 * action. The bucket owner has this permission by default. The bucket owner can grant this permission to others.
1509 * For more information about permissions, see <a href=
1510 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
1511 * >Permissions Related to Bucket Subresource Operations</a> and <a
1512 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to your
1513 * Amazon S3 Resources</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
1514 * </p>
1515 * <p class="title">
1516 * <b>Related Resources</b>
1517 * </p>
1518 * <ul>
1519 * <li>
1520 * <p>
1521 * <a>PutBucketEncryption</a>
1522 * </p>
1523 * </li>
1524 * <li>
1525 * <p>
1526 * <a>GetBucketEncryption</a>
1527 * </p>
1528 * </li>
1529 * </ul>
1530 *
1531 * @param deleteBucketEncryptionRequest
1532 * @return Result of the DeleteBucketEncryption operation returned by the service.
1533 * @throws SdkException
1534 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1535 * catch all scenarios.
1536 * @throws SdkClientException
1537 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1538 * @throws S3Exception
1539 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1540 * @sample S3Client.DeleteBucketEncryption
1541 */
1542 @Override
1543 public DeleteBucketEncryptionResponse deleteBucketEncryption(DeleteBucketEncryptionRequest deleteBucketEncryptionRequest)
1544 throws AwsServiceException, SdkClientException, S3Exception {
1545
1546 HttpResponseHandler<Response<DeleteBucketEncryptionResponse>> responseHandler = protocolFactory
1547 .createCombinedResponseHandler(DeleteBucketEncryptionResponse::builder,
1548 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1549
1550 return clientHandler.execute(new ClientExecutionParams<DeleteBucketEncryptionRequest, DeleteBucketEncryptionResponse>()
1551 .withOperationName("DeleteBucketEncryption").withCombinedResponseHandler(responseHandler)
1552 .withInput(deleteBucketEncryptionRequest)
1553 .withMarshaller(new DeleteBucketEncryptionRequestMarshaller(protocolFactory)));
1554 }
1555
1556 /**
1557 * <p>
1558 * Deletes an inventory configuration (identified by the inventory ID) from the bucket.
1559 * </p>
1560 * <p>
1561 * To use this operation, you must have permissions to perform the <code>s3:PutInventoryConfiguration</code> action.
1562 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
1563 * information about permissions, see <a href=
1564 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
1565 * >Permissions Related to Bucket Subresource Operations</a> and <a
1566 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
1567 * Amazon S3 Resources</a>.
1568 * </p>
1569 * <p>
1570 * For information about the Amazon S3 inventory feature, see <a
1571 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html">Amazon S3 Inventory</a>.
1572 * </p>
1573 * <p>
1574 * Operations related to <code>DeleteBucketInventoryConfiguration</code> include:
1575 * </p>
1576 * <ul>
1577 * <li>
1578 * <p>
1579 * <a>GetBucketInventoryConfiguration</a>
1580 * </p>
1581 * </li>
1582 * <li>
1583 * <p>
1584 * <a>PutBucketInventoryConfiguration</a>
1585 * </p>
1586 * </li>
1587 * <li>
1588 * <p>
1589 * <a>ListBucketInventoryConfigurations</a>
1590 * </p>
1591 * </li>
1592 * </ul>
1593 *
1594 * @param deleteBucketInventoryConfigurationRequest
1595 * @return Result of the DeleteBucketInventoryConfiguration operation returned by the service.
1596 * @throws SdkException
1597 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1598 * catch all scenarios.
1599 * @throws SdkClientException
1600 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1601 * @throws S3Exception
1602 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1603 * @sample S3Client.DeleteBucketInventoryConfiguration
1604 */
1605 @Override
1606 public DeleteBucketInventoryConfigurationResponse deleteBucketInventoryConfiguration(
1607 DeleteBucketInventoryConfigurationRequest deleteBucketInventoryConfigurationRequest) throws AwsServiceException,
1608 SdkClientException, S3Exception {
1609
1610 HttpResponseHandler<Response<DeleteBucketInventoryConfigurationResponse>> responseHandler = protocolFactory
1611 .createCombinedResponseHandler(DeleteBucketInventoryConfigurationResponse::builder,
1612 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1613
1614 return clientHandler
1615 .execute(new ClientExecutionParams<DeleteBucketInventoryConfigurationRequest, DeleteBucketInventoryConfigurationResponse>()
1616 .withOperationName("DeleteBucketInventoryConfiguration").withCombinedResponseHandler(responseHandler)
1617 .withInput(deleteBucketInventoryConfigurationRequest)
1618 .withMarshaller(new DeleteBucketInventoryConfigurationRequestMarshaller(protocolFactory)));
1619 }
1620
1621 /**
1622 * <p>
1623 * Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration
1624 * rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer
1625 * automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration.
1626 * </p>
1627 * <p>
1628 * To use this operation, you must have permission to perform the <code>s3:PutLifecycleConfiguration</code> action.
1629 * By default, the bucket owner has this permission and the bucket owner can grant this permission to others.
1630 * </p>
1631 * <p>
1632 * There is usually some time lag before lifecycle configuration deletion is fully propagated to all the Amazon S3
1633 * systems.
1634 * </p>
1635 * <p>
1636 * For more information about the object expiration, see <a
1637 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions"
1638 * >Elements to Describe Lifecycle Actions</a>.
1639 * </p>
1640 * <p>
1641 * Related actions include:
1642 * </p>
1643 * <ul>
1644 * <li>
1645 * <p>
1646 * <a>PutBucketLifecycleConfiguration</a>
1647 * </p>
1648 * </li>
1649 * <li>
1650 * <p>
1651 * <a>GetBucketLifecycleConfiguration</a>
1652 * </p>
1653 * </li>
1654 * </ul>
1655 *
1656 * @param deleteBucketLifecycleRequest
1657 * @return Result of the DeleteBucketLifecycle operation returned by the service.
1658 * @throws SdkException
1659 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1660 * catch all scenarios.
1661 * @throws SdkClientException
1662 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1663 * @throws S3Exception
1664 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1665 * @sample S3Client.DeleteBucketLifecycle
1666 */
1667 @Override
1668 public DeleteBucketLifecycleResponse deleteBucketLifecycle(DeleteBucketLifecycleRequest deleteBucketLifecycleRequest)
1669 throws AwsServiceException, SdkClientException, S3Exception {
1670
1671 HttpResponseHandler<Response<DeleteBucketLifecycleResponse>> responseHandler = protocolFactory
1672 .createCombinedResponseHandler(DeleteBucketLifecycleResponse::builder,
1673 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1674
1675 return clientHandler.execute(new ClientExecutionParams<DeleteBucketLifecycleRequest, DeleteBucketLifecycleResponse>()
1676 .withOperationName("DeleteBucketLifecycle").withCombinedResponseHandler(responseHandler)
1677 .withInput(deleteBucketLifecycleRequest)
1678 .withMarshaller(new DeleteBucketLifecycleRequestMarshaller(protocolFactory)));
1679 }
1680
1681 /**
1682 * <p>
1683 * Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration
1684 * ID) from the bucket. Note that this doesn't include the daily storage metrics.
1685 * </p>
1686 * <p>
1687 * To use this operation, you must have permissions to perform the <code>s3:PutMetricsConfiguration</code> action.
1688 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
1689 * information about permissions, see <a href=
1690 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
1691 * >Permissions Related to Bucket Subresource Operations</a> and <a
1692 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
1693 * Amazon S3 Resources</a>.
1694 * </p>
1695 * <p>
1696 * For information about CloudWatch request metrics for Amazon S3, see <a
1697 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon
1698 * CloudWatch</a>.
1699 * </p>
1700 * <p>
1701 * The following operations are related to <code>DeleteBucketMetricsConfiguration</code>:
1702 * </p>
1703 * <ul>
1704 * <li>
1705 * <p>
1706 * <a>GetBucketMetricsConfiguration</a>
1707 * </p>
1708 * </li>
1709 * <li>
1710 * <p>
1711 * <a>PutBucketMetricsConfiguration</a>
1712 * </p>
1713 * </li>
1714 * <li>
1715 * <p>
1716 * <a>ListBucketMetricsConfigurations</a>
1717 * </p>
1718 * </li>
1719 * <li>
1720 * <p>
1721 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with
1722 * Amazon CloudWatch</a>
1723 * </p>
1724 * </li>
1725 * </ul>
1726 *
1727 * @param deleteBucketMetricsConfigurationRequest
1728 * @return Result of the DeleteBucketMetricsConfiguration operation returned by the service.
1729 * @throws SdkException
1730 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1731 * catch all scenarios.
1732 * @throws SdkClientException
1733 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1734 * @throws S3Exception
1735 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1736 * @sample S3Client.DeleteBucketMetricsConfiguration
1737 */
1738 @Override
1739 public DeleteBucketMetricsConfigurationResponse deleteBucketMetricsConfiguration(
1740 DeleteBucketMetricsConfigurationRequest deleteBucketMetricsConfigurationRequest) throws AwsServiceException,
1741 SdkClientException, S3Exception {
1742
1743 HttpResponseHandler<Response<DeleteBucketMetricsConfigurationResponse>> responseHandler = protocolFactory
1744 .createCombinedResponseHandler(DeleteBucketMetricsConfigurationResponse::builder,
1745 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1746
1747 return clientHandler
1748 .execute(new ClientExecutionParams<DeleteBucketMetricsConfigurationRequest, DeleteBucketMetricsConfigurationResponse>()
1749 .withOperationName("DeleteBucketMetricsConfiguration").withCombinedResponseHandler(responseHandler)
1750 .withInput(deleteBucketMetricsConfigurationRequest)
1751 .withMarshaller(new DeleteBucketMetricsConfigurationRequestMarshaller(protocolFactory)));
1752 }
1753
1754 /**
1755 * <p>
1756 * This implementation of the DELETE operation uses the policy subresource to delete the policy of a specified
1757 * bucket. If you are using an identity other than the root user of the AWS account that owns the bucket, the
1758 * calling identity must have the <code>DeleteBucketPolicy</code> permissions on the specified bucket and belong to
1759 * the bucket owner's account to use this operation.
1760 * </p>
1761 * <p>
1762 * If you don't have <code>DeleteBucketPolicy</code> permissions, Amazon S3 returns a <code>403 Access Denied</code>
1763 * error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's
1764 * account, Amazon S3 returns a <code>405 Method Not Allowed</code> error.
1765 * </p>
1766 * <important>
1767 * <p>
1768 * As a security precaution, the root user of the AWS account that owns a bucket can always use this operation, even
1769 * if the policy explicitly denies the root user the ability to perform this action.
1770 * </p>
1771 * </important>
1772 * <p>
1773 * For more information about bucket policies, see <a
1774 * href=" https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and
1775 * UserPolicies</a>.
1776 * </p>
1777 * <p>
1778 * The following operations are related to <code>DeleteBucketPolicy</code>
1779 * </p>
1780 * <ul>
1781 * <li>
1782 * <p>
1783 * <a>CreateBucket</a>
1784 * </p>
1785 * </li>
1786 * <li>
1787 * <p>
1788 * <a>DeleteObject</a>
1789 * </p>
1790 * </li>
1791 * </ul>
1792 *
1793 * @param deleteBucketPolicyRequest
1794 * @return Result of the DeleteBucketPolicy operation returned by the service.
1795 * @throws SdkException
1796 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1797 * catch all scenarios.
1798 * @throws SdkClientException
1799 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1800 * @throws S3Exception
1801 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1802 * @sample S3Client.DeleteBucketPolicy
1803 */
1804 @Override
1805 public DeleteBucketPolicyResponse deleteBucketPolicy(DeleteBucketPolicyRequest deleteBucketPolicyRequest)
1806 throws AwsServiceException, SdkClientException, S3Exception {
1807
1808 HttpResponseHandler<Response<DeleteBucketPolicyResponse>> responseHandler = protocolFactory
1809 .createCombinedResponseHandler(DeleteBucketPolicyResponse::builder,
1810 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1811
1812 return clientHandler.execute(new ClientExecutionParams<DeleteBucketPolicyRequest, DeleteBucketPolicyResponse>()
1813 .withOperationName("DeleteBucketPolicy").withCombinedResponseHandler(responseHandler)
1814 .withInput(deleteBucketPolicyRequest).withMarshaller(new DeleteBucketPolicyRequestMarshaller(protocolFactory)));
1815 }
1816
1817 /**
1818 * <p>
1819 * Deletes the replication configuration from the bucket.
1820 * </p>
1821 * <p>
1822 * To use this operation, you must have permissions to perform the <code>s3:PutReplicationConfiguration</code>
1823 * action. The bucket owner has these permissions by default and can grant it to others. For more information about
1824 * permissions, see <a href=
1825 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
1826 * >Permissions Related to Bucket Subresource Operations</a> and <a
1827 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
1828 * Amazon S3 Resources</a>.
1829 * </p>
1830 * <note>
1831 * <p>
1832 * It can take a while for the deletion of a replication configuration to fully propagate.
1833 * </p>
1834 * </note>
1835 * <p>
1836 * For information about replication configuration, see <a
1837 * href=" https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html">Replication</a> in the <i>Amazon S3
1838 * Developer Guide</i>.
1839 * </p>
1840 * <p>
1841 * The following operations are related to <code>DeleteBucketReplication</code>:
1842 * </p>
1843 * <ul>
1844 * <li>
1845 * <p>
1846 * <a>PutBucketReplication</a>
1847 * </p>
1848 * </li>
1849 * <li>
1850 * <p>
1851 * <a>GetBucketReplication</a>
1852 * </p>
1853 * </li>
1854 * </ul>
1855 *
1856 * @param deleteBucketReplicationRequest
1857 * @return Result of the DeleteBucketReplication operation returned by the service.
1858 * @throws SdkException
1859 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1860 * catch all scenarios.
1861 * @throws SdkClientException
1862 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1863 * @throws S3Exception
1864 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1865 * @sample S3Client.DeleteBucketReplication
1866 */
1867 @Override
1868 public DeleteBucketReplicationResponse deleteBucketReplication(DeleteBucketReplicationRequest deleteBucketReplicationRequest)
1869 throws AwsServiceException, SdkClientException, S3Exception {
1870
1871 HttpResponseHandler<Response<DeleteBucketReplicationResponse>> responseHandler = protocolFactory
1872 .createCombinedResponseHandler(DeleteBucketReplicationResponse::builder,
1873 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1874
1875 return clientHandler.execute(new ClientExecutionParams<DeleteBucketReplicationRequest, DeleteBucketReplicationResponse>()
1876 .withOperationName("DeleteBucketReplication").withCombinedResponseHandler(responseHandler)
1877 .withInput(deleteBucketReplicationRequest)
1878 .withMarshaller(new DeleteBucketReplicationRequestMarshaller(protocolFactory)));
1879 }
1880
1881 /**
1882 * <p>
1883 * Deletes the tags from the bucket.
1884 * </p>
1885 * <p>
1886 * To use this operation, you must have permission to perform the <code>s3:PutBucketTagging</code> action. By
1887 * default, the bucket owner has this permission and can grant this permission to others.
1888 * </p>
1889 * <p>
1890 * The following operations are related to <code>DeleteBucketTagging</code>:
1891 * </p>
1892 * <ul>
1893 * <li>
1894 * <p>
1895 * <a>GetBucketTagging</a>
1896 * </p>
1897 * </li>
1898 * <li>
1899 * <p>
1900 * <a>PutBucketTagging</a>
1901 * </p>
1902 * </li>
1903 * </ul>
1904 *
1905 * @param deleteBucketTaggingRequest
1906 * @return Result of the DeleteBucketTagging operation returned by the service.
1907 * @throws SdkException
1908 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1909 * catch all scenarios.
1910 * @throws SdkClientException
1911 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1912 * @throws S3Exception
1913 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1914 * @sample S3Client.DeleteBucketTagging
1915 */
1916 @Override
1917 public DeleteBucketTaggingResponse deleteBucketTagging(DeleteBucketTaggingRequest deleteBucketTaggingRequest)
1918 throws AwsServiceException, SdkClientException, S3Exception {
1919
1920 HttpResponseHandler<Response<DeleteBucketTaggingResponse>> responseHandler = protocolFactory
1921 .createCombinedResponseHandler(DeleteBucketTaggingResponse::builder,
1922 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1923
1924 return clientHandler.execute(new ClientExecutionParams<DeleteBucketTaggingRequest, DeleteBucketTaggingResponse>()
1925 .withOperationName("DeleteBucketTagging").withCombinedResponseHandler(responseHandler)
1926 .withInput(deleteBucketTaggingRequest).withMarshaller(new DeleteBucketTaggingRequestMarshaller(protocolFactory)));
1927 }
1928
1929 /**
1930 * <p>
1931 * This operation removes the website configuration for a bucket. Amazon S3 returns a <code>200 OK</code> response
1932 * upon successfully deleting a website configuration on the specified bucket. You will get a <code>200 OK</code>
1933 * response if the website configuration you are trying to delete does not exist on the bucket. Amazon S3 returns a
1934 * <code>404</code> response if the bucket specified in the request does not exist.
1935 * </p>
1936 * <p>
1937 * This DELETE operation requires the <code>S3:DeleteBucketWebsite</code> permission. By default, only the bucket
1938 * owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users
1939 * permission to delete the website configuration by writing a bucket policy granting them the
1940 * <code>S3:DeleteBucketWebsite</code> permission.
1941 * </p>
1942 * <p>
1943 * For more information about hosting websites, see <a
1944 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Hosting Websites on Amazon S3</a>.
1945 * </p>
1946 * <p>
1947 * The following operations are related to <code>DeleteBucketWebsite</code>:
1948 * </p>
1949 * <ul>
1950 * <li>
1951 * <p>
1952 * <a>GetBucketWebsite</a>
1953 * </p>
1954 * </li>
1955 * <li>
1956 * <p>
1957 * <a>PutBucketWebsite</a>
1958 * </p>
1959 * </li>
1960 * </ul>
1961 *
1962 * @param deleteBucketWebsiteRequest
1963 * @return Result of the DeleteBucketWebsite operation returned by the service.
1964 * @throws SdkException
1965 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
1966 * catch all scenarios.
1967 * @throws SdkClientException
1968 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
1969 * @throws S3Exception
1970 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
1971 * @sample S3Client.DeleteBucketWebsite
1972 */
1973 @Override
1974 public DeleteBucketWebsiteResponse deleteBucketWebsite(DeleteBucketWebsiteRequest deleteBucketWebsiteRequest)
1975 throws AwsServiceException, SdkClientException, S3Exception {
1976
1977 HttpResponseHandler<Response<DeleteBucketWebsiteResponse>> responseHandler = protocolFactory
1978 .createCombinedResponseHandler(DeleteBucketWebsiteResponse::builder,
1979 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
1980
1981 return clientHandler.execute(new ClientExecutionParams<DeleteBucketWebsiteRequest, DeleteBucketWebsiteResponse>()
1982 .withOperationName("DeleteBucketWebsite").withCombinedResponseHandler(responseHandler)
1983 .withInput(deleteBucketWebsiteRequest).withMarshaller(new DeleteBucketWebsiteRequestMarshaller(protocolFactory)));
1984 }
1985
1986 /**
1987 * <p>
1988 * Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest
1989 * version of the object. If there isn't a null version, Amazon S3 does not remove any objects.
1990 * </p>
1991 * <p>
1992 * To remove a specific version, you must be the bucket owner and you must use the version Id subresource. Using
1993 * this subresource permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the
1994 * response header, <code>x-amz-delete-marker</code>, to true.
1995 * </p>
1996 * <p>
1997 * If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled,
1998 * you must include the <code>x-amz-mfa</code> request header in the DELETE <code>versionId</code> request. Requests
1999 * that include <code>x-amz-mfa</code> must use HTTPS.
2000 * </p>
2001 * <p>
2002 * For more information about MFA Delete, see <a
2003 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html">Using MFA Delete</a>. To see sample
2004 * requests that use versioning, see <a
2005 * href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete">Sample
2006 * Request</a>.
2007 * </p>
2008 * <p>
2009 * You can delete objects by explicitly calling the DELETE Object API or configure its lifecycle
2010 * (<a>PutBucketLifecycle</a>) to enable Amazon S3 to remove them for you. If you want to block users or accounts
2011 * from removing or deleting objects from your bucket, you must deny them the <code>s3:DeleteObject</code>,
2012 * <code>s3:DeleteObjectVersion</code>, and <code>s3:PutLifeCycleConfiguration</code> actions.
2013 * </p>
2014 * <p>
2015 * The following operation is related to <code>DeleteObject</code>:
2016 * </p>
2017 * <ul>
2018 * <li>
2019 * <p>
2020 * <a>PutObject</a>
2021 * </p>
2022 * </li>
2023 * </ul>
2024 *
2025 * @param deleteObjectRequest
2026 * @return Result of the DeleteObject operation returned by the service.
2027 * @throws SdkException
2028 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2029 * catch all scenarios.
2030 * @throws SdkClientException
2031 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2032 * @throws S3Exception
2033 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2034 * @sample S3Client.DeleteObject
2035 */
2036 @Override
2037 public DeleteObjectResponse deleteObject(DeleteObjectRequest deleteObjectRequest) throws AwsServiceException,
2038 SdkClientException, S3Exception {
2039
2040 HttpResponseHandler<Response<DeleteObjectResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2041 DeleteObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2042
2043 return clientHandler.execute(new ClientExecutionParams<DeleteObjectRequest, DeleteObjectResponse>()
2044 .withOperationName("DeleteObject").withCombinedResponseHandler(responseHandler).withInput(deleteObjectRequest)
2045 .withMarshaller(new DeleteObjectRequestMarshaller(protocolFactory)));
2046 }
2047
2048 /**
2049 * <p>
2050 * Removes the entire tag set from the specified object. For more information about managing object tags, see <a
2051 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html"> Object Tagging</a>.
2052 * </p>
2053 * <p>
2054 * To use this operation, you must have permission to perform the <code>s3:DeleteObjectTagging</code> action.
2055 * </p>
2056 * <p>
2057 * To delete tags of a specific object version, add the <code>versionId</code> query parameter in the request. You
2058 * will need permission for the <code>s3:DeleteObjectVersionTagging</code> action.
2059 * </p>
2060 * <p>
2061 * The following operations are related to <code>DeleteBucketMetricsConfiguration</code>:
2062 * </p>
2063 * <ul>
2064 * <li>
2065 * <p>
2066 * <a>PutObjectTagging</a>
2067 * </p>
2068 * </li>
2069 * <li>
2070 * <p>
2071 * <a>GetObjectTagging</a>
2072 * </p>
2073 * </li>
2074 * </ul>
2075 *
2076 * @param deleteObjectTaggingRequest
2077 * @return Result of the DeleteObjectTagging operation returned by the service.
2078 * @throws SdkException
2079 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2080 * catch all scenarios.
2081 * @throws SdkClientException
2082 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2083 * @throws S3Exception
2084 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2085 * @sample S3Client.DeleteObjectTagging
2086 */
2087 @Override
2088 public DeleteObjectTaggingResponse deleteObjectTagging(DeleteObjectTaggingRequest deleteObjectTaggingRequest)
2089 throws AwsServiceException, SdkClientException, S3Exception {
2090
2091 HttpResponseHandler<Response<DeleteObjectTaggingResponse>> responseHandler = protocolFactory
2092 .createCombinedResponseHandler(DeleteObjectTaggingResponse::builder,
2093 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2094
2095 return clientHandler.execute(new ClientExecutionParams<DeleteObjectTaggingRequest, DeleteObjectTaggingResponse>()
2096 .withOperationName("DeleteObjectTagging").withCombinedResponseHandler(responseHandler)
2097 .withInput(deleteObjectTaggingRequest).withMarshaller(new DeleteObjectTaggingRequestMarshaller(protocolFactory)));
2098 }
2099
2100 /**
2101 * <p>
2102 * This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the
2103 * object keys that you want to delete, then this operation provides a suitable alternative to sending individual
2104 * delete requests, reducing per-request overhead.
2105 * </p>
2106 * <p>
2107 * The request contains a list of up to 1000 keys that you want to delete. In the XML, you provide the object key
2108 * names, and optionally, version IDs if you want to delete a specific version of the object from a
2109 * versioning-enabled bucket. For each key, Amazon S3 performs a delete operation and returns the result of that
2110 * delete, success, or failure, in the response. Note that if the object specified in the request is not found,
2111 * Amazon S3 returns the result as deleted.
2112 * </p>
2113 * <p>
2114 * The operation supports two modes for the response: verbose and quiet. By default, the operation uses verbose mode
2115 * in which the response includes the result of deletion of each key in your request. In quiet mode the response
2116 * includes only keys where the delete operation encountered an error. For a successful deletion, the operation does
2117 * not return any information about the delete in the response body.
2118 * </p>
2119 * <p>
2120 * When performing this operation on an MFA Delete enabled bucket, that attempts to delete any versioned objects,
2121 * you must include an MFA token. If you do not provide one, the entire request will fail, even if there are
2122 * non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys
2123 * in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see <a
2124 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete"> MFA
2125 * Delete</a>.
2126 * </p>
2127 * <p>
2128 * Finally, the Content-MD5 header is required for all Multi-Object Delete requests. Amazon S3 uses the header value
2129 * to ensure that your request body has not been altered in transit.
2130 * </p>
2131 * <p>
2132 * The following operations are related to <code>DeleteObjects</code>:
2133 * </p>
2134 * <ul>
2135 * <li>
2136 * <p>
2137 * <a>CreateMultipartUpload</a>
2138 * </p>
2139 * </li>
2140 * <li>
2141 * <p>
2142 * <a>UploadPart</a>
2143 * </p>
2144 * </li>
2145 * <li>
2146 * <p>
2147 * <a>CompleteMultipartUpload</a>
2148 * </p>
2149 * </li>
2150 * <li>
2151 * <p>
2152 * <a>ListParts</a>
2153 * </p>
2154 * </li>
2155 * <li>
2156 * <p>
2157 * <a>AbortMultipartUpload</a>
2158 * </p>
2159 * </li>
2160 * </ul>
2161 *
2162 * @param deleteObjectsRequest
2163 * @return Result of the DeleteObjects operation returned by the service.
2164 * @throws SdkException
2165 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2166 * catch all scenarios.
2167 * @throws SdkClientException
2168 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2169 * @throws S3Exception
2170 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2171 * @sample S3Client.DeleteObjects
2172 */
2173 @Override
2174 public DeleteObjectsResponse deleteObjects(DeleteObjectsRequest deleteObjectsRequest) throws AwsServiceException,
2175 SdkClientException, S3Exception {
2176
2177 HttpResponseHandler<Response<DeleteObjectsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2178 DeleteObjectsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2179
2180 return clientHandler.execute(new ClientExecutionParams<DeleteObjectsRequest, DeleteObjectsResponse>()
2181 .withOperationName("DeleteObjects").withCombinedResponseHandler(responseHandler).withInput(deleteObjectsRequest)
2182 .withMarshaller(new DeleteObjectsRequestMarshaller(protocolFactory)));
2183 }
2184
2185 /**
2186 * <p>
2187 * Removes the <code>PublicAccessBlock</code> configuration for an Amazon S3 bucket. To use this operation, you must
2188 * have the <code>s3:PutBucketPublicAccessBlock</code> permission. For more information about permissions, see <a
2189 * href=
2190 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2191 * >Permissions Related to Bucket Subresource Operations</a> and <a
2192 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2193 * Amazon S3 Resources</a>.
2194 * </p>
2195 * <p>
2196 * The following operations are related to <code>DeletePublicAccessBlock</code>:
2197 * </p>
2198 * <ul>
2199 * <li>
2200 * <p>
2201 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html">Using Amazon S3
2202 * Block Public Access</a>
2203 * </p>
2204 * </li>
2205 * <li>
2206 * <p>
2207 * <a>GetPublicAccessBlock</a>
2208 * </p>
2209 * </li>
2210 * <li>
2211 * <p>
2212 * <a>PutPublicAccessBlock</a>
2213 * </p>
2214 * </li>
2215 * <li>
2216 * <p>
2217 * <a>GetBucketPolicyStatus</a>
2218 * </p>
2219 * </li>
2220 * </ul>
2221 *
2222 * @param deletePublicAccessBlockRequest
2223 * @return Result of the DeletePublicAccessBlock operation returned by the service.
2224 * @throws SdkException
2225 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2226 * catch all scenarios.
2227 * @throws SdkClientException
2228 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2229 * @throws S3Exception
2230 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2231 * @sample S3Client.DeletePublicAccessBlock
2232 */
2233 @Override
2234 public DeletePublicAccessBlockResponse deletePublicAccessBlock(DeletePublicAccessBlockRequest deletePublicAccessBlockRequest)
2235 throws AwsServiceException, SdkClientException, S3Exception {
2236
2237 HttpResponseHandler<Response<DeletePublicAccessBlockResponse>> responseHandler = protocolFactory
2238 .createCombinedResponseHandler(DeletePublicAccessBlockResponse::builder,
2239 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2240
2241 return clientHandler.execute(new ClientExecutionParams<DeletePublicAccessBlockRequest, DeletePublicAccessBlockResponse>()
2242 .withOperationName("DeletePublicAccessBlock").withCombinedResponseHandler(responseHandler)
2243 .withInput(deletePublicAccessBlockRequest)
2244 .withMarshaller(new DeletePublicAccessBlockRequestMarshaller(protocolFactory)));
2245 }
2246
2247 /**
2248 * <p>
2249 * This implementation of the GET operation uses the <code>accelerate</code> subresource to return the Transfer
2250 * Acceleration state of a bucket, which is either <code>Enabled</code> or <code>Suspended</code>. Amazon S3
2251 * Transfer Acceleration is a bucket-level feature that enables you to perform faster data transfers to and from
2252 * Amazon S3.
2253 * </p>
2254 * <p>
2255 * To use this operation, you must have permission to perform the <code>s3:GetAccelerateConfiguration</code> action.
2256 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
2257 * information about permissions, see <a href=
2258 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2259 * >Permissions Related to Bucket Subresource Operations</a> and <a
2260 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to your
2261 * Amazon S3 Resources</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
2262 * </p>
2263 * <p>
2264 * You set the Transfer Acceleration state of an existing bucket to <code>Enabled</code> or <code>Suspended</code>
2265 * by using the <a>PutBucketAccelerateConfiguration</a> operation.
2266 * </p>
2267 * <p>
2268 * A GET <code>accelerate</code> request does not return a state value for a bucket that has no transfer
2269 * acceleration state. A bucket has no Transfer Acceleration state if a state has never been set on the bucket.
2270 * </p>
2271 * <p>
2272 * For more information about transfer acceleration, see <a
2273 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html">Transfer Acceleration</a> in
2274 * the Amazon Simple Storage Service Developer Guide.
2275 * </p>
2276 * <p class="title">
2277 * <b>Related Resources</b>
2278 * </p>
2279 * <ul>
2280 * <li>
2281 * <p>
2282 * <a>PutBucketAccelerateConfiguration</a>
2283 * </p>
2284 * </li>
2285 * </ul>
2286 *
2287 * @param getBucketAccelerateConfigurationRequest
2288 * @return Result of the GetBucketAccelerateConfiguration operation returned by the service.
2289 * @throws SdkException
2290 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2291 * catch all scenarios.
2292 * @throws SdkClientException
2293 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2294 * @throws S3Exception
2295 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2296 * @sample S3Client.GetBucketAccelerateConfiguration
2297 */
2298 @Override
2299 public GetBucketAccelerateConfigurationResponse getBucketAccelerateConfiguration(
2300 GetBucketAccelerateConfigurationRequest getBucketAccelerateConfigurationRequest) throws AwsServiceException,
2301 SdkClientException, S3Exception {
2302
2303 HttpResponseHandler<Response<GetBucketAccelerateConfigurationResponse>> responseHandler = protocolFactory
2304 .createCombinedResponseHandler(GetBucketAccelerateConfigurationResponse::builder,
2305 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2306
2307 return clientHandler
2308 .execute(new ClientExecutionParams<GetBucketAccelerateConfigurationRequest, GetBucketAccelerateConfigurationResponse>()
2309 .withOperationName("GetBucketAccelerateConfiguration").withCombinedResponseHandler(responseHandler)
2310 .withInput(getBucketAccelerateConfigurationRequest)
2311 .withMarshaller(new GetBucketAccelerateConfigurationRequestMarshaller(protocolFactory)));
2312 }
2313
2314 /**
2315 * <p>
2316 * This implementation of the <code>GET</code> operation uses the <code>acl</code> subresource to return the access
2317 * control list (ACL) of a bucket. To use <code>GET</code> to return the ACL of the bucket, you must have
2318 * <code>READ_ACP</code> access to the bucket. If <code>READ_ACP</code> permission is granted to the anonymous user,
2319 * you can return the ACL of the bucket without using an authorization header.
2320 * </p>
2321 * <p class="title">
2322 * <b>Related Resources</b>
2323 * </p>
2324 * <ul>
2325 * <li>
2326 * <p>
2327 * </p></li>
2328 * </ul>
2329 *
2330 * @param getBucketAclRequest
2331 * @return Result of the GetBucketAcl operation returned by the service.
2332 * @throws SdkException
2333 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2334 * catch all scenarios.
2335 * @throws SdkClientException
2336 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2337 * @throws S3Exception
2338 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2339 * @sample S3Client.GetBucketAcl
2340 */
2341 @Override
2342 public GetBucketAclResponse getBucketAcl(GetBucketAclRequest getBucketAclRequest) throws AwsServiceException,
2343 SdkClientException, S3Exception {
2344
2345 HttpResponseHandler<Response<GetBucketAclResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2346 GetBucketAclResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2347
2348 return clientHandler.execute(new ClientExecutionParams<GetBucketAclRequest, GetBucketAclResponse>()
2349 .withOperationName("GetBucketAcl").withCombinedResponseHandler(responseHandler).withInput(getBucketAclRequest)
2350 .withMarshaller(new GetBucketAclRequestMarshaller(protocolFactory)));
2351 }
2352
2353 /**
2354 * <p>
2355 * This implementation of the GET operation returns an analytics configuration (identified by the analytics
2356 * configuration ID) from the bucket.
2357 * </p>
2358 * <p>
2359 * To use this operation, you must have permissions to perform the <code>s3:GetAnalyticsConfiguration</code> action.
2360 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
2361 * information about permissions, see <a href=
2362 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2363 * > Permissions Related to Bucket Subresource Operations</a> and <a
2364 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2365 * Amazon S3 Resources</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
2366 * </p>
2367 * <p>
2368 * For information about Amazon S3 analytics feature, see <a
2369 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html">Amazon S3 Analytics – Storage
2370 * Class Analysis</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
2371 * </p>
2372 * <p class="title">
2373 * <b>Related Resources</b>
2374 * </p>
2375 * <ul>
2376 * <li>
2377 * <p>
2378 * </p></li>
2379 * <li>
2380 * <p>
2381 * </p></li>
2382 * <li>
2383 * <p>
2384 * </p></li>
2385 * </ul>
2386 *
2387 * @param getBucketAnalyticsConfigurationRequest
2388 * @return Result of the GetBucketAnalyticsConfiguration operation returned by the service.
2389 * @throws SdkException
2390 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2391 * catch all scenarios.
2392 * @throws SdkClientException
2393 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2394 * @throws S3Exception
2395 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2396 * @sample S3Client.GetBucketAnalyticsConfiguration
2397 */
2398 @Override
2399 public GetBucketAnalyticsConfigurationResponse getBucketAnalyticsConfiguration(
2400 GetBucketAnalyticsConfigurationRequest getBucketAnalyticsConfigurationRequest) throws AwsServiceException,
2401 SdkClientException, S3Exception {
2402
2403 HttpResponseHandler<Response<GetBucketAnalyticsConfigurationResponse>> responseHandler = protocolFactory
2404 .createCombinedResponseHandler(GetBucketAnalyticsConfigurationResponse::builder,
2405 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2406
2407 return clientHandler
2408 .execute(new ClientExecutionParams<GetBucketAnalyticsConfigurationRequest, GetBucketAnalyticsConfigurationResponse>()
2409 .withOperationName("GetBucketAnalyticsConfiguration").withCombinedResponseHandler(responseHandler)
2410 .withInput(getBucketAnalyticsConfigurationRequest)
2411 .withMarshaller(new GetBucketAnalyticsConfigurationRequestMarshaller(protocolFactory)));
2412 }
2413
2414 /**
2415 * <p>
2416 * Returns the cors configuration information set for the bucket.
2417 * </p>
2418 * <p>
2419 * To use this operation, you must have permission to perform the s3:GetBucketCORS action. By default, the bucket
2420 * owner has this permission and can grant it to others.
2421 * </p>
2422 * <p>
2423 * For more information about cors, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html">
2424 * Enabling Cross-Origin Resource Sharing</a>.
2425 * </p>
2426 * <p>
2427 * The following operations are related to <code>GetBucketCors</code>:
2428 * </p>
2429 * <ul>
2430 * <li>
2431 * <p>
2432 * <a>PutBucketCors</a>
2433 * </p>
2434 * </li>
2435 * <li>
2436 * <p>
2437 * <a>DeleteBucketCors</a>
2438 * </p>
2439 * </li>
2440 * </ul>
2441 *
2442 * @param getBucketCorsRequest
2443 * @return Result of the GetBucketCors operation returned by the service.
2444 * @throws SdkException
2445 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2446 * catch all scenarios.
2447 * @throws SdkClientException
2448 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2449 * @throws S3Exception
2450 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2451 * @sample S3Client.GetBucketCors
2452 */
2453 @Override
2454 public GetBucketCorsResponse getBucketCors(GetBucketCorsRequest getBucketCorsRequest) throws AwsServiceException,
2455 SdkClientException, S3Exception {
2456
2457 HttpResponseHandler<Response<GetBucketCorsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2458 GetBucketCorsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2459
2460 return clientHandler.execute(new ClientExecutionParams<GetBucketCorsRequest, GetBucketCorsResponse>()
2461 .withOperationName("GetBucketCors").withCombinedResponseHandler(responseHandler).withInput(getBucketCorsRequest)
2462 .withMarshaller(new GetBucketCorsRequestMarshaller(protocolFactory)));
2463 }
2464
2465 /**
2466 * <p>
2467 * Returns the default encryption configuration for an Amazon S3 bucket. For information about the Amazon S3 default
2468 * encryption feature, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon
2469 * S3 Default Bucket Encryption</a>.
2470 * </p>
2471 * <p>
2472 * To use this operation, you must have permission to perform the <code>s3:GetEncryptionConfiguration</code> action.
2473 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
2474 * information about permissions, see <a href=
2475 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2476 * >Permissions Related to Bucket Subresource Operations</a> and <a
2477 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2478 * Amazon S3 Resources</a>.
2479 * </p>
2480 * <p>
2481 * The following operations are related to <code>GetBucketEncryption</code>:
2482 * </p>
2483 * <ul>
2484 * <li>
2485 * <p>
2486 * <a>PutBucketEncryption</a>
2487 * </p>
2488 * </li>
2489 * <li>
2490 * <p>
2491 * <a>DeleteBucketEncryption</a>
2492 * </p>
2493 * </li>
2494 * </ul>
2495 *
2496 * @param getBucketEncryptionRequest
2497 * @return Result of the GetBucketEncryption operation returned by the service.
2498 * @throws SdkException
2499 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2500 * catch all scenarios.
2501 * @throws SdkClientException
2502 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2503 * @throws S3Exception
2504 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2505 * @sample S3Client.GetBucketEncryption
2506 */
2507 @Override
2508 public GetBucketEncryptionResponse getBucketEncryption(GetBucketEncryptionRequest getBucketEncryptionRequest)
2509 throws AwsServiceException, SdkClientException, S3Exception {
2510
2511 HttpResponseHandler<Response<GetBucketEncryptionResponse>> responseHandler = protocolFactory
2512 .createCombinedResponseHandler(GetBucketEncryptionResponse::builder,
2513 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2514
2515 return clientHandler.execute(new ClientExecutionParams<GetBucketEncryptionRequest, GetBucketEncryptionResponse>()
2516 .withOperationName("GetBucketEncryption").withCombinedResponseHandler(responseHandler)
2517 .withInput(getBucketEncryptionRequest).withMarshaller(new GetBucketEncryptionRequestMarshaller(protocolFactory)));
2518 }
2519
2520 /**
2521 * <p>
2522 * Returns an inventory configuration (identified by the inventory configuration ID) from the bucket.
2523 * </p>
2524 * <p>
2525 * To use this operation, you must have permissions to perform the <code>s3:GetInventoryConfiguration</code> action.
2526 * The bucket owner has this permission by default and can grant this permission to others. For more information
2527 * about permissions, see <a href=
2528 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2529 * >Permissions Related to Bucket Subresource Operations</a> and <a
2530 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2531 * Amazon S3 Resources</a>.
2532 * </p>
2533 * <p>
2534 * For information about the Amazon S3 inventory feature, see <a
2535 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html">Amazon S3 Inventory</a>.
2536 * </p>
2537 * <p>
2538 * The following operations are related to <code>GetBucketInventoryConfiguration</code>:
2539 * </p>
2540 * <ul>
2541 * <li>
2542 * <p>
2543 * <a>DeleteBucketInventoryConfiguration</a>
2544 * </p>
2545 * </li>
2546 * <li>
2547 * <p>
2548 * <a>ListBucketInventoryConfigurations</a>
2549 * </p>
2550 * </li>
2551 * <li>
2552 * <p>
2553 * <a>PutBucketInventoryConfiguration</a>
2554 * </p>
2555 * </li>
2556 * </ul>
2557 *
2558 * @param getBucketInventoryConfigurationRequest
2559 * @return Result of the GetBucketInventoryConfiguration operation returned by the service.
2560 * @throws SdkException
2561 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2562 * catch all scenarios.
2563 * @throws SdkClientException
2564 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2565 * @throws S3Exception
2566 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2567 * @sample S3Client.GetBucketInventoryConfiguration
2568 */
2569 @Override
2570 public GetBucketInventoryConfigurationResponse getBucketInventoryConfiguration(
2571 GetBucketInventoryConfigurationRequest getBucketInventoryConfigurationRequest) throws AwsServiceException,
2572 SdkClientException, S3Exception {
2573
2574 HttpResponseHandler<Response<GetBucketInventoryConfigurationResponse>> responseHandler = protocolFactory
2575 .createCombinedResponseHandler(GetBucketInventoryConfigurationResponse::builder,
2576 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2577
2578 return clientHandler
2579 .execute(new ClientExecutionParams<GetBucketInventoryConfigurationRequest, GetBucketInventoryConfigurationResponse>()
2580 .withOperationName("GetBucketInventoryConfiguration").withCombinedResponseHandler(responseHandler)
2581 .withInput(getBucketInventoryConfigurationRequest)
2582 .withMarshaller(new GetBucketInventoryConfigurationRequestMarshaller(protocolFactory)));
2583 }
2584
2585 /**
2586 * <note>
2587 * <p>
2588 * Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or
2589 * more object tags, or a combination of both. Accordingly, this section describes the latest API. The response
2590 * describes the new filter element that you can use to specify a filter to select a subset of objects to which the
2591 * rule applies. If you are still using previous version of the lifecycle configuration, it works. For the earlier
2592 * API description, see <a>GetBucketLifecycle</a>.
2593 * </p>
2594 * </note>
2595 * <p>
2596 * Returns the lifecycle configuration information set on the bucket. For information about lifecycle configuration,
2597 * see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html">Object Lifecycle
2598 * Management</a>.
2599 * </p>
2600 * <p>
2601 * To use this operation, you must have permission to perform the <code>s3:GetLifecycleConfiguration</code> action.
2602 * The bucket owner has this permission, by default. The bucket owner can grant this permission to others. For more
2603 * information about permissions, see <a href=
2604 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2605 * >Permissions Related to Bucket Subresource Operations</a> and <a
2606 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2607 * Amazon S3 Resources</a>.
2608 * </p>
2609 * <p>
2610 * <code>GetBucketLifecycleConfiguration</code> has the following special error:
2611 * </p>
2612 * <ul>
2613 * <li>
2614 * <p>
2615 * Error code: <code>NoSuchLifecycleConfiguration</code>
2616 * </p>
2617 * <ul>
2618 * <li>
2619 * <p>
2620 * Description: The lifecycle configuration does not exist.
2621 * </p>
2622 * </li>
2623 * <li>
2624 * <p>
2625 * HTTP Status Code: 404 Not Found
2626 * </p>
2627 * </li>
2628 * <li>
2629 * <p>
2630 * SOAP Fault Code Prefix: Client
2631 * </p>
2632 * </li>
2633 * </ul>
2634 * </li>
2635 * </ul>
2636 * <p>
2637 * The following operations are related to <code>GetBucketLifecycleConfiguration</code>:
2638 * </p>
2639 * <ul>
2640 * <li>
2641 * <p>
2642 * <a>GetBucketLifecycle</a>
2643 * </p>
2644 * </li>
2645 * <li>
2646 * <p>
2647 * <a>PutBucketLifecycle</a>
2648 * </p>
2649 * </li>
2650 * <li>
2651 * <p>
2652 * <a>DeleteBucketLifecycle</a>
2653 * </p>
2654 * </li>
2655 * </ul>
2656 *
2657 * @param getBucketLifecycleConfigurationRequest
2658 * @return Result of the GetBucketLifecycleConfiguration operation returned by the service.
2659 * @throws SdkException
2660 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2661 * catch all scenarios.
2662 * @throws SdkClientException
2663 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2664 * @throws S3Exception
2665 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2666 * @sample S3Client.GetBucketLifecycleConfiguration
2667 */
2668 @Override
2669 public GetBucketLifecycleConfigurationResponse getBucketLifecycleConfiguration(
2670 GetBucketLifecycleConfigurationRequest getBucketLifecycleConfigurationRequest) throws AwsServiceException,
2671 SdkClientException, S3Exception {
2672
2673 HttpResponseHandler<Response<GetBucketLifecycleConfigurationResponse>> responseHandler = protocolFactory
2674 .createCombinedResponseHandler(GetBucketLifecycleConfigurationResponse::builder,
2675 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2676
2677 return clientHandler
2678 .execute(new ClientExecutionParams<GetBucketLifecycleConfigurationRequest, GetBucketLifecycleConfigurationResponse>()
2679 .withOperationName("GetBucketLifecycleConfiguration").withCombinedResponseHandler(responseHandler)
2680 .withInput(getBucketLifecycleConfigurationRequest)
2681 .withMarshaller(new GetBucketLifecycleConfigurationRequestMarshaller(protocolFactory)));
2682 }
2683
2684 /**
2685 * <p>
2686 * Returns the Region the bucket resides in. You set the bucket's Region using the <code>LocationConstraint</code>
2687 * request parameter in a <code>CreateBucket</code> request. For more information, see <a>CreateBucket</a>.
2688 * </p>
2689 * <p>
2690 * To use this implementation of the operation, you must be the bucket owner.
2691 * </p>
2692 * <p>
2693 * The following operations are related to <code>GetBucketLocation</code>:
2694 * </p>
2695 * <ul>
2696 * <li>
2697 * <p>
2698 * <a>GetObject</a>
2699 * </p>
2700 * </li>
2701 * <li>
2702 * <p>
2703 * <a>CreateBucket</a>
2704 * </p>
2705 * </li>
2706 * </ul>
2707 *
2708 * @param getBucketLocationRequest
2709 * @return Result of the GetBucketLocation operation returned by the service.
2710 * @throws SdkException
2711 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2712 * catch all scenarios.
2713 * @throws SdkClientException
2714 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2715 * @throws S3Exception
2716 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2717 * @sample S3Client.GetBucketLocation
2718 */
2719 @Override
2720 public GetBucketLocationResponse getBucketLocation(GetBucketLocationRequest getBucketLocationRequest)
2721 throws AwsServiceException, SdkClientException, S3Exception {
2722
2723 HttpResponseHandler<Response<GetBucketLocationResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2724 GetBucketLocationResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2725
2726 return clientHandler.execute(new ClientExecutionParams<GetBucketLocationRequest, GetBucketLocationResponse>()
2727 .withOperationName("GetBucketLocation").withCombinedResponseHandler(responseHandler)
2728 .withInput(getBucketLocationRequest).withMarshaller(new GetBucketLocationRequestMarshaller(protocolFactory)));
2729 }
2730
2731 /**
2732 * <p>
2733 * Returns the logging status of a bucket and the permissions users have to view and modify that status. To use GET,
2734 * you must be the bucket owner.
2735 * </p>
2736 * <p>
2737 * The following operations are related to <code>GetBucketLogging</code>:
2738 * </p>
2739 * <ul>
2740 * <li>
2741 * <p>
2742 * <a>CreateBucket</a>
2743 * </p>
2744 * </li>
2745 * <li>
2746 * <p>
2747 * <a>PutBucketLogging</a>
2748 * </p>
2749 * </li>
2750 * </ul>
2751 *
2752 * @param getBucketLoggingRequest
2753 * @return Result of the GetBucketLogging operation returned by the service.
2754 * @throws SdkException
2755 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2756 * catch all scenarios.
2757 * @throws SdkClientException
2758 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2759 * @throws S3Exception
2760 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2761 * @sample S3Client.GetBucketLogging
2762 */
2763 @Override
2764 public GetBucketLoggingResponse getBucketLogging(GetBucketLoggingRequest getBucketLoggingRequest) throws AwsServiceException,
2765 SdkClientException, S3Exception {
2766
2767 HttpResponseHandler<Response<GetBucketLoggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2768 GetBucketLoggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2769
2770 return clientHandler.execute(new ClientExecutionParams<GetBucketLoggingRequest, GetBucketLoggingResponse>()
2771 .withOperationName("GetBucketLogging").withCombinedResponseHandler(responseHandler)
2772 .withInput(getBucketLoggingRequest).withMarshaller(new GetBucketLoggingRequestMarshaller(protocolFactory)));
2773 }
2774
2775 /**
2776 * <p>
2777 * Gets a metrics configuration (specified by the metrics configuration ID) from the bucket. Note that this doesn't
2778 * include the daily storage metrics.
2779 * </p>
2780 * <p>
2781 * To use this operation, you must have permissions to perform the <code>s3:GetMetricsConfiguration</code> action.
2782 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
2783 * information about permissions, see <a href=
2784 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
2785 * >Permissions Related to Bucket Subresource Operations</a> and <a
2786 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
2787 * Amazon S3 Resources</a>.
2788 * </p>
2789 * <p>
2790 * For information about CloudWatch request metrics for Amazon S3, see <a
2791 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon
2792 * CloudWatch</a>.
2793 * </p>
2794 * <p>
2795 * The following operations are related to <code>GetBucketMetricsConfiguration</code>:
2796 * </p>
2797 * <ul>
2798 * <li>
2799 * <p>
2800 * <a>PutBucketMetricsConfiguration</a>
2801 * </p>
2802 * </li>
2803 * <li>
2804 * <p>
2805 * <a>DeleteBucketMetricsConfiguration</a>
2806 * </p>
2807 * </li>
2808 * <li>
2809 * <p>
2810 * <a>ListBucketMetricsConfigurations</a>
2811 * </p>
2812 * </li>
2813 * <li>
2814 * <p>
2815 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with
2816 * Amazon CloudWatch</a>
2817 * </p>
2818 * </li>
2819 * </ul>
2820 *
2821 * @param getBucketMetricsConfigurationRequest
2822 * @return Result of the GetBucketMetricsConfiguration operation returned by the service.
2823 * @throws SdkException
2824 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2825 * catch all scenarios.
2826 * @throws SdkClientException
2827 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2828 * @throws S3Exception
2829 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2830 * @sample S3Client.GetBucketMetricsConfiguration
2831 */
2832 @Override
2833 public GetBucketMetricsConfigurationResponse getBucketMetricsConfiguration(
2834 GetBucketMetricsConfigurationRequest getBucketMetricsConfigurationRequest) throws AwsServiceException,
2835 SdkClientException, S3Exception {
2836
2837 HttpResponseHandler<Response<GetBucketMetricsConfigurationResponse>> responseHandler = protocolFactory
2838 .createCombinedResponseHandler(GetBucketMetricsConfigurationResponse::builder,
2839 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2840
2841 return clientHandler
2842 .execute(new ClientExecutionParams<GetBucketMetricsConfigurationRequest, GetBucketMetricsConfigurationResponse>()
2843 .withOperationName("GetBucketMetricsConfiguration").withCombinedResponseHandler(responseHandler)
2844 .withInput(getBucketMetricsConfigurationRequest)
2845 .withMarshaller(new GetBucketMetricsConfigurationRequestMarshaller(protocolFactory)));
2846 }
2847
2848 /**
2849 * <p>
2850 * Returns the notification configuration of a bucket.
2851 * </p>
2852 * <p>
2853 * If notifications are not enabled on the bucket, the operation returns an empty
2854 * <code>NotificationConfiguration</code> element.
2855 * </p>
2856 * <p>
2857 * By default, you must be the bucket owner to read the notification configuration of a bucket. However, the bucket
2858 * owner can use a bucket policy to grant permission to other users to read this configuration with the
2859 * <code>s3:GetBucketNotification</code> permission.
2860 * </p>
2861 * <p>
2862 * For more information about setting and reading the notification configuration on a bucket, see <a
2863 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Setting Up Notification of Bucket
2864 * Events</a>. For more information about bucket policies, see <a
2865 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies</a>.
2866 * </p>
2867 * <p>
2868 * The following operation is related to <code>GetBucketNotification</code>:
2869 * </p>
2870 * <ul>
2871 * <li>
2872 * <p>
2873 * <a>PutBucketNotification</a>
2874 * </p>
2875 * </li>
2876 * </ul>
2877 *
2878 * @param getBucketNotificationConfigurationRequest
2879 * @return Result of the GetBucketNotificationConfiguration operation returned by the service.
2880 * @throws SdkException
2881 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2882 * catch all scenarios.
2883 * @throws SdkClientException
2884 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2885 * @throws S3Exception
2886 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2887 * @sample S3Client.GetBucketNotificationConfiguration
2888 */
2889 @Override
2890 public GetBucketNotificationConfigurationResponse getBucketNotificationConfiguration(
2891 GetBucketNotificationConfigurationRequest getBucketNotificationConfigurationRequest) throws AwsServiceException,
2892 SdkClientException, S3Exception {
2893
2894 HttpResponseHandler<Response<GetBucketNotificationConfigurationResponse>> responseHandler = protocolFactory
2895 .createCombinedResponseHandler(GetBucketNotificationConfigurationResponse::builder,
2896 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2897
2898 return clientHandler
2899 .execute(new ClientExecutionParams<GetBucketNotificationConfigurationRequest, GetBucketNotificationConfigurationResponse>()
2900 .withOperationName("GetBucketNotificationConfiguration").withCombinedResponseHandler(responseHandler)
2901 .withInput(getBucketNotificationConfigurationRequest)
2902 .withMarshaller(new GetBucketNotificationConfigurationRequestMarshaller(protocolFactory)));
2903 }
2904
2905 /**
2906 * <p>
2907 * Returns the policy of a specified bucket. If you are using an identity other than the root user of the AWS
2908 * account that owns the bucket, the calling identity must have the <code>GetBucketPolicy</code> permissions on the
2909 * specified bucket and belong to the bucket owner's account in order to use this operation.
2910 * </p>
2911 * <p>
2912 * If you don't have <code>GetBucketPolicy</code> permissions, Amazon S3 returns a <code>403 Access Denied</code>
2913 * error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's
2914 * account, Amazon S3 returns a <code>405 Method Not Allowed</code> error.
2915 * </p>
2916 * <important>
2917 * <p>
2918 * As a security precaution, the root user of the AWS account that owns a bucket can always use this operation, even
2919 * if the policy explicitly denies the root user the ability to perform this action.
2920 * </p>
2921 * </important>
2922 * <p>
2923 * For more information about bucket policies, see <a
2924 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
2925 * Policies</a>.
2926 * </p>
2927 * <p>
2928 * The following operation is related to <code>GetBucketPolicy</code>:
2929 * </p>
2930 * <ul>
2931 * <li>
2932 * <p>
2933 * <a>GetObject</a>
2934 * </p>
2935 * </li>
2936 * </ul>
2937 *
2938 * @param getBucketPolicyRequest
2939 * @return Result of the GetBucketPolicy operation returned by the service.
2940 * @throws SdkException
2941 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
2942 * catch all scenarios.
2943 * @throws SdkClientException
2944 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
2945 * @throws S3Exception
2946 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
2947 * @sample S3Client.GetBucketPolicy
2948 */
2949 @Override
2950 public GetBucketPolicyResponse getBucketPolicy(GetBucketPolicyRequest getBucketPolicyRequest) throws AwsServiceException,
2951 SdkClientException, S3Exception {
2952
2953 HttpResponseHandler<Response<GetBucketPolicyResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
2954 GetBucketPolicyResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
2955
2956 return clientHandler.execute(new ClientExecutionParams<GetBucketPolicyRequest, GetBucketPolicyResponse>()
2957 .withOperationName("GetBucketPolicy").withCombinedResponseHandler(responseHandler)
2958 .withInput(getBucketPolicyRequest).withMarshaller(new GetBucketPolicyRequestMarshaller(protocolFactory)));
2959 }
2960
2961 /**
2962 * <p>
2963 * Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public. In order to use
2964 * this operation, you must have the <code>s3:GetBucketPolicyStatus</code> permission. For more information about
2965 * Amazon S3 permissions, see <a
2966 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying Permissions in a
2967 * Policy</a>.
2968 * </p>
2969 * <p>
2970 * For more information about when Amazon S3 considers a bucket public, see <a href=
2971 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status"
2972 * >The Meaning of "Public"</a>.
2973 * </p>
2974 * <p>
2975 * The following operations are related to <code>GetBucketPolicyStatus</code>:
2976 * </p>
2977 * <ul>
2978 * <li>
2979 * <p>
2980 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html">Using Amazon S3
2981 * Block Public Access</a>
2982 * </p>
2983 * </li>
2984 * <li>
2985 * <p>
2986 * <a>GetPublicAccessBlock</a>
2987 * </p>
2988 * </li>
2989 * <li>
2990 * <p>
2991 * <a>PutPublicAccessBlock</a>
2992 * </p>
2993 * </li>
2994 * <li>
2995 * <p>
2996 * <a>DeletePublicAccessBlock</a>
2997 * </p>
2998 * </li>
2999 * </ul>
3000 *
3001 * @param getBucketPolicyStatusRequest
3002 * @return Result of the GetBucketPolicyStatus operation returned by the service.
3003 * @throws SdkException
3004 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3005 * catch all scenarios.
3006 * @throws SdkClientException
3007 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3008 * @throws S3Exception
3009 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3010 * @sample S3Client.GetBucketPolicyStatus
3011 */
3012 @Override
3013 public GetBucketPolicyStatusResponse getBucketPolicyStatus(GetBucketPolicyStatusRequest getBucketPolicyStatusRequest)
3014 throws AwsServiceException, SdkClientException, S3Exception {
3015
3016 HttpResponseHandler<Response<GetBucketPolicyStatusResponse>> responseHandler = protocolFactory
3017 .createCombinedResponseHandler(GetBucketPolicyStatusResponse::builder,
3018 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3019
3020 return clientHandler.execute(new ClientExecutionParams<GetBucketPolicyStatusRequest, GetBucketPolicyStatusResponse>()
3021 .withOperationName("GetBucketPolicyStatus").withCombinedResponseHandler(responseHandler)
3022 .withInput(getBucketPolicyStatusRequest)
3023 .withMarshaller(new GetBucketPolicyStatusRequestMarshaller(protocolFactory)));
3024 }
3025
3026 /**
3027 * <p>
3028 * Returns the replication configuration of a bucket.
3029 * </p>
3030 * <note>
3031 * <p>
3032 * It can take a while to propagate the put or delete a replication configuration to all Amazon S3 systems.
3033 * Therefore, a get request soon after put or delete can return a wrong result.
3034 * </p>
3035 * </note>
3036 * <p>
3037 * For information about replication configuration, see <a
3038 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html">Replication</a> in the <i>Amazon Simple
3039 * Storage Service Developer Guide</i>.
3040 * </p>
3041 * <p>
3042 * This operation requires permissions for the <code>s3:GetReplicationConfiguration</code> action. For more
3043 * information about permissions, see <a
3044 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
3045 * Policies</a>.
3046 * </p>
3047 * <p>
3048 * If you include the <code>Filter</code> element in a replication configuration, you must also include the
3049 * <code>DeleteMarkerReplication</code> and <code>Priority</code> elements. The response also returns those
3050 * elements.
3051 * </p>
3052 * <p>
3053 * For information about <code>GetBucketReplication</code> errors, see <a>ReplicationErrorCodeList</a>
3054 * </p>
3055 * <p>
3056 * The following operations are related to <code>GetBucketReplication</code>:
3057 * </p>
3058 * <ul>
3059 * <li>
3060 * <p>
3061 * <a>PutBucketReplication</a>
3062 * </p>
3063 * </li>
3064 * <li>
3065 * <p>
3066 * <a>DeleteBucketReplication</a>
3067 * </p>
3068 * </li>
3069 * </ul>
3070 *
3071 * @param getBucketReplicationRequest
3072 * @return Result of the GetBucketReplication operation returned by the service.
3073 * @throws SdkException
3074 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3075 * catch all scenarios.
3076 * @throws SdkClientException
3077 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3078 * @throws S3Exception
3079 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3080 * @sample S3Client.GetBucketReplication
3081 */
3082 @Override
3083 public GetBucketReplicationResponse getBucketReplication(GetBucketReplicationRequest getBucketReplicationRequest)
3084 throws AwsServiceException, SdkClientException, S3Exception {
3085
3086 HttpResponseHandler<Response<GetBucketReplicationResponse>> responseHandler = protocolFactory
3087 .createCombinedResponseHandler(GetBucketReplicationResponse::builder,
3088 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3089
3090 return clientHandler.execute(new ClientExecutionParams<GetBucketReplicationRequest, GetBucketReplicationResponse>()
3091 .withOperationName("GetBucketReplication").withCombinedResponseHandler(responseHandler)
3092 .withInput(getBucketReplicationRequest)
3093 .withMarshaller(new GetBucketReplicationRequestMarshaller(protocolFactory)));
3094 }
3095
3096 /**
3097 * <p>
3098 * Returns the request payment configuration of a bucket. To use this version of the operation, you must be the
3099 * bucket owner. For more information, see <a
3100 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html">Requester Pays Buckets</a>.
3101 * </p>
3102 * <p>
3103 * The following operations are related to <code>GetBucketRequestPayment</code>:
3104 * </p>
3105 * <ul>
3106 * <li>
3107 * <p>
3108 * <a>ListObjects</a>
3109 * </p>
3110 * </li>
3111 * </ul>
3112 *
3113 * @param getBucketRequestPaymentRequest
3114 * @return Result of the GetBucketRequestPayment operation returned by the service.
3115 * @throws SdkException
3116 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3117 * catch all scenarios.
3118 * @throws SdkClientException
3119 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3120 * @throws S3Exception
3121 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3122 * @sample S3Client.GetBucketRequestPayment
3123 */
3124 @Override
3125 public GetBucketRequestPaymentResponse getBucketRequestPayment(GetBucketRequestPaymentRequest getBucketRequestPaymentRequest)
3126 throws AwsServiceException, SdkClientException, S3Exception {
3127
3128 HttpResponseHandler<Response<GetBucketRequestPaymentResponse>> responseHandler = protocolFactory
3129 .createCombinedResponseHandler(GetBucketRequestPaymentResponse::builder,
3130 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3131
3132 return clientHandler.execute(new ClientExecutionParams<GetBucketRequestPaymentRequest, GetBucketRequestPaymentResponse>()
3133 .withOperationName("GetBucketRequestPayment").withCombinedResponseHandler(responseHandler)
3134 .withInput(getBucketRequestPaymentRequest)
3135 .withMarshaller(new GetBucketRequestPaymentRequestMarshaller(protocolFactory)));
3136 }
3137
3138 /**
3139 * <p>
3140 * Returns the tag set associated with the bucket.
3141 * </p>
3142 * <p>
3143 * To use this operation, you must have permission to perform the <code>s3:GetBucketTagging</code> action. By
3144 * default, the bucket owner has this permission and can grant this permission to others.
3145 * </p>
3146 * <p>
3147 * <code>GetBucketTagging</code> has the following special error:
3148 * </p>
3149 * <ul>
3150 * <li>
3151 * <p>
3152 * Error code: <code>NoSuchTagSetError</code>
3153 * </p>
3154 * <ul>
3155 * <li>
3156 * <p>
3157 * Description: There is no tag set associated with the bucket.
3158 * </p>
3159 * </li>
3160 * </ul>
3161 * </li>
3162 * </ul>
3163 * <p>
3164 * The following operations are related to <code>GetBucketTagging</code>:
3165 * </p>
3166 * <ul>
3167 * <li>
3168 * <p>
3169 * <a>PutBucketTagging</a>
3170 * </p>
3171 * </li>
3172 * <li>
3173 * <p>
3174 * <a>DeleteBucketTagging</a>
3175 * </p>
3176 * </li>
3177 * </ul>
3178 *
3179 * @param getBucketTaggingRequest
3180 * @return Result of the GetBucketTagging operation returned by the service.
3181 * @throws SdkException
3182 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3183 * catch all scenarios.
3184 * @throws SdkClientException
3185 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3186 * @throws S3Exception
3187 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3188 * @sample S3Client.GetBucketTagging
3189 */
3190 @Override
3191 public GetBucketTaggingResponse getBucketTagging(GetBucketTaggingRequest getBucketTaggingRequest) throws AwsServiceException,
3192 SdkClientException, S3Exception {
3193
3194 HttpResponseHandler<Response<GetBucketTaggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
3195 GetBucketTaggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3196
3197 return clientHandler.execute(new ClientExecutionParams<GetBucketTaggingRequest, GetBucketTaggingResponse>()
3198 .withOperationName("GetBucketTagging").withCombinedResponseHandler(responseHandler)
3199 .withInput(getBucketTaggingRequest).withMarshaller(new GetBucketTaggingRequestMarshaller(protocolFactory)));
3200 }
3201
3202 /**
3203 * <p>
3204 * Returns the versioning state of a bucket.
3205 * </p>
3206 * <p>
3207 * To retrieve the versioning state of a bucket, you must be the bucket owner.
3208 * </p>
3209 * <p>
3210 * This implementation also returns the MFA Delete status of the versioning state. If the MFA Delete status is
3211 * <code>enabled</code>, the bucket owner must use an authentication device to change the versioning state of the
3212 * bucket.
3213 * </p>
3214 * <p>
3215 * The following operations are related to <code>GetBucketVersioning</code>:
3216 * </p>
3217 * <ul>
3218 * <li>
3219 * <p>
3220 * <a>GetObject</a>
3221 * </p>
3222 * </li>
3223 * <li>
3224 * <p>
3225 * <a>PutObject</a>
3226 * </p>
3227 * </li>
3228 * <li>
3229 * <p>
3230 * <a>DeleteObject</a>
3231 * </p>
3232 * </li>
3233 * </ul>
3234 *
3235 * @param getBucketVersioningRequest
3236 * @return Result of the GetBucketVersioning operation returned by the service.
3237 * @throws SdkException
3238 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3239 * catch all scenarios.
3240 * @throws SdkClientException
3241 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3242 * @throws S3Exception
3243 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3244 * @sample S3Client.GetBucketVersioning
3245 */
3246 @Override
3247 public GetBucketVersioningResponse getBucketVersioning(GetBucketVersioningRequest getBucketVersioningRequest)
3248 throws AwsServiceException, SdkClientException, S3Exception {
3249
3250 HttpResponseHandler<Response<GetBucketVersioningResponse>> responseHandler = protocolFactory
3251 .createCombinedResponseHandler(GetBucketVersioningResponse::builder,
3252 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3253
3254 return clientHandler.execute(new ClientExecutionParams<GetBucketVersioningRequest, GetBucketVersioningResponse>()
3255 .withOperationName("GetBucketVersioning").withCombinedResponseHandler(responseHandler)
3256 .withInput(getBucketVersioningRequest).withMarshaller(new GetBucketVersioningRequestMarshaller(protocolFactory)));
3257 }
3258
3259 /**
3260 * <p>
3261 * Returns the website configuration for a bucket. To host website on Amazon S3, you can configure a bucket as
3262 * website by adding a website configuration. For more information about hosting websites, see <a
3263 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Hosting Websites on Amazon S3</a>.
3264 * </p>
3265 * <p>
3266 * This GET operation requires the <code>S3:GetBucketWebsite</code> permission. By default, only the bucket owner
3267 * can read the bucket website configuration. However, bucket owners can allow other users to read the website
3268 * configuration by writing a bucket policy granting them the <code>S3:GetBucketWebsite</code> permission.
3269 * </p>
3270 * <p>
3271 * The following operations are related to <code>DeleteBucketWebsite</code>:
3272 * </p>
3273 * <ul>
3274 * <li>
3275 * <p>
3276 * <a>DeleteBucketWebsite</a>
3277 * </p>
3278 * </li>
3279 * <li>
3280 * <p>
3281 * <a>PutBucketWebsite</a>
3282 * </p>
3283 * </li>
3284 * </ul>
3285 *
3286 * @param getBucketWebsiteRequest
3287 * @return Result of the GetBucketWebsite operation returned by the service.
3288 * @throws SdkException
3289 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3290 * catch all scenarios.
3291 * @throws SdkClientException
3292 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3293 * @throws S3Exception
3294 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3295 * @sample S3Client.GetBucketWebsite
3296 */
3297 @Override
3298 public GetBucketWebsiteResponse getBucketWebsite(GetBucketWebsiteRequest getBucketWebsiteRequest) throws AwsServiceException,
3299 SdkClientException, S3Exception {
3300
3301 HttpResponseHandler<Response<GetBucketWebsiteResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
3302 GetBucketWebsiteResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3303
3304 return clientHandler.execute(new ClientExecutionParams<GetBucketWebsiteRequest, GetBucketWebsiteResponse>()
3305 .withOperationName("GetBucketWebsite").withCombinedResponseHandler(responseHandler)
3306 .withInput(getBucketWebsiteRequest).withMarshaller(new GetBucketWebsiteRequestMarshaller(protocolFactory)));
3307 }
3308
3309 /**
3310 * <p>
3311 * Retrieves objects from Amazon S3. To use <code>GET</code>, you must have <code>READ</code> access to the object.
3312 * If you grant <code>READ</code> access to the anonymous user, you can return the object without using an
3313 * authorization header.
3314 * </p>
3315 * <p>
3316 * An Amazon S3 bucket has no directory hierarchy such as you would find in a typical computer file system. You can,
3317 * however, create a logical hierarchy by using object key names that imply a folder structure. For example, instead
3318 * of naming an object <code>sample.jpg</code>, you can name it <code>photos/2006/February/sample.jpg</code>.
3319 * </p>
3320 * <p>
3321 * To get an object from such a logical hierarchy, specify the full key name for the object in the <code>GET</code>
3322 * operation. For a virtual hosted-style request example, if you have the object
3323 * <code>photos/2006/February/sample.jpg</code>, specify the resource as
3324 * <code>/photos/2006/February/sample.jpg</code>. For a path-style request example, if you have the object
3325 * <code>photos/2006/February/sample.jpg</code> in the bucket named <code>examplebucket</code>, specify the resource
3326 * as <code>/examplebucket/photos/2006/February/sample.jpg</code>. For more information about request types, see <a
3327 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket">HTTP Host
3328 * Header Bucket Specification</a>.
3329 * </p>
3330 * <p>
3331 * To distribute large files to many people, you can save bandwidth costs by using BitTorrent. For more information,
3332 * see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html">Amazon S3 Torrent</a>. For more
3333 * information about returning the ACL of an object, see <a>GetObjectAcl</a>.
3334 * </p>
3335 * <p>
3336 * If the object you are retrieving is stored in the GLACIER or DEEP_ARCHIVE storage classes, before you can
3337 * retrieve the object you must first restore a copy using . Otherwise, this operation returns an
3338 * <code>InvalidObjectStateError</code> error. For information about restoring archived objects, see <a
3339 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html">Restoring Archived Objects</a>.
3340 * </p>
3341 * <p>
3342 * Encryption request headers, like <code>x-amz-server-side-encryption</code>, should not be sent for GET requests
3343 * if your object uses server-side encryption with CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with
3344 * Amazon S3–managed encryption keys (SSE-S3). If your object does use these types of keys, you’ll get an HTTP 400
3345 * BadRequest error.
3346 * </p>
3347 * <p>
3348 * If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you
3349 * store the object in Amazon S3, then when you GET the object, you must use the following headers:
3350 * </p>
3351 * <ul>
3352 * <li>
3353 * <p>
3354 * x-amz-server-side-encryption-customer-algorithm
3355 * </p>
3356 * </li>
3357 * <li>
3358 * <p>
3359 * x-amz-server-side-encryption-customer-key
3360 * </p>
3361 * </li>
3362 * <li>
3363 * <p>
3364 * x-amz-server-side-encryption-customer-key-MD5
3365 * </p>
3366 * </li>
3367 * </ul>
3368 * <p>
3369 * For more information about SSE-C, see <a
3370 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html">Server-Side
3371 * Encryption (Using Customer-Provided Encryption Keys)</a>.
3372 * </p>
3373 * <p>
3374 * Assuming you have permission to read object tags (permission for the <code>s3:GetObjectVersionTagging</code>
3375 * action), the response also returns the <code>x-amz-tagging-count</code> header that provides the count of number
3376 * of tags associated with the object. You can use <a>GetObjectTagging</a> to retrieve the tag set associated with
3377 * an object.
3378 * </p>
3379 * <p>
3380 * <b>Permissions</b>
3381 * </p>
3382 * <p>
3383 * You need the <code>s3:GetObject</code> permission for this operation. For more information, see <a
3384 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying Permissions in a
3385 * Policy</a>. If the object you request does not exist, the error Amazon S3 returns depends on whether you also
3386 * have the <code>s3:ListBucket</code> permission.
3387 * </p>
3388 * <ul>
3389 * <li>
3390 * <p>
3391 * If you have the <code>s3:ListBucket</code> permission on the bucket, Amazon S3 will return an HTTP status code
3392 * 404 ("no such key") error.
3393 * </p>
3394 * </li>
3395 * <li>
3396 * <p>
3397 * If you don’t have the <code>s3:ListBucket</code> permission, Amazon S3 will return an HTTP status code 403
3398 * ("access denied") error.
3399 * </p>
3400 * </li>
3401 * </ul>
3402 * <p>
3403 * <b>Versioning</b>
3404 * </p>
3405 * <p>
3406 * By default, the GET operation returns the current version of an object. To return a different version, use the
3407 * <code>versionId</code> subresource.
3408 * </p>
3409 * <note>
3410 * <p>
3411 * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and
3412 * includes <code>x-amz-delete-marker: true</code> in the response.
3413 * </p>
3414 * </note>
3415 * <p>
3416 * For more information about versioning, see <a>PutBucketVersioning</a>.
3417 * </p>
3418 * <p>
3419 * <b>Overriding Response Header Values</b>
3420 * </p>
3421 * <p>
3422 * There are times when you want to override certain response header values in a GET response. For example, you
3423 * might override the Content-Disposition response header value in your GET request.
3424 * </p>
3425 * <p>
3426 * You can override values for a set of response headers using the following query parameters. These response header
3427 * values are sent only on a successful request, that is, when status code 200 OK is returned. The set of headers
3428 * you can override using these parameters is a subset of the headers that Amazon S3 accepts when you create an
3429 * object. The response headers that you can override for the GET response are <code>Content-Type</code>,
3430 * <code>Content-Language</code>, <code>Expires</code>, <code>Cache-Control</code>, <code>Content-Disposition</code>
3431 * , and <code>Content-Encoding</code>. To override these header values in the GET response, you use the following
3432 * request parameters.
3433 * </p>
3434 * <note>
3435 * <p>
3436 * You must sign the request, either using an Authorization header or a presigned URL, when using these parameters.
3437 * They cannot be used with an unsigned (anonymous) request.
3438 * </p>
3439 * </note>
3440 * <ul>
3441 * <li>
3442 * <p>
3443 * <code>response-content-type</code>
3444 * </p>
3445 * </li>
3446 * <li>
3447 * <p>
3448 * <code>response-content-language</code>
3449 * </p>
3450 * </li>
3451 * <li>
3452 * <p>
3453 * <code>response-expires</code>
3454 * </p>
3455 * </li>
3456 * <li>
3457 * <p>
3458 * <code>response-cache-control</code>
3459 * </p>
3460 * </li>
3461 * <li>
3462 * <p>
3463 * <code>response-content-disposition</code>
3464 * </p>
3465 * </li>
3466 * <li>
3467 * <p>
3468 * <code>response-content-encoding</code>
3469 * </p>
3470 * </li>
3471 * </ul>
3472 * <p>
3473 * <b>Additional Considerations about Request Headers</b>
3474 * </p>
3475 * <p>
3476 * If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as
3477 * follows: <code>If-Match</code> condition evaluates to <code>true</code>, and; <code>If-Unmodified-Since</code>
3478 * condition evaluates to <code>false</code>; then, S3 returns 200 OK and the data requested.
3479 * </p>
3480 * <p>
3481 * If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request
3482 * as follows:<code> If-None-Match</code> condition evaluates to <code>false</code>, and;
3483 * <code>If-Modified-Since</code> condition evaluates to <code>true</code>; then, S3 returns 304 Not Modified
3484 * response code.
3485 * </p>
3486 * <p>
3487 * For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.
3488 * </p>
3489 * <p>
3490 * The following operations are related to <code>GetObject</code>:
3491 * </p>
3492 * <ul>
3493 * <li>
3494 * <p>
3495 * <a>ListBuckets</a>
3496 * </p>
3497 * </li>
3498 * <li>
3499 * <p>
3500 * <a>GetObjectAcl</a>
3501 * </p>
3502 * </li>
3503 * </ul>
3504 *
3505 * @param getObjectRequest
3506 * @param responseTransformer
3507 * Functional interface for processing the streamed response content. The unmarshalled GetObjectResponse and
3508 * an InputStream to the response content are provided as parameters to the callback. The callback may return
3509 * a transformed type which will be the return value of this method. See
3510 * {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this interface
3511 * and for links to pre-canned implementations for common scenarios like downloading to a file. The service
3512 * documentation for the response content is as follows '
3513 * <p>
3514 * Object data.
3515 * </p>
3516 * '.
3517 * @return The transformed result of the ResponseTransformer.
3518 * @throws NoSuchKeyException
3519 * The specified key does not exist.
3520 * @throws SdkException
3521 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3522 * catch all scenarios.
3523 * @throws SdkClientException
3524 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3525 * @throws S3Exception
3526 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3527 * @sample S3Client.GetObject
3528 */
3529 @Override
3530 public <ReturnT> ReturnT getObject(GetObjectRequest getObjectRequest,
3531 ResponseTransformer<GetObjectResponse, ReturnT> responseTransformer) throws NoSuchKeyException, AwsServiceException,
3532 SdkClientException, S3Exception {
3533
3534 HttpResponseHandler<GetObjectResponse> responseHandler = protocolFactory.createResponseHandler(
3535 GetObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(true));
3536
3537 HttpResponseHandler<AwsServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler();
3538
3539 return clientHandler.execute(
3540 new ClientExecutionParams<GetObjectRequest, GetObjectResponse>().withOperationName("GetObject")
3541 .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
3542 .withInput(getObjectRequest).withMarshaller(new GetObjectRequestMarshaller(protocolFactory)),
3543 responseTransformer);
3544 }
3545
3546 /**
3547 * <p>
3548 * Returns the access control list (ACL) of an object. To use this operation, you must have READ_ACP access to the
3549 * object.
3550 * </p>
3551 * <p>
3552 * <b>Versioning</b>
3553 * </p>
3554 * <p>
3555 * By default, GET returns ACL information about the current version of an object. To return ACL information about a
3556 * different version, use the versionId subresource.
3557 * </p>
3558 * <p>
3559 * The following operations are related to <code>GetObjectAcl</code>:
3560 * </p>
3561 * <ul>
3562 * <li>
3563 * <p>
3564 * <a>GetObject</a>
3565 * </p>
3566 * </li>
3567 * <li>
3568 * <p>
3569 * <a>DeleteObject</a>
3570 * </p>
3571 * </li>
3572 * <li>
3573 * <p>
3574 * <a>PutObject</a>
3575 * </p>
3576 * </li>
3577 * </ul>
3578 *
3579 * @param getObjectAclRequest
3580 * @return Result of the GetObjectAcl operation returned by the service.
3581 * @throws NoSuchKeyException
3582 * The specified key does not exist.
3583 * @throws SdkException
3584 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3585 * catch all scenarios.
3586 * @throws SdkClientException
3587 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3588 * @throws S3Exception
3589 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3590 * @sample S3Client.GetObjectAcl
3591 */
3592 @Override
3593 public GetObjectAclResponse getObjectAcl(GetObjectAclRequest getObjectAclRequest) throws NoSuchKeyException,
3594 AwsServiceException, SdkClientException, S3Exception {
3595
3596 HttpResponseHandler<Response<GetObjectAclResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
3597 GetObjectAclResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3598
3599 return clientHandler.execute(new ClientExecutionParams<GetObjectAclRequest, GetObjectAclResponse>()
3600 .withOperationName("GetObjectAcl").withCombinedResponseHandler(responseHandler).withInput(getObjectAclRequest)
3601 .withMarshaller(new GetObjectAclRequestMarshaller(protocolFactory)));
3602 }
3603
3604 /**
3605 * <p>
3606 * Gets an object's current Legal Hold status. For more information, see <a
3607 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>.
3608 * </p>
3609 *
3610 * @param getObjectLegalHoldRequest
3611 * @return Result of the GetObjectLegalHold operation returned by the service.
3612 * @throws SdkException
3613 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3614 * catch all scenarios.
3615 * @throws SdkClientException
3616 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3617 * @throws S3Exception
3618 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3619 * @sample S3Client.GetObjectLegalHold
3620 */
3621 @Override
3622 public GetObjectLegalHoldResponse getObjectLegalHold(GetObjectLegalHoldRequest getObjectLegalHoldRequest)
3623 throws AwsServiceException, SdkClientException, S3Exception {
3624
3625 HttpResponseHandler<Response<GetObjectLegalHoldResponse>> responseHandler = protocolFactory
3626 .createCombinedResponseHandler(GetObjectLegalHoldResponse::builder,
3627 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3628
3629 return clientHandler.execute(new ClientExecutionParams<GetObjectLegalHoldRequest, GetObjectLegalHoldResponse>()
3630 .withOperationName("GetObjectLegalHold").withCombinedResponseHandler(responseHandler)
3631 .withInput(getObjectLegalHoldRequest).withMarshaller(new GetObjectLegalHoldRequestMarshaller(protocolFactory)));
3632 }
3633
3634 /**
3635 * <p>
3636 * Gets the Object Lock configuration for a bucket. The rule specified in the Object Lock configuration will be
3637 * applied by default to every new object placed in the specified bucket. For more information, see <a
3638 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>.
3639 * </p>
3640 *
3641 * @param getObjectLockConfigurationRequest
3642 * @return Result of the GetObjectLockConfiguration operation returned by the service.
3643 * @throws SdkException
3644 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3645 * catch all scenarios.
3646 * @throws SdkClientException
3647 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3648 * @throws S3Exception
3649 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3650 * @sample S3Client.GetObjectLockConfiguration
3651 */
3652 @Override
3653 public GetObjectLockConfigurationResponse getObjectLockConfiguration(
3654 GetObjectLockConfigurationRequest getObjectLockConfigurationRequest) throws AwsServiceException, SdkClientException,
3655 S3Exception {
3656
3657 HttpResponseHandler<Response<GetObjectLockConfigurationResponse>> responseHandler = protocolFactory
3658 .createCombinedResponseHandler(GetObjectLockConfigurationResponse::builder,
3659 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3660
3661 return clientHandler
3662 .execute(new ClientExecutionParams<GetObjectLockConfigurationRequest, GetObjectLockConfigurationResponse>()
3663 .withOperationName("GetObjectLockConfiguration").withCombinedResponseHandler(responseHandler)
3664 .withInput(getObjectLockConfigurationRequest)
3665 .withMarshaller(new GetObjectLockConfigurationRequestMarshaller(protocolFactory)));
3666 }
3667
3668 /**
3669 * <p>
3670 * Retrieves an object's retention settings. For more information, see <a
3671 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>.
3672 * </p>
3673 *
3674 * @param getObjectRetentionRequest
3675 * @return Result of the GetObjectRetention operation returned by the service.
3676 * @throws SdkException
3677 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3678 * catch all scenarios.
3679 * @throws SdkClientException
3680 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3681 * @throws S3Exception
3682 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3683 * @sample S3Client.GetObjectRetention
3684 */
3685 @Override
3686 public GetObjectRetentionResponse getObjectRetention(GetObjectRetentionRequest getObjectRetentionRequest)
3687 throws AwsServiceException, SdkClientException, S3Exception {
3688
3689 HttpResponseHandler<Response<GetObjectRetentionResponse>> responseHandler = protocolFactory
3690 .createCombinedResponseHandler(GetObjectRetentionResponse::builder,
3691 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3692
3693 return clientHandler.execute(new ClientExecutionParams<GetObjectRetentionRequest, GetObjectRetentionResponse>()
3694 .withOperationName("GetObjectRetention").withCombinedResponseHandler(responseHandler)
3695 .withInput(getObjectRetentionRequest).withMarshaller(new GetObjectRetentionRequestMarshaller(protocolFactory)));
3696 }
3697
3698 /**
3699 * <p>
3700 * Returns the tag-set of an object. You send the GET request against the tagging subresource associated with the
3701 * object.
3702 * </p>
3703 * <p>
3704 * To use this operation, you must have permission to perform the <code>s3:GetObjectTagging</code> action. By
3705 * default, the GET operation returns information about current version of an object. For a versioned bucket, you
3706 * can have multiple versions of an object in your bucket. To retrieve tags of any other version, use the versionId
3707 * query parameter. You also need permission for the <code>s3:GetObjectVersionTagging</code> action.
3708 * </p>
3709 * <p>
3710 * By default, the bucket owner has this permission and can grant this permission to others.
3711 * </p>
3712 * <p>
3713 * For information about the Amazon S3 object tagging feature, see <a
3714 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html">Object Tagging</a>.
3715 * </p>
3716 * <p>
3717 * The following operation is related to <code>GetObjectTagging</code>:
3718 * </p>
3719 * <ul>
3720 * <li>
3721 * <p>
3722 * <a>PutObjectTagging</a>
3723 * </p>
3724 * </li>
3725 * </ul>
3726 *
3727 * @param getObjectTaggingRequest
3728 * @return Result of the GetObjectTagging operation returned by the service.
3729 * @throws SdkException
3730 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3731 * catch all scenarios.
3732 * @throws SdkClientException
3733 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3734 * @throws S3Exception
3735 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3736 * @sample S3Client.GetObjectTagging
3737 */
3738 @Override
3739 public GetObjectTaggingResponse getObjectTagging(GetObjectTaggingRequest getObjectTaggingRequest) throws AwsServiceException,
3740 SdkClientException, S3Exception {
3741
3742 HttpResponseHandler<Response<GetObjectTaggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
3743 GetObjectTaggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3744
3745 return clientHandler.execute(new ClientExecutionParams<GetObjectTaggingRequest, GetObjectTaggingResponse>()
3746 .withOperationName("GetObjectTagging").withCombinedResponseHandler(responseHandler)
3747 .withInput(getObjectTaggingRequest).withMarshaller(new GetObjectTaggingRequestMarshaller(protocolFactory)));
3748 }
3749
3750 /**
3751 * <p>
3752 * Return torrent files from a bucket. BitTorrent can save you bandwidth when you're distributing large files. For
3753 * more information about BitTorrent, see <a
3754 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html">Amazon S3 Torrent</a>.
3755 * </p>
3756 * <note>
3757 * <p>
3758 * You can get torrent only for objects that are less than 5 GB in size and that are not encrypted using server-side
3759 * encryption with customer-provided encryption key.
3760 * </p>
3761 * </note>
3762 * <p>
3763 * To use GET, you must have READ access to the object.
3764 * </p>
3765 * <p>
3766 * The following operation is related to <code>GetObjectTorrent</code>:
3767 * </p>
3768 * <ul>
3769 * <li>
3770 * <p>
3771 * <a>GetObject</a>
3772 * </p>
3773 * </li>
3774 * </ul>
3775 *
3776 * @param getObjectTorrentRequest
3777 * @param responseTransformer
3778 * Functional interface for processing the streamed response content. The unmarshalled
3779 * GetObjectTorrentResponse and an InputStream to the response content are provided as parameters to the
3780 * callback. The callback may return a transformed type which will be the return value of this method. See
3781 * {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this interface
3782 * and for links to pre-canned implementations for common scenarios like downloading to a file. The service
3783 * documentation for the response content is as follows '
3784 * <p>
3785 * A Bencoded dictionary as defined by the BitTorrent specification
3786 * </p>
3787 * '.
3788 * @return The transformed result of the ResponseTransformer.
3789 * @throws SdkException
3790 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3791 * catch all scenarios.
3792 * @throws SdkClientException
3793 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3794 * @throws S3Exception
3795 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3796 * @sample S3Client.GetObjectTorrent
3797 */
3798 @Override
3799 public <ReturnT> ReturnT getObjectTorrent(GetObjectTorrentRequest getObjectTorrentRequest,
3800 ResponseTransformer<GetObjectTorrentResponse, ReturnT> responseTransformer) throws AwsServiceException,
3801 SdkClientException, S3Exception {
3802
3803 HttpResponseHandler<GetObjectTorrentResponse> responseHandler = protocolFactory.createResponseHandler(
3804 GetObjectTorrentResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(true));
3805
3806 HttpResponseHandler<AwsServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler();
3807
3808 return clientHandler.execute(
3809 new ClientExecutionParams<GetObjectTorrentRequest, GetObjectTorrentResponse>()
3810 .withOperationName("GetObjectTorrent").withResponseHandler(responseHandler)
3811 .withErrorResponseHandler(errorResponseHandler).withInput(getObjectTorrentRequest)
3812 .withMarshaller(new GetObjectTorrentRequestMarshaller(protocolFactory)), responseTransformer);
3813 }
3814
3815 /**
3816 * <p>
3817 * Retrieves the <code>PublicAccessBlock</code> configuration for an Amazon S3 bucket. To use this operation, you
3818 * must have the <code>s3:GetBucketPublicAccessBlock</code> permission. For more information about Amazon S3
3819 * permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
3820 * Permissions in a Policy</a>.
3821 * </p>
3822 * <important>
3823 * <p>
3824 * When Amazon S3 evaluates the <code>PublicAccessBlock</code> configuration for a bucket or an object, it checks
3825 * the <code>PublicAccessBlock</code> configuration for both the bucket (or the bucket that contains the object) and
3826 * the bucket owner's account. If the <code>PublicAccessBlock</code> settings are different between the bucket and
3827 * the account, Amazon S3 uses the most restrictive combination of the bucket-level and account-level settings.
3828 * </p>
3829 * </important>
3830 * <p>
3831 * For more information about when Amazon S3 considers a bucket or an object public, see <a href=
3832 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status"
3833 * >The Meaning of "Public"</a>.
3834 * </p>
3835 * <p>
3836 * The following operations are related to <code>GetPublicAccessBlock</code>:
3837 * </p>
3838 * <ul>
3839 * <li>
3840 * <p>
3841 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html">Using Amazon S3
3842 * Block Public Access</a>
3843 * </p>
3844 * </li>
3845 * <li>
3846 * <p>
3847 * <a>PutPublicAccessBlock</a>
3848 * </p>
3849 * </li>
3850 * <li>
3851 * <p>
3852 * <a>GetPublicAccessBlock</a>
3853 * </p>
3854 * </li>
3855 * <li>
3856 * <p>
3857 * <a>DeletePublicAccessBlock</a>
3858 * </p>
3859 * </li>
3860 * </ul>
3861 *
3862 * @param getPublicAccessBlockRequest
3863 * @return Result of the GetPublicAccessBlock operation returned by the service.
3864 * @throws SdkException
3865 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3866 * catch all scenarios.
3867 * @throws SdkClientException
3868 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3869 * @throws S3Exception
3870 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3871 * @sample S3Client.GetPublicAccessBlock
3872 */
3873 @Override
3874 public GetPublicAccessBlockResponse getPublicAccessBlock(GetPublicAccessBlockRequest getPublicAccessBlockRequest)
3875 throws AwsServiceException, SdkClientException, S3Exception {
3876
3877 HttpResponseHandler<Response<GetPublicAccessBlockResponse>> responseHandler = protocolFactory
3878 .createCombinedResponseHandler(GetPublicAccessBlockResponse::builder,
3879 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3880
3881 return clientHandler.execute(new ClientExecutionParams<GetPublicAccessBlockRequest, GetPublicAccessBlockResponse>()
3882 .withOperationName("GetPublicAccessBlock").withCombinedResponseHandler(responseHandler)
3883 .withInput(getPublicAccessBlockRequest)
3884 .withMarshaller(new GetPublicAccessBlockRequestMarshaller(protocolFactory)));
3885 }
3886
3887 /**
3888 * <p>
3889 * This operation is useful to determine if a bucket exists and you have permission to access it. The operation
3890 * returns a <code>200 OK</code> if the bucket exists and you have permission to access it. Otherwise, the operation
3891 * might return responses such as <code>404 Not Found</code> and <code>403 Forbidden</code>.
3892 * </p>
3893 * <p>
3894 * To use this operation, you must have permissions to perform the <code>s3:ListBucket</code> action. The bucket
3895 * owner has this permission by default and can grant this permission to others. For more information about
3896 * permissions, see <a href=
3897 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
3898 * >Permissions Related to Bucket Subresource Operations</a> and <a
3899 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
3900 * Amazon S3 Resources</a>.
3901 * </p>
3902 *
3903 * @param headBucketRequest
3904 * @return Result of the HeadBucket operation returned by the service.
3905 * @throws NoSuchBucketException
3906 * The specified bucket does not exist.
3907 * @throws SdkException
3908 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
3909 * catch all scenarios.
3910 * @throws SdkClientException
3911 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
3912 * @throws S3Exception
3913 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
3914 * @sample S3Client.HeadBucket
3915 */
3916 @Override
3917 public HeadBucketResponse headBucket(HeadBucketRequest headBucketRequest) throws NoSuchBucketException, AwsServiceException,
3918 SdkClientException, S3Exception {
3919
3920 HttpResponseHandler<Response<HeadBucketResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
3921 HeadBucketResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
3922
3923 return clientHandler.execute(new ClientExecutionParams<HeadBucketRequest, HeadBucketResponse>()
3924 .withOperationName("HeadBucket").withCombinedResponseHandler(responseHandler).withInput(headBucketRequest)
3925 .withMarshaller(new HeadBucketRequestMarshaller(protocolFactory)));
3926 }
3927
3928 /**
3929 * <p>
3930 * The HEAD operation retrieves metadata from an object without returning the object itself. This operation is
3931 * useful if you're only interested in an object's metadata. To use HEAD, you must have READ access to the object.
3932 * </p>
3933 * <p>
3934 * A <code>HEAD</code> request has the same options as a <code>GET</code> operation on an object. The response is
3935 * identical to the <code>GET</code> response except that there is no response body.
3936 * </p>
3937 * <p>
3938 * If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you
3939 * store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following
3940 * headers:
3941 * </p>
3942 * <ul>
3943 * <li>
3944 * <p>
3945 * x-amz-server-side-encryption-customer-algorithm
3946 * </p>
3947 * </li>
3948 * <li>
3949 * <p>
3950 * x-amz-server-side-encryption-customer-key
3951 * </p>
3952 * </li>
3953 * <li>
3954 * <p>
3955 * x-amz-server-side-encryption-customer-key-MD5
3956 * </p>
3957 * </li>
3958 * </ul>
3959 * <p>
3960 * For more information about SSE-C, see <a
3961 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html">Server-Side
3962 * Encryption (Using Customer-Provided Encryption Keys)</a>.
3963 * </p>
3964 * <note>
3965 * <p>
3966 * Encryption request headers, like <code>x-amz-server-side-encryption</code>, should not be sent for GET requests
3967 * if your object uses server-side encryption with CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with
3968 * Amazon S3–managed encryption keys (SSE-S3). If your object does use these types of keys, you’ll get an HTTP 400
3969 * BadRequest error.
3970 * </p>
3971 * </note>
3972 * <p>
3973 * Request headers are limited to 8 KB in size. For more information, see <a
3974 * href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html">Common Request Headers</a>.
3975 * </p>
3976 * <p>
3977 * Consider the following when using request headers:
3978 * </p>
3979 * <ul>
3980 * <li>
3981 * <p>
3982 * Consideration 1 – If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present
3983 * in the request as follows:
3984 * </p>
3985 * <ul>
3986 * <li>
3987 * <p>
3988 * <code>If-Match</code> condition evaluates to <code>true</code>, and;
3989 * </p>
3990 * </li>
3991 * <li>
3992 * <p>
3993 * <code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;
3994 * </p>
3995 * </li>
3996 * </ul>
3997 * <p>
3998 * Then Amazon S3 returns <code>200 OK</code> and the data requested.
3999 * </p>
4000 * </li>
4001 * <li>
4002 * <p>
4003 * Consideration 2 – If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are
4004 * present in the request as follows:
4005 * </p>
4006 * <ul>
4007 * <li>
4008 * <p>
4009 * <code>If-None-Match</code> condition evaluates to <code>false</code>, and;
4010 * </p>
4011 * </li>
4012 * <li>
4013 * <p>
4014 * <code>If-Modified-Since</code> condition evaluates to <code>true</code>;
4015 * </p>
4016 * </li>
4017 * </ul>
4018 * <p>
4019 * Then Amazon S3 returns the <code>304 Not Modified</code> response code.
4020 * </p>
4021 * </li>
4022 * </ul>
4023 * <p>
4024 * For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.
4025 * </p>
4026 * <p>
4027 * <b>Permissions</b>
4028 * </p>
4029 * <p>
4030 * You need the <code>s3:GetObject</code> permission for this operation. For more information, see <a
4031 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying Permissions in a
4032 * Policy</a>. If the object you request does not exist, the error Amazon S3 returns depends on whether you also
4033 * have the s3:ListBucket permission.
4034 * </p>
4035 * <ul>
4036 * <li>
4037 * <p>
4038 * If you have the <code>s3:ListBucket</code> permission on the bucket, Amazon S3 returns an HTTP status code 404
4039 * ("no such key") error.
4040 * </p>
4041 * </li>
4042 * <li>
4043 * <p>
4044 * If you don’t have the <code>s3:ListBucket</code> permission, Amazon S3 returns an HTTP status code 403
4045 * ("access denied") error.
4046 * </p>
4047 * </li>
4048 * </ul>
4049 * <p>
4050 * The following operation is related to <code>HeadObject</code>:
4051 * </p>
4052 * <ul>
4053 * <li>
4054 * <p>
4055 * <a>GetObject</a>
4056 * </p>
4057 * </li>
4058 * </ul>
4059 *
4060 * @param headObjectRequest
4061 * @return Result of the HeadObject operation returned by the service.
4062 * @throws NoSuchKeyException
4063 * The specified key does not exist.
4064 * @throws SdkException
4065 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4066 * catch all scenarios.
4067 * @throws SdkClientException
4068 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4069 * @throws S3Exception
4070 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4071 * @sample S3Client.HeadObject
4072 */
4073 @Override
4074 public HeadObjectResponse headObject(HeadObjectRequest headObjectRequest) throws NoSuchKeyException, AwsServiceException,
4075 SdkClientException, S3Exception {
4076
4077 HttpResponseHandler<Response<HeadObjectResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
4078 HeadObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4079
4080 return clientHandler.execute(new ClientExecutionParams<HeadObjectRequest, HeadObjectResponse>()
4081 .withOperationName("HeadObject").withCombinedResponseHandler(responseHandler).withInput(headObjectRequest)
4082 .withMarshaller(new HeadObjectRequestMarshaller(protocolFactory)));
4083 }
4084
4085 /**
4086 * <p>
4087 * Lists the analytics configurations for the bucket. You can have up to 1,000 analytics configurations per bucket.
4088 * </p>
4089 * <p>
4090 * This operation supports list pagination and does not return more than 100 configurations at a time. You should
4091 * always check the <code>IsTruncated</code> element in the response. If there are no more configurations to list,
4092 * <code>IsTruncated</code> is set to false. If there are more configurations to list, <code>IsTruncated</code> is
4093 * set to true, and there will be a value in <code>NextContinuationToken</code>. You use the
4094 * <code>NextContinuationToken</code> value to continue the pagination of the list by passing the value in
4095 * continuation-token in the request to <code>GET</code> the next page.
4096 * </p>
4097 * <p>
4098 * To use this operation, you must have permissions to perform the <code>s3:GetAnalyticsConfiguration</code> action.
4099 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
4100 * information about permissions, see <a href=
4101 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
4102 * >Permissions Related to Bucket Subresource Operations</a> and <a
4103 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
4104 * Amazon S3 Resources</a>.
4105 * </p>
4106 * <p>
4107 * For information about Amazon S3 analytics feature, see <a
4108 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html">Amazon S3 Analytics – Storage
4109 * Class Analysis</a>.
4110 * </p>
4111 * <p>
4112 * The following operations are related to <code>ListBucketAnalyticsConfigurations</code>:
4113 * </p>
4114 * <ul>
4115 * <li>
4116 * <p>
4117 * <a>GetBucketAnalyticsConfiguration</a>
4118 * </p>
4119 * </li>
4120 * <li>
4121 * <p>
4122 * <a>DeleteBucketAnalyticsConfiguration</a>
4123 * </p>
4124 * </li>
4125 * <li>
4126 * <p>
4127 * <a>PutBucketAnalyticsConfiguration</a>
4128 * </p>
4129 * </li>
4130 * </ul>
4131 *
4132 * @param listBucketAnalyticsConfigurationsRequest
4133 * @return Result of the ListBucketAnalyticsConfigurations operation returned by the service.
4134 * @throws SdkException
4135 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4136 * catch all scenarios.
4137 * @throws SdkClientException
4138 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4139 * @throws S3Exception
4140 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4141 * @sample S3Client.ListBucketAnalyticsConfigurations
4142 */
4143 @Override
4144 public ListBucketAnalyticsConfigurationsResponse listBucketAnalyticsConfigurations(
4145 ListBucketAnalyticsConfigurationsRequest listBucketAnalyticsConfigurationsRequest) throws AwsServiceException,
4146 SdkClientException, S3Exception {
4147
4148 HttpResponseHandler<Response<ListBucketAnalyticsConfigurationsResponse>> responseHandler = protocolFactory
4149 .createCombinedResponseHandler(ListBucketAnalyticsConfigurationsResponse::builder,
4150 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4151
4152 return clientHandler
4153 .execute(new ClientExecutionParams<ListBucketAnalyticsConfigurationsRequest, ListBucketAnalyticsConfigurationsResponse>()
4154 .withOperationName("ListBucketAnalyticsConfigurations").withCombinedResponseHandler(responseHandler)
4155 .withInput(listBucketAnalyticsConfigurationsRequest)
4156 .withMarshaller(new ListBucketAnalyticsConfigurationsRequestMarshaller(protocolFactory)));
4157 }
4158
4159 /**
4160 * <p>
4161 * Returns a list of inventory configurations for the bucket. You can have up to 1,000 analytics configurations per
4162 * bucket.
4163 * </p>
4164 * <p>
4165 * This operation supports list pagination and does not return more than 100 configurations at a time. Always check
4166 * the <code>IsTruncated</code> element in the response. If there are no more configurations to list,
4167 * <code>IsTruncated</code> is set to false. If there are more configurations to list, <code>IsTruncated</code> is
4168 * set to true, and there is a value in <code>NextContinuationToken</code>. You use the
4169 * <code>NextContinuationToken</code> value to continue the pagination of the list by passing the value in
4170 * continuation-token in the request to <code>GET</code> the next page.
4171 * </p>
4172 * <p>
4173 * To use this operation, you must have permissions to perform the <code>s3:GetInventoryConfiguration</code> action.
4174 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
4175 * information about permissions, see <a href=
4176 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
4177 * >Permissions Related to Bucket Subresource Operations</a> and <a
4178 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
4179 * Amazon S3 Resources</a>.
4180 * </p>
4181 * <p>
4182 * For information about the Amazon S3 inventory feature, see <a
4183 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html">Amazon S3 Inventory</a>
4184 * </p>
4185 * <p>
4186 * The following operations are related to <code>ListBucketInventoryConfigurations</code>:
4187 * </p>
4188 * <ul>
4189 * <li>
4190 * <p>
4191 * <a>GetBucketInventoryConfiguration</a>
4192 * </p>
4193 * </li>
4194 * <li>
4195 * <p>
4196 * <a>DeleteBucketInventoryConfiguration</a>
4197 * </p>
4198 * </li>
4199 * <li>
4200 * <p>
4201 * <a>PutBucketInventoryConfiguration</a>
4202 * </p>
4203 * </li>
4204 * </ul>
4205 *
4206 * @param listBucketInventoryConfigurationsRequest
4207 * @return Result of the ListBucketInventoryConfigurations operation returned by the service.
4208 * @throws SdkException
4209 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4210 * catch all scenarios.
4211 * @throws SdkClientException
4212 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4213 * @throws S3Exception
4214 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4215 * @sample S3Client.ListBucketInventoryConfigurations
4216 */
4217 @Override
4218 public ListBucketInventoryConfigurationsResponse listBucketInventoryConfigurations(
4219 ListBucketInventoryConfigurationsRequest listBucketInventoryConfigurationsRequest) throws AwsServiceException,
4220 SdkClientException, S3Exception {
4221
4222 HttpResponseHandler<Response<ListBucketInventoryConfigurationsResponse>> responseHandler = protocolFactory
4223 .createCombinedResponseHandler(ListBucketInventoryConfigurationsResponse::builder,
4224 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4225
4226 return clientHandler
4227 .execute(new ClientExecutionParams<ListBucketInventoryConfigurationsRequest, ListBucketInventoryConfigurationsResponse>()
4228 .withOperationName("ListBucketInventoryConfigurations").withCombinedResponseHandler(responseHandler)
4229 .withInput(listBucketInventoryConfigurationsRequest)
4230 .withMarshaller(new ListBucketInventoryConfigurationsRequestMarshaller(protocolFactory)));
4231 }
4232
4233 /**
4234 * <p>
4235 * Lists the metrics configurations for the bucket. The metrics configurations are only for the request metrics of
4236 * the bucket and do not provide information on daily storage metrics. You can have up to 1,000 configurations per
4237 * bucket.
4238 * </p>
4239 * <p>
4240 * This operation supports list pagination and does not return more than 100 configurations at a time. Always check
4241 * the <code>IsTruncated</code> element in the response. If there are no more configurations to list,
4242 * <code>IsTruncated</code> is set to false. If there are more configurations to list, <code>IsTruncated</code> is
4243 * set to true, and there is a value in <code>NextContinuationToken</code>. You use the
4244 * <code>NextContinuationToken</code> value to continue the pagination of the list by passing the value in
4245 * <code>continuation-token</code> in the request to <code>GET</code> the next page.
4246 * </p>
4247 * <p>
4248 * To use this operation, you must have permissions to perform the <code>s3:GetMetricsConfiguration</code> action.
4249 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
4250 * information about permissions, see <a href=
4251 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
4252 * >Permissions Related to Bucket Subresource Operations</a> and <a
4253 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
4254 * Amazon S3 Resources</a>.
4255 * </p>
4256 * <p>
4257 * For more information about metrics configurations and CloudWatch request metrics, see <a
4258 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon
4259 * CloudWatch</a>.
4260 * </p>
4261 * <p>
4262 * The following operations are related to <code>ListBucketMetricsConfigurations</code>:
4263 * </p>
4264 * <ul>
4265 * <li>
4266 * <p>
4267 * <a>PutBucketMetricsConfiguration</a>
4268 * </p>
4269 * </li>
4270 * <li>
4271 * <p>
4272 * <a>GetBucketMetricsConfiguration</a>
4273 * </p>
4274 * </li>
4275 * <li>
4276 * <p>
4277 * <a>DeleteBucketMetricsConfiguration</a>
4278 * </p>
4279 * </li>
4280 * </ul>
4281 *
4282 * @param listBucketMetricsConfigurationsRequest
4283 * @return Result of the ListBucketMetricsConfigurations operation returned by the service.
4284 * @throws SdkException
4285 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4286 * catch all scenarios.
4287 * @throws SdkClientException
4288 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4289 * @throws S3Exception
4290 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4291 * @sample S3Client.ListBucketMetricsConfigurations
4292 */
4293 @Override
4294 public ListBucketMetricsConfigurationsResponse listBucketMetricsConfigurations(
4295 ListBucketMetricsConfigurationsRequest listBucketMetricsConfigurationsRequest) throws AwsServiceException,
4296 SdkClientException, S3Exception {
4297
4298 HttpResponseHandler<Response<ListBucketMetricsConfigurationsResponse>> responseHandler = protocolFactory
4299 .createCombinedResponseHandler(ListBucketMetricsConfigurationsResponse::builder,
4300 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4301
4302 return clientHandler
4303 .execute(new ClientExecutionParams<ListBucketMetricsConfigurationsRequest, ListBucketMetricsConfigurationsResponse>()
4304 .withOperationName("ListBucketMetricsConfigurations").withCombinedResponseHandler(responseHandler)
4305 .withInput(listBucketMetricsConfigurationsRequest)
4306 .withMarshaller(new ListBucketMetricsConfigurationsRequestMarshaller(protocolFactory)));
4307 }
4308
4309 /**
4310 * <p>
4311 * Returns a list of all buckets owned by the authenticated sender of the request.
4312 * </p>
4313 *
4314 * @param listBucketsRequest
4315 * @return Result of the ListBuckets operation returned by the service.
4316 * @throws SdkException
4317 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4318 * catch all scenarios.
4319 * @throws SdkClientException
4320 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4321 * @throws S3Exception
4322 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4323 * @sample S3Client.ListBuckets
4324 */
4325 @Override
4326 public ListBucketsResponse listBuckets(ListBucketsRequest listBucketsRequest) throws AwsServiceException, SdkClientException,
4327 S3Exception {
4328
4329 HttpResponseHandler<Response<ListBucketsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
4330 ListBucketsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4331
4332 return clientHandler.execute(new ClientExecutionParams<ListBucketsRequest, ListBucketsResponse>()
4333 .withOperationName("ListBuckets").withCombinedResponseHandler(responseHandler).withInput(listBucketsRequest)
4334 .withMarshaller(new ListBucketsRequestMarshaller(protocolFactory)));
4335 }
4336
4337 /**
4338 * <p>
4339 * This operation lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that
4340 * has been initiated using the Initiate Multipart Upload request, but has not yet been completed or aborted.
4341 * </p>
4342 * <p>
4343 * This operation returns at most 1,000 multipart uploads in the response. 1,000 multipart uploads is the maximum
4344 * number of uploads a response can include, which is also the default value. You can further limit the number of
4345 * uploads in a response by specifying the <code>max-uploads</code> parameter in the response. If additional
4346 * multipart uploads satisfy the list criteria, the response will contain an <code>IsTruncated</code> element with
4347 * the value true. To list the additional multipart uploads, use the <code>key-marker</code> and
4348 * <code>upload-id-marker</code> request parameters.
4349 * </p>
4350 * <p>
4351 * In the response, the uploads are sorted by key. If your application has initiated more than one multipart upload
4352 * using the same object key, then uploads in the response are first sorted by key. Additionally, uploads are sorted
4353 * in ascending order within each key by the upload initiation time.
4354 * </p>
4355 * <p>
4356 * For more information on multipart uploads, see <a
4357 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
4358 * Upload</a>.
4359 * </p>
4360 * <p>
4361 * For information on permissions required to use the multipart upload API, see <a
4362 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
4363 * Permissions</a>.
4364 * </p>
4365 * <p>
4366 * The following operations are related to <code>ListMultipartUploads</code>:
4367 * </p>
4368 * <ul>
4369 * <li>
4370 * <p>
4371 * <a>CreateMultipartUpload</a>
4372 * </p>
4373 * </li>
4374 * <li>
4375 * <p>
4376 * <a>UploadPart</a>
4377 * </p>
4378 * </li>
4379 * <li>
4380 * <p>
4381 * <a>CompleteMultipartUpload</a>
4382 * </p>
4383 * </li>
4384 * <li>
4385 * <p>
4386 * <a>ListParts</a>
4387 * </p>
4388 * </li>
4389 * <li>
4390 * <p>
4391 * <a>AbortMultipartUpload</a>
4392 * </p>
4393 * </li>
4394 * </ul>
4395 *
4396 * @param listMultipartUploadsRequest
4397 * @return Result of the ListMultipartUploads operation returned by the service.
4398 * @throws SdkException
4399 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4400 * catch all scenarios.
4401 * @throws SdkClientException
4402 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4403 * @throws S3Exception
4404 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4405 * @sample S3Client.ListMultipartUploads
4406 */
4407 @Override
4408 public ListMultipartUploadsResponse listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest)
4409 throws AwsServiceException, SdkClientException, S3Exception {
4410
4411 HttpResponseHandler<Response<ListMultipartUploadsResponse>> responseHandler = protocolFactory
4412 .createCombinedResponseHandler(ListMultipartUploadsResponse::builder,
4413 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4414
4415 return clientHandler.execute(new ClientExecutionParams<ListMultipartUploadsRequest, ListMultipartUploadsResponse>()
4416 .withOperationName("ListMultipartUploads").withCombinedResponseHandler(responseHandler)
4417 .withInput(listMultipartUploadsRequest)
4418 .withMarshaller(new ListMultipartUploadsRequestMarshaller(protocolFactory)));
4419 }
4420
4421 /**
4422 * <p>
4423 * This operation lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that
4424 * has been initiated using the Initiate Multipart Upload request, but has not yet been completed or aborted.
4425 * </p>
4426 * <p>
4427 * This operation returns at most 1,000 multipart uploads in the response. 1,000 multipart uploads is the maximum
4428 * number of uploads a response can include, which is also the default value. You can further limit the number of
4429 * uploads in a response by specifying the <code>max-uploads</code> parameter in the response. If additional
4430 * multipart uploads satisfy the list criteria, the response will contain an <code>IsTruncated</code> element with
4431 * the value true. To list the additional multipart uploads, use the <code>key-marker</code> and
4432 * <code>upload-id-marker</code> request parameters.
4433 * </p>
4434 * <p>
4435 * In the response, the uploads are sorted by key. If your application has initiated more than one multipart upload
4436 * using the same object key, then uploads in the response are first sorted by key. Additionally, uploads are sorted
4437 * in ascending order within each key by the upload initiation time.
4438 * </p>
4439 * <p>
4440 * For more information on multipart uploads, see <a
4441 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
4442 * Upload</a>.
4443 * </p>
4444 * <p>
4445 * For information on permissions required to use the multipart upload API, see <a
4446 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
4447 * Permissions</a>.
4448 * </p>
4449 * <p>
4450 * The following operations are related to <code>ListMultipartUploads</code>:
4451 * </p>
4452 * <ul>
4453 * <li>
4454 * <p>
4455 * <a>CreateMultipartUpload</a>
4456 * </p>
4457 * </li>
4458 * <li>
4459 * <p>
4460 * <a>UploadPart</a>
4461 * </p>
4462 * </li>
4463 * <li>
4464 * <p>
4465 * <a>CompleteMultipartUpload</a>
4466 * </p>
4467 * </li>
4468 * <li>
4469 * <p>
4470 * <a>ListParts</a>
4471 * </p>
4472 * </li>
4473 * <li>
4474 * <p>
4475 * <a>AbortMultipartUpload</a>
4476 * </p>
4477 * </li>
4478 * </ul>
4479 * <br/>
4480 * <p>
4481 * This is a variant of
4482 * {@link #listMultipartUploads(software.amazon.awssdk.services.s3.model.ListMultipartUploadsRequest)} operation.
4483 * The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
4484 * handle making service calls for you.
4485 * </p>
4486 * <p>
4487 * When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
4488 * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
4489 * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
4490 * request, you will see the failures only after you start iterating through the iterable.
4491 * </p>
4492 *
4493 * <p>
4494 * The following are few ways to iterate through the response pages:
4495 * </p>
4496 * 1) Using a Stream
4497 *
4498 * <pre>
4499 * {@code
4500 * software.amazon.awssdk.services.s3.paginators.ListMultipartUploadsIterable responses = client.listMultipartUploadsPaginator(request);
4501 * responses.stream().forEach(....);
4502 * }
4503 * </pre>
4504 *
4505 * 2) Using For loop
4506 *
4507 * <pre>
4508 * {
4509 * @code
4510 * software.amazon.awssdk.services.s3.paginators.ListMultipartUploadsIterable responses = client
4511 * .listMultipartUploadsPaginator(request);
4512 * for (software.amazon.awssdk.services.s3.model.ListMultipartUploadsResponse response : responses) {
4513 * // do something;
4514 * }
4515 * }
4516 * </pre>
4517 *
4518 * 3) Use iterator directly
4519 *
4520 * <pre>
4521 * {@code
4522 * software.amazon.awssdk.services.s3.paginators.ListMultipartUploadsIterable responses = client.listMultipartUploadsPaginator(request);
4523 * responses.iterator().forEachRemaining(....);
4524 * }
4525 * </pre>
4526 * <p>
4527 * <b>Please notice that the configuration of MaxUploads won't limit the number of results you get with the
4528 * paginator. It only limits the number of results in each page.</b>
4529 * </p>
4530 * <p>
4531 * <b>Note: If you prefer to have control on service calls, use the
4532 * {@link #listMultipartUploads(software.amazon.awssdk.services.s3.model.ListMultipartUploadsRequest)}
4533 * operation.</b>
4534 * </p>
4535 *
4536 * @param listMultipartUploadsRequest
4537 * @return A custom iterable that can be used to iterate through all the response pages.
4538 * @throws SdkException
4539 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4540 * catch all scenarios.
4541 * @throws SdkClientException
4542 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4543 * @throws S3Exception
4544 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4545 * @sample S3Client.ListMultipartUploads
4546 */
4547 @Override
4548 public ListMultipartUploadsIterable listMultipartUploadsPaginator(ListMultipartUploadsRequest listMultipartUploadsRequest)
4549 throws AwsServiceException, SdkClientException, S3Exception {
4550 return new ListMultipartUploadsIterable(this, applyPaginatorUserAgent(listMultipartUploadsRequest));
4551 }
4552
4553 /**
4554 * <p>
4555 * Returns metadata about all of the versions of objects in a bucket. You can also use request parameters as
4556 * selection criteria to return metadata about a subset of all the object versions.
4557 * </p>
4558 * <note>
4559 * <p>
4560 * A 200 OK response can contain valid or invalid XML. Make sure to design your application to parse the contents of
4561 * the response and handle it appropriately.
4562 * </p>
4563 * </note>
4564 * <p>
4565 * To use this operation, you must have READ access to the bucket.
4566 * </p>
4567 * <p>
4568 * The following operations are related to <code>ListObjectVersions</code>:
4569 * </p>
4570 * <ul>
4571 * <li>
4572 * <p>
4573 * <a>ListObjectsV2</a>
4574 * </p>
4575 * </li>
4576 * <li>
4577 * <p>
4578 * <a>GetObject</a>
4579 * </p>
4580 * </li>
4581 * <li>
4582 * <p>
4583 * <a>PutObject</a>
4584 * </p>
4585 * </li>
4586 * <li>
4587 * <p>
4588 * <a>DeleteObject</a>
4589 * </p>
4590 * </li>
4591 * </ul>
4592 *
4593 * @param listObjectVersionsRequest
4594 * @return Result of the ListObjectVersions operation returned by the service.
4595 * @throws SdkException
4596 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4597 * catch all scenarios.
4598 * @throws SdkClientException
4599 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4600 * @throws S3Exception
4601 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4602 * @sample S3Client.ListObjectVersions
4603 */
4604 @Override
4605 public ListObjectVersionsResponse listObjectVersions(ListObjectVersionsRequest listObjectVersionsRequest)
4606 throws AwsServiceException, SdkClientException, S3Exception {
4607
4608 HttpResponseHandler<Response<ListObjectVersionsResponse>> responseHandler = protocolFactory
4609 .createCombinedResponseHandler(ListObjectVersionsResponse::builder,
4610 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4611
4612 return clientHandler.execute(new ClientExecutionParams<ListObjectVersionsRequest, ListObjectVersionsResponse>()
4613 .withOperationName("ListObjectVersions").withCombinedResponseHandler(responseHandler)
4614 .withInput(listObjectVersionsRequest).withMarshaller(new ListObjectVersionsRequestMarshaller(protocolFactory)));
4615 }
4616
4617 /**
4618 * <p>
4619 * Returns metadata about all of the versions of objects in a bucket. You can also use request parameters as
4620 * selection criteria to return metadata about a subset of all the object versions.
4621 * </p>
4622 * <note>
4623 * <p>
4624 * A 200 OK response can contain valid or invalid XML. Make sure to design your application to parse the contents of
4625 * the response and handle it appropriately.
4626 * </p>
4627 * </note>
4628 * <p>
4629 * To use this operation, you must have READ access to the bucket.
4630 * </p>
4631 * <p>
4632 * The following operations are related to <code>ListObjectVersions</code>:
4633 * </p>
4634 * <ul>
4635 * <li>
4636 * <p>
4637 * <a>ListObjectsV2</a>
4638 * </p>
4639 * </li>
4640 * <li>
4641 * <p>
4642 * <a>GetObject</a>
4643 * </p>
4644 * </li>
4645 * <li>
4646 * <p>
4647 * <a>PutObject</a>
4648 * </p>
4649 * </li>
4650 * <li>
4651 * <p>
4652 * <a>DeleteObject</a>
4653 * </p>
4654 * </li>
4655 * </ul>
4656 * <br/>
4657 * <p>
4658 * This is a variant of
4659 * {@link #listObjectVersions(software.amazon.awssdk.services.s3.model.ListObjectVersionsRequest)} operation. The
4660 * return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
4661 * making service calls for you.
4662 * </p>
4663 * <p>
4664 * When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
4665 * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
4666 * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
4667 * request, you will see the failures only after you start iterating through the iterable.
4668 * </p>
4669 *
4670 * <p>
4671 * The following are few ways to iterate through the response pages:
4672 * </p>
4673 * 1) Using a Stream
4674 *
4675 * <pre>
4676 * {@code
4677 * software.amazon.awssdk.services.s3.paginators.ListObjectVersionsIterable responses = client.listObjectVersionsPaginator(request);
4678 * responses.stream().forEach(....);
4679 * }
4680 * </pre>
4681 *
4682 * 2) Using For loop
4683 *
4684 * <pre>
4685 * {
4686 * @code
4687 * software.amazon.awssdk.services.s3.paginators.ListObjectVersionsIterable responses = client
4688 * .listObjectVersionsPaginator(request);
4689 * for (software.amazon.awssdk.services.s3.model.ListObjectVersionsResponse response : responses) {
4690 * // do something;
4691 * }
4692 * }
4693 * </pre>
4694 *
4695 * 3) Use iterator directly
4696 *
4697 * <pre>
4698 * {@code
4699 * software.amazon.awssdk.services.s3.paginators.ListObjectVersionsIterable responses = client.listObjectVersionsPaginator(request);
4700 * responses.iterator().forEachRemaining(....);
4701 * }
4702 * </pre>
4703 * <p>
4704 * <b>Please notice that the configuration of MaxKeys won't limit the number of results you get with the paginator.
4705 * It only limits the number of results in each page.</b>
4706 * </p>
4707 * <p>
4708 * <b>Note: If you prefer to have control on service calls, use the
4709 * {@link #listObjectVersions(software.amazon.awssdk.services.s3.model.ListObjectVersionsRequest)} operation.</b>
4710 * </p>
4711 *
4712 * @param listObjectVersionsRequest
4713 * @return A custom iterable that can be used to iterate through all the response pages.
4714 * @throws SdkException
4715 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4716 * catch all scenarios.
4717 * @throws SdkClientException
4718 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4719 * @throws S3Exception
4720 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4721 * @sample S3Client.ListObjectVersions
4722 */
4723 @Override
4724 public ListObjectVersionsIterable listObjectVersionsPaginator(ListObjectVersionsRequest listObjectVersionsRequest)
4725 throws AwsServiceException, SdkClientException, S3Exception {
4726 return new ListObjectVersionsIterable(this, applyPaginatorUserAgent(listObjectVersionsRequest));
4727 }
4728
4729 /**
4730 * <p>
4731 * Returns some or all (up to 1,000) of the objects in a bucket. You can use the request parameters as selection
4732 * criteria to return a subset of the objects in a bucket. A 200 OK response can contain valid or invalid XML. Be
4733 * sure to design your application to parse the contents of the response and handle it appropriately.
4734 * </p>
4735 * <important>
4736 * <p>
4737 * This API has been revised. We recommend that you use the newer version, <a>ListObjectsV2</a>, when developing
4738 * applications. For backward compatibility, Amazon S3 continues to support <code>ListObjects</code>.
4739 * </p>
4740 * </important>
4741 * <p>
4742 * The following operations are related to <code>ListObjects</code>:
4743 * </p>
4744 * <ul>
4745 * <li>
4746 * <p>
4747 * <a>ListObjectsV2</a>
4748 * </p>
4749 * </li>
4750 * <li>
4751 * <p>
4752 * <a>GetObject</a>
4753 * </p>
4754 * </li>
4755 * <li>
4756 * <p>
4757 * <a>PutObject</a>
4758 * </p>
4759 * </li>
4760 * <li>
4761 * <p>
4762 * <a>CreateBucket</a>
4763 * </p>
4764 * </li>
4765 * <li>
4766 * <p>
4767 * <a>ListBuckets</a>
4768 * </p>
4769 * </li>
4770 * </ul>
4771 *
4772 * @param listObjectsRequest
4773 * @return Result of the ListObjects operation returned by the service.
4774 * @throws NoSuchBucketException
4775 * The specified bucket does not exist.
4776 * @throws SdkException
4777 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4778 * catch all scenarios.
4779 * @throws SdkClientException
4780 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4781 * @throws S3Exception
4782 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4783 * @sample S3Client.ListObjects
4784 */
4785 @Override
4786 public ListObjectsResponse listObjects(ListObjectsRequest listObjectsRequest) throws NoSuchBucketException,
4787 AwsServiceException, SdkClientException, S3Exception {
4788
4789 HttpResponseHandler<Response<ListObjectsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
4790 ListObjectsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4791
4792 return clientHandler.execute(new ClientExecutionParams<ListObjectsRequest, ListObjectsResponse>()
4793 .withOperationName("ListObjects").withCombinedResponseHandler(responseHandler).withInput(listObjectsRequest)
4794 .withMarshaller(new ListObjectsRequestMarshaller(protocolFactory)));
4795 }
4796
4797 /**
4798 * <p>
4799 * Returns some or all (up to 1,000) of the objects in a bucket. You can use the request parameters as selection
4800 * criteria to return a subset of the objects in a bucket. A <code>200 OK</code> response can contain valid or
4801 * invalid XML. Make sure to design your application to parse the contents of the response and handle it
4802 * appropriately.
4803 * </p>
4804 * <p>
4805 * To use this operation, you must have READ access to the bucket.
4806 * </p>
4807 * <p>
4808 * To use this operation in an AWS Identity and Access Management (IAM) policy, you must have permissions to perform
4809 * the <code>s3:ListBucket</code> action. The bucket owner has this permission by default and can grant this
4810 * permission to others. For more information about permissions, see <a href=
4811 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
4812 * >Permissions Related to Bucket Subresource Operations</a> and <a
4813 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
4814 * Amazon S3 Resources</a>.
4815 * </p>
4816 * <important>
4817 * <p>
4818 * This section describes the latest revision of the API. We recommend that you use this revised API for application
4819 * development. For backward compatibility, Amazon S3 continues to support the prior version of this API,
4820 * <a>ListObjects</a>.
4821 * </p>
4822 * </important>
4823 * <p>
4824 * To get a list of your buckets, see <a>ListBuckets</a>.
4825 * </p>
4826 * <p>
4827 * The following operations are related to <code>ListObjectsV2</code>:
4828 * </p>
4829 * <ul>
4830 * <li>
4831 * <p>
4832 * <a>GetObject</a>
4833 * </p>
4834 * </li>
4835 * <li>
4836 * <p>
4837 * <a>PutObject</a>
4838 * </p>
4839 * </li>
4840 * <li>
4841 * <p>
4842 * <a>CreateBucket</a>
4843 * </p>
4844 * </li>
4845 * </ul>
4846 *
4847 * @param listObjectsV2Request
4848 * @return Result of the ListObjectsV2 operation returned by the service.
4849 * @throws NoSuchBucketException
4850 * The specified bucket does not exist.
4851 * @throws SdkException
4852 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4853 * catch all scenarios.
4854 * @throws SdkClientException
4855 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4856 * @throws S3Exception
4857 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4858 * @sample S3Client.ListObjectsV2
4859 */
4860 @Override
4861 public ListObjectsV2Response listObjectsV2(ListObjectsV2Request listObjectsV2Request) throws NoSuchBucketException,
4862 AwsServiceException, SdkClientException, S3Exception {
4863
4864 HttpResponseHandler<Response<ListObjectsV2Response>> responseHandler = protocolFactory.createCombinedResponseHandler(
4865 ListObjectsV2Response::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
4866
4867 return clientHandler.execute(new ClientExecutionParams<ListObjectsV2Request, ListObjectsV2Response>()
4868 .withOperationName("ListObjectsV2").withCombinedResponseHandler(responseHandler).withInput(listObjectsV2Request)
4869 .withMarshaller(new ListObjectsV2RequestMarshaller(protocolFactory)));
4870 }
4871
4872 /**
4873 * <p>
4874 * Returns some or all (up to 1,000) of the objects in a bucket. You can use the request parameters as selection
4875 * criteria to return a subset of the objects in a bucket. A <code>200 OK</code> response can contain valid or
4876 * invalid XML. Make sure to design your application to parse the contents of the response and handle it
4877 * appropriately.
4878 * </p>
4879 * <p>
4880 * To use this operation, you must have READ access to the bucket.
4881 * </p>
4882 * <p>
4883 * To use this operation in an AWS Identity and Access Management (IAM) policy, you must have permissions to perform
4884 * the <code>s3:ListBucket</code> action. The bucket owner has this permission by default and can grant this
4885 * permission to others. For more information about permissions, see <a href=
4886 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
4887 * >Permissions Related to Bucket Subresource Operations</a> and <a
4888 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
4889 * Amazon S3 Resources</a>.
4890 * </p>
4891 * <important>
4892 * <p>
4893 * This section describes the latest revision of the API. We recommend that you use this revised API for application
4894 * development. For backward compatibility, Amazon S3 continues to support the prior version of this API,
4895 * <a>ListObjects</a>.
4896 * </p>
4897 * </important>
4898 * <p>
4899 * To get a list of your buckets, see <a>ListBuckets</a>.
4900 * </p>
4901 * <p>
4902 * The following operations are related to <code>ListObjectsV2</code>:
4903 * </p>
4904 * <ul>
4905 * <li>
4906 * <p>
4907 * <a>GetObject</a>
4908 * </p>
4909 * </li>
4910 * <li>
4911 * <p>
4912 * <a>PutObject</a>
4913 * </p>
4914 * </li>
4915 * <li>
4916 * <p>
4917 * <a>CreateBucket</a>
4918 * </p>
4919 * </li>
4920 * </ul>
4921 * <br/>
4922 * <p>
4923 * This is a variant of {@link #listObjectsV2(software.amazon.awssdk.services.s3.model.ListObjectsV2Request)}
4924 * operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
4925 * internally handle making service calls for you.
4926 * </p>
4927 * <p>
4928 * When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
4929 * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
4930 * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
4931 * request, you will see the failures only after you start iterating through the iterable.
4932 * </p>
4933 *
4934 * <p>
4935 * The following are few ways to iterate through the response pages:
4936 * </p>
4937 * 1) Using a Stream
4938 *
4939 * <pre>
4940 * {@code
4941 * software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable responses = client.listObjectsV2Paginator(request);
4942 * responses.stream().forEach(....);
4943 * }
4944 * </pre>
4945 *
4946 * 2) Using For loop
4947 *
4948 * <pre>
4949 * {
4950 * @code
4951 * software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable responses = client.listObjectsV2Paginator(request);
4952 * for (software.amazon.awssdk.services.s3.model.ListObjectsV2Response response : responses) {
4953 * // do something;
4954 * }
4955 * }
4956 * </pre>
4957 *
4958 * 3) Use iterator directly
4959 *
4960 * <pre>
4961 * {@code
4962 * software.amazon.awssdk.services.s3.paginators.ListObjectsV2Iterable responses = client.listObjectsV2Paginator(request);
4963 * responses.iterator().forEachRemaining(....);
4964 * }
4965 * </pre>
4966 * <p>
4967 * <b>Please notice that the configuration of MaxKeys won't limit the number of results you get with the paginator.
4968 * It only limits the number of results in each page.</b>
4969 * </p>
4970 * <p>
4971 * <b>Note: If you prefer to have control on service calls, use the
4972 * {@link #listObjectsV2(software.amazon.awssdk.services.s3.model.ListObjectsV2Request)} operation.</b>
4973 * </p>
4974 *
4975 * @param listObjectsV2Request
4976 * @return A custom iterable that can be used to iterate through all the response pages.
4977 * @throws NoSuchBucketException
4978 * The specified bucket does not exist.
4979 * @throws SdkException
4980 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
4981 * catch all scenarios.
4982 * @throws SdkClientException
4983 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
4984 * @throws S3Exception
4985 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
4986 * @sample S3Client.ListObjectsV2
4987 */
4988 @Override
4989 public ListObjectsV2Iterable listObjectsV2Paginator(ListObjectsV2Request listObjectsV2Request) throws NoSuchBucketException,
4990 AwsServiceException, SdkClientException, S3Exception {
4991 return new ListObjectsV2Iterable(this, applyPaginatorUserAgent(listObjectsV2Request));
4992 }
4993
4994 /**
4995 * <p>
4996 * Lists the parts that have been uploaded for a specific multipart upload. This operation must include the upload
4997 * ID, which you obtain by sending the initiate multipart upload request (see <a>CreateMultipartUpload</a>). This
4998 * request returns a maximum of 1,000 uploaded parts. The default number of parts returned is 1,000 parts. You can
4999 * restrict the number of parts returned by specifying the <code>max-parts</code> request parameter. If your
5000 * multipart upload consists of more than 1,000 parts, the response returns an <code>IsTruncated</code> field with
5001 * the value of true, and a <code>NextPartNumberMarker</code> element. In subsequent <code>ListParts</code> requests
5002 * you can include the part-number-marker query string parameter and set its value to the
5003 * <code>NextPartNumberMarker</code> field value from the previous response.
5004 * </p>
5005 * <p>
5006 * For more information on multipart uploads, see <a
5007 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
5008 * Upload</a>.
5009 * </p>
5010 * <p>
5011 * For information on permissions required to use the multipart upload API, see <a
5012 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
5013 * Permissions</a>.
5014 * </p>
5015 * <p>
5016 * The following operations are related to <code>ListParts</code>:
5017 * </p>
5018 * <ul>
5019 * <li>
5020 * <p>
5021 * <a>CreateMultipartUpload</a>
5022 * </p>
5023 * </li>
5024 * <li>
5025 * <p>
5026 * <a>UploadPart</a>
5027 * </p>
5028 * </li>
5029 * <li>
5030 * <p>
5031 * <a>CompleteMultipartUpload</a>
5032 * </p>
5033 * </li>
5034 * <li>
5035 * <p>
5036 * <a>AbortMultipartUpload</a>
5037 * </p>
5038 * </li>
5039 * <li>
5040 * <p>
5041 * <a>ListMultipartUploads</a>
5042 * </p>
5043 * </li>
5044 * </ul>
5045 *
5046 * @param listPartsRequest
5047 * @return Result of the ListParts operation returned by the service.
5048 * @throws SdkException
5049 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5050 * catch all scenarios.
5051 * @throws SdkClientException
5052 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5053 * @throws S3Exception
5054 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5055 * @sample S3Client.ListParts
5056 */
5057 @Override
5058 public ListPartsResponse listParts(ListPartsRequest listPartsRequest) throws AwsServiceException, SdkClientException,
5059 S3Exception {
5060
5061 HttpResponseHandler<Response<ListPartsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
5062 ListPartsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5063
5064 return clientHandler.execute(new ClientExecutionParams<ListPartsRequest, ListPartsResponse>()
5065 .withOperationName("ListParts").withCombinedResponseHandler(responseHandler).withInput(listPartsRequest)
5066 .withMarshaller(new ListPartsRequestMarshaller(protocolFactory)));
5067 }
5068
5069 /**
5070 * <p>
5071 * Lists the parts that have been uploaded for a specific multipart upload. This operation must include the upload
5072 * ID, which you obtain by sending the initiate multipart upload request (see <a>CreateMultipartUpload</a>). This
5073 * request returns a maximum of 1,000 uploaded parts. The default number of parts returned is 1,000 parts. You can
5074 * restrict the number of parts returned by specifying the <code>max-parts</code> request parameter. If your
5075 * multipart upload consists of more than 1,000 parts, the response returns an <code>IsTruncated</code> field with
5076 * the value of true, and a <code>NextPartNumberMarker</code> element. In subsequent <code>ListParts</code> requests
5077 * you can include the part-number-marker query string parameter and set its value to the
5078 * <code>NextPartNumberMarker</code> field value from the previous response.
5079 * </p>
5080 * <p>
5081 * For more information on multipart uploads, see <a
5082 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
5083 * Upload</a>.
5084 * </p>
5085 * <p>
5086 * For information on permissions required to use the multipart upload API, see <a
5087 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
5088 * Permissions</a>.
5089 * </p>
5090 * <p>
5091 * The following operations are related to <code>ListParts</code>:
5092 * </p>
5093 * <ul>
5094 * <li>
5095 * <p>
5096 * <a>CreateMultipartUpload</a>
5097 * </p>
5098 * </li>
5099 * <li>
5100 * <p>
5101 * <a>UploadPart</a>
5102 * </p>
5103 * </li>
5104 * <li>
5105 * <p>
5106 * <a>CompleteMultipartUpload</a>
5107 * </p>
5108 * </li>
5109 * <li>
5110 * <p>
5111 * <a>AbortMultipartUpload</a>
5112 * </p>
5113 * </li>
5114 * <li>
5115 * <p>
5116 * <a>ListMultipartUploads</a>
5117 * </p>
5118 * </li>
5119 * </ul>
5120 * <br/>
5121 * <p>
5122 * This is a variant of {@link #listParts(software.amazon.awssdk.services.s3.model.ListPartsRequest)} operation. The
5123 * return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
5124 * making service calls for you.
5125 * </p>
5126 * <p>
5127 * When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
5128 * guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
5129 * pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
5130 * request, you will see the failures only after you start iterating through the iterable.
5131 * </p>
5132 *
5133 * <p>
5134 * The following are few ways to iterate through the response pages:
5135 * </p>
5136 * 1) Using a Stream
5137 *
5138 * <pre>
5139 * {@code
5140 * software.amazon.awssdk.services.s3.paginators.ListPartsIterable responses = client.listPartsPaginator(request);
5141 * responses.stream().forEach(....);
5142 * }
5143 * </pre>
5144 *
5145 * 2) Using For loop
5146 *
5147 * <pre>
5148 * {
5149 * @code
5150 * software.amazon.awssdk.services.s3.paginators.ListPartsIterable responses = client.listPartsPaginator(request);
5151 * for (software.amazon.awssdk.services.s3.model.ListPartsResponse response : responses) {
5152 * // do something;
5153 * }
5154 * }
5155 * </pre>
5156 *
5157 * 3) Use iterator directly
5158 *
5159 * <pre>
5160 * {@code
5161 * software.amazon.awssdk.services.s3.paginators.ListPartsIterable responses = client.listPartsPaginator(request);
5162 * responses.iterator().forEachRemaining(....);
5163 * }
5164 * </pre>
5165 * <p>
5166 * <b>Please notice that the configuration of MaxParts won't limit the number of results you get with the paginator.
5167 * It only limits the number of results in each page.</b>
5168 * </p>
5169 * <p>
5170 * <b>Note: If you prefer to have control on service calls, use the
5171 * {@link #listParts(software.amazon.awssdk.services.s3.model.ListPartsRequest)} operation.</b>
5172 * </p>
5173 *
5174 * @param listPartsRequest
5175 * @return A custom iterable that can be used to iterate through all the response pages.
5176 * @throws SdkException
5177 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5178 * catch all scenarios.
5179 * @throws SdkClientException
5180 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5181 * @throws S3Exception
5182 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5183 * @sample S3Client.ListParts
5184 */
5185 @Override
5186 public ListPartsIterable listPartsPaginator(ListPartsRequest listPartsRequest) throws AwsServiceException,
5187 SdkClientException, S3Exception {
5188 return new ListPartsIterable(this, applyPaginatorUserAgent(listPartsRequest));
5189 }
5190
5191 /**
5192 * <p>
5193 * Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer Acceleration is a bucket-level
5194 * feature that enables you to perform faster data transfers to Amazon S3.
5195 * </p>
5196 * <p>
5197 * To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration action. The bucket
5198 * owner has this permission by default. The bucket owner can grant this permission to others. For more information
5199 * about permissions, see <a href=
5200 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
5201 * >Permissions Related to Bucket Subresource Operations</a> and <a
5202 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
5203 * Amazon S3 Resources</a>.
5204 * </p>
5205 * <p>
5206 * The Transfer Acceleration state of a bucket can be set to one of the following two values:
5207 * </p>
5208 * <ul>
5209 * <li>
5210 * <p>
5211 * Enabled – Enables accelerated data transfers to the bucket.
5212 * </p>
5213 * </li>
5214 * <li>
5215 * <p>
5216 * Suspended – Disables accelerated data transfers to the bucket.
5217 * </p>
5218 * </li>
5219 * </ul>
5220 * <p>
5221 * The <a>GetBucketAccelerateConfiguration</a> operation returns the transfer acceleration state of a bucket.
5222 * </p>
5223 * <p>
5224 * After setting the Transfer Acceleration state of a bucket to Enabled, it might take up to thirty minutes before
5225 * the data transfer rates to the bucket increase.
5226 * </p>
5227 * <p>
5228 * The name of the bucket used for Transfer Acceleration must be DNS-compliant and must not contain periods (".").
5229 * </p>
5230 * <p>
5231 * For more information about transfer acceleration, see <a
5232 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html">Transfer Acceleration</a>.
5233 * </p>
5234 * <p>
5235 * The following operations are related to <code>PutBucketAccelerateConfiguration</code>:
5236 * </p>
5237 * <ul>
5238 * <li>
5239 * <p>
5240 * <a>GetBucketAccelerateConfiguration</a>
5241 * </p>
5242 * </li>
5243 * <li>
5244 * <p>
5245 * <a>CreateBucket</a>
5246 * </p>
5247 * </li>
5248 * </ul>
5249 *
5250 * @param putBucketAccelerateConfigurationRequest
5251 * @return Result of the PutBucketAccelerateConfiguration operation returned by the service.
5252 * @throws SdkException
5253 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5254 * catch all scenarios.
5255 * @throws SdkClientException
5256 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5257 * @throws S3Exception
5258 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5259 * @sample S3Client.PutBucketAccelerateConfiguration
5260 */
5261 @Override
5262 public PutBucketAccelerateConfigurationResponse putBucketAccelerateConfiguration(
5263 PutBucketAccelerateConfigurationRequest putBucketAccelerateConfigurationRequest) throws AwsServiceException,
5264 SdkClientException, S3Exception {
5265
5266 HttpResponseHandler<Response<PutBucketAccelerateConfigurationResponse>> responseHandler = protocolFactory
5267 .createCombinedResponseHandler(PutBucketAccelerateConfigurationResponse::builder,
5268 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5269
5270 return clientHandler
5271 .execute(new ClientExecutionParams<PutBucketAccelerateConfigurationRequest, PutBucketAccelerateConfigurationResponse>()
5272 .withOperationName("PutBucketAccelerateConfiguration").withCombinedResponseHandler(responseHandler)
5273 .withInput(putBucketAccelerateConfigurationRequest)
5274 .withMarshaller(new PutBucketAccelerateConfigurationRequestMarshaller(protocolFactory)));
5275 }
5276
5277 /**
5278 * <p>
5279 * Sets the permissions on an existing bucket using access control lists (ACL). For more information, see <a
5280 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html">Using ACLs</a>. To set the ACL of a
5281 * bucket, you must have <code>WRITE_ACP</code> permission.
5282 * </p>
5283 * <p>
5284 * You can use one of the following two ways to set a bucket's permissions:
5285 * </p>
5286 * <ul>
5287 * <li>
5288 * <p>
5289 * Specify the ACL in the request body
5290 * </p>
5291 * </li>
5292 * <li>
5293 * <p>
5294 * Specify permissions using request headers
5295 * </p>
5296 * </li>
5297 * </ul>
5298 * <note>
5299 * <p>
5300 * You cannot specify access permission using both the body and the request headers.
5301 * </p>
5302 * </note>
5303 * <p>
5304 * Depending on your application needs, you may choose to set the ACL on a bucket using either the request body or
5305 * the headers. For example, if you have an existing application that updates a bucket ACL using the request body,
5306 * then you can continue to use that approach.
5307 * </p>
5308 * <p>
5309 * <b>Access Permissions</b>
5310 * </p>
5311 * <p>
5312 * You can set access permissions using one of the following methods:
5313 * </p>
5314 * <ul>
5315 * <li>
5316 * <p>
5317 * Specify a canned ACL with the <code>x-amz-acl</code> request header. Amazon S3 supports a set of predefined ACLs,
5318 * known as <i>canned ACLs</i>. Each canned ACL has a predefined set of grantees and permissions. Specify the canned
5319 * ACL name as the value of <code>x-amz-acl</code>. If you use this header, you cannot use other access
5320 * control-specific headers in your request. For more information, see <a
5321 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned ACL</a>.
5322 * </p>
5323 * </li>
5324 * <li>
5325 * <p>
5326 * Specify access permissions explicitly with the <code>x-amz-grant-read</code>, <code>x-amz-grant-read-acp</code>,
5327 * <code>x-amz-grant-write-acp</code>, and <code>x-amz-grant-full-control</code> headers. When using these headers,
5328 * you specify explicit access permissions and grantees (AWS accounts or Amazon S3 groups) who will receive the
5329 * permission. If you use these ACL-specific headers, you cannot use the <code>x-amz-acl</code> header to set a
5330 * canned ACL. These parameters map to the set of permissions that Amazon S3 supports in an ACL. For more
5331 * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List
5332 * (ACL) Overview</a>.
5333 * </p>
5334 * <p>
5335 * You specify each grantee as a type=value pair, where the type is one of the following:
5336 * </p>
5337 * <ul>
5338 * <li>
5339 * <p>
5340 * <code>id</code> – if the value specified is the canonical user ID of an AWS account
5341 * </p>
5342 * </li>
5343 * <li>
5344 * <p>
5345 * <code>uri</code> – if you are granting permissions to a predefined group
5346 * </p>
5347 * </li>
5348 * <li>
5349 * <p>
5350 * <code>emailAddress</code> – if the value specified is the email address of an AWS account
5351 * </p>
5352 * <note>
5353 * <p>
5354 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
5355 * </p>
5356 * <ul>
5357 * <li>
5358 * <p>
5359 * US East (N. Virginia)
5360 * </p>
5361 * </li>
5362 * <li>
5363 * <p>
5364 * US West (N. California)
5365 * </p>
5366 * </li>
5367 * <li>
5368 * <p>
5369 * US West (Oregon)
5370 * </p>
5371 * </li>
5372 * <li>
5373 * <p>
5374 * Asia Pacific (Singapore)
5375 * </p>
5376 * </li>
5377 * <li>
5378 * <p>
5379 * Asia Pacific (Sydney)
5380 * </p>
5381 * </li>
5382 * <li>
5383 * <p>
5384 * Asia Pacific (Tokyo)
5385 * </p>
5386 * </li>
5387 * <li>
5388 * <p>
5389 * Europe (Ireland)
5390 * </p>
5391 * </li>
5392 * <li>
5393 * <p>
5394 * South America (São Paulo)
5395 * </p>
5396 * </li>
5397 * </ul>
5398 * <p>
5399 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
5400 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
5401 * General Reference.
5402 * </p>
5403 * </note></li>
5404 * </ul>
5405 * <p>
5406 * For example, the following <code>x-amz-grant-write</code> header grants create, overwrite, and delete objects
5407 * permission to LogDelivery group predefined by Amazon S3 and two AWS accounts identified by their email addresses.
5408 * </p>
5409 * <p>
5410 * <code>x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333", id="555566667777" </code>
5411 * </p>
5412 * </li>
5413 * </ul>
5414 * <p>
5415 * You can use either a canned ACL or specify access permissions explicitly. You cannot do both.
5416 * </p>
5417 * <p>
5418 * <b>Grantee Values</b>
5419 * </p>
5420 * <p>
5421 * You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the
5422 * following ways:
5423 * </p>
5424 * <ul>
5425 * <li>
5426 * <p>
5427 * By the person's ID:
5428 * </p>
5429 * <p>
5430 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID><>ID<></ID><DisplayName><>GranteesEmail<></DisplayName> </Grantee></code>
5431 * </p>
5432 * <p>
5433 * DisplayName is optional and ignored in the request
5434 * </p>
5435 * </li>
5436 * <li>
5437 * <p>
5438 * By URI:
5439 * </p>
5440 * <p>
5441 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<></URI></Grantee></code>
5442 * </p>
5443 * </li>
5444 * <li>
5445 * <p>
5446 * By Email address:
5447 * </p>
5448 * <p>
5449 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"><EmailAddress><>Grantees@email.com<></EmailAddress>lt;/Grantee></code>
5450 * </p>
5451 * <p>
5452 * The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the
5453 * CanonicalUser.
5454 * </p>
5455 * <note>
5456 * <p>
5457 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
5458 * </p>
5459 * <ul>
5460 * <li>
5461 * <p>
5462 * US East (N. Virginia)
5463 * </p>
5464 * </li>
5465 * <li>
5466 * <p>
5467 * US West (N. California)
5468 * </p>
5469 * </li>
5470 * <li>
5471 * <p>
5472 * US West (Oregon)
5473 * </p>
5474 * </li>
5475 * <li>
5476 * <p>
5477 * Asia Pacific (Singapore)
5478 * </p>
5479 * </li>
5480 * <li>
5481 * <p>
5482 * Asia Pacific (Sydney)
5483 * </p>
5484 * </li>
5485 * <li>
5486 * <p>
5487 * Asia Pacific (Tokyo)
5488 * </p>
5489 * </li>
5490 * <li>
5491 * <p>
5492 * Europe (Ireland)
5493 * </p>
5494 * </li>
5495 * <li>
5496 * <p>
5497 * South America (São Paulo)
5498 * </p>
5499 * </li>
5500 * </ul>
5501 * <p>
5502 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
5503 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
5504 * General Reference.
5505 * </p>
5506 * </note></li>
5507 * </ul>
5508 * <p class="title">
5509 * <b>Related Resources</b>
5510 * </p>
5511 * <ul>
5512 * <li>
5513 * <p>
5514 * <a>CreateBucket</a>
5515 * </p>
5516 * </li>
5517 * <li>
5518 * <p>
5519 * <a>DeleteBucket</a>
5520 * </p>
5521 * </li>
5522 * <li>
5523 * <p>
5524 * <a>GetObjectAcl</a>
5525 * </p>
5526 * </li>
5527 * </ul>
5528 *
5529 * @param putBucketAclRequest
5530 * @return Result of the PutBucketAcl operation returned by the service.
5531 * @throws SdkException
5532 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5533 * catch all scenarios.
5534 * @throws SdkClientException
5535 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5536 * @throws S3Exception
5537 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5538 * @sample S3Client.PutBucketAcl
5539 */
5540 @Override
5541 public PutBucketAclResponse putBucketAcl(PutBucketAclRequest putBucketAclRequest) throws AwsServiceException,
5542 SdkClientException, S3Exception {
5543
5544 HttpResponseHandler<Response<PutBucketAclResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
5545 PutBucketAclResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5546
5547 return clientHandler.execute(new ClientExecutionParams<PutBucketAclRequest, PutBucketAclResponse>()
5548 .withOperationName("PutBucketAcl").withCombinedResponseHandler(responseHandler).withInput(putBucketAclRequest)
5549 .withMarshaller(new PutBucketAclRequestMarshaller(protocolFactory)));
5550 }
5551
5552 /**
5553 * <p>
5554 * Sets an analytics configuration for the bucket (specified by the analytics configuration ID). You can have up to
5555 * 1,000 analytics configurations per bucket.
5556 * </p>
5557 * <p>
5558 * You can choose to have storage class analysis export analysis reports sent to a comma-separated values (CSV) flat
5559 * file. See the <code>DataExport</code> request element. Reports are updated daily and are based on the object
5560 * filters that you configure. When selecting data export, you specify a destination bucket and an optional
5561 * destination prefix where the file is written. You can export the data to a destination bucket in a different
5562 * account. However, the destination bucket must be in the same Region as the bucket that you are making the PUT
5563 * analytics configuration to. For more information, see <a
5564 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html">Amazon S3 Analytics – Storage
5565 * Class Analysis</a>.
5566 * </p>
5567 * <important>
5568 * <p>
5569 * You must create a bucket policy on the destination bucket where the exported file is written to grant permissions
5570 * to Amazon S3 to write objects to the bucket. For an example policy, see <a href=
5571 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9"
5572 * >Granting Permissions for Amazon S3 Inventory and Storage Class Analysis</a>.
5573 * </p>
5574 * </important>
5575 * <p>
5576 * To use this operation, you must have permissions to perform the <code>s3:PutAnalyticsConfiguration</code> action.
5577 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
5578 * information about permissions, see <a href=
5579 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
5580 * >Permissions Related to Bucket Subresource Operations</a> and <a
5581 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
5582 * Amazon S3 Resources</a>.
5583 * </p>
5584 * <p class="title">
5585 * <b>Special Errors</b>
5586 * </p>
5587 * <ul>
5588 * <li>
5589 * <ul>
5590 * <li>
5591 * <p>
5592 * <i>HTTP Error: HTTP 400 Bad Request</i>
5593 * </p>
5594 * </li>
5595 * <li>
5596 * <p>
5597 * <i>Code: InvalidArgument</i>
5598 * </p>
5599 * </li>
5600 * <li>
5601 * <p>
5602 * <i>Cause: Invalid argument.</i>
5603 * </p>
5604 * </li>
5605 * </ul>
5606 * </li>
5607 * <li>
5608 * <ul>
5609 * <li>
5610 * <p>
5611 * <i>HTTP Error: HTTP 400 Bad Request</i>
5612 * </p>
5613 * </li>
5614 * <li>
5615 * <p>
5616 * <i>Code: TooManyConfigurations</i>
5617 * </p>
5618 * </li>
5619 * <li>
5620 * <p>
5621 * <i>Cause: You are attempting to create a new configuration but have already reached the 1,000-configuration
5622 * limit.</i>
5623 * </p>
5624 * </li>
5625 * </ul>
5626 * </li>
5627 * <li>
5628 * <ul>
5629 * <li>
5630 * <p>
5631 * <i>HTTP Error: HTTP 403 Forbidden</i>
5632 * </p>
5633 * </li>
5634 * <li>
5635 * <p>
5636 * <i>Code: AccessDenied</i>
5637 * </p>
5638 * </li>
5639 * <li>
5640 * <p>
5641 * <i>Cause: You are not the owner of the specified bucket, or you do not have the s3:PutAnalyticsConfiguration
5642 * bucket permission to set the configuration on the bucket.</i>
5643 * </p>
5644 * </li>
5645 * </ul>
5646 * </li>
5647 * </ul>
5648 * <p class="title">
5649 * <b>Related Resources</b>
5650 * </p>
5651 * <ul>
5652 * <li>
5653 * <p>
5654 * </p></li>
5655 * <li>
5656 * <p>
5657 * </p></li>
5658 * <li>
5659 * <p>
5660 * </p></li>
5661 * </ul>
5662 *
5663 * @param putBucketAnalyticsConfigurationRequest
5664 * @return Result of the PutBucketAnalyticsConfiguration operation returned by the service.
5665 * @throws SdkException
5666 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5667 * catch all scenarios.
5668 * @throws SdkClientException
5669 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5670 * @throws S3Exception
5671 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5672 * @sample S3Client.PutBucketAnalyticsConfiguration
5673 */
5674 @Override
5675 public PutBucketAnalyticsConfigurationResponse putBucketAnalyticsConfiguration(
5676 PutBucketAnalyticsConfigurationRequest putBucketAnalyticsConfigurationRequest) throws AwsServiceException,
5677 SdkClientException, S3Exception {
5678
5679 HttpResponseHandler<Response<PutBucketAnalyticsConfigurationResponse>> responseHandler = protocolFactory
5680 .createCombinedResponseHandler(PutBucketAnalyticsConfigurationResponse::builder,
5681 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5682
5683 return clientHandler
5684 .execute(new ClientExecutionParams<PutBucketAnalyticsConfigurationRequest, PutBucketAnalyticsConfigurationResponse>()
5685 .withOperationName("PutBucketAnalyticsConfiguration").withCombinedResponseHandler(responseHandler)
5686 .withInput(putBucketAnalyticsConfigurationRequest)
5687 .withMarshaller(new PutBucketAnalyticsConfigurationRequestMarshaller(protocolFactory)));
5688 }
5689
5690 /**
5691 * <p>
5692 * Sets the <code>cors</code> configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
5693 * </p>
5694 * <p>
5695 * To use this operation, you must be allowed to perform the <code>s3:PutBucketCORS</code> action. By default, the
5696 * bucket owner has this permission and can grant it to others.
5697 * </p>
5698 * <p>
5699 * You set this configuration on a bucket so that the bucket can service cross-origin requests. For example, you
5700 * might want to enable a request whose origin is <code>http://www.example.com</code> to access your Amazon S3
5701 * bucket at <code>my.example.bucket.com</code> by using the browser's <code>XMLHttpRequest</code> capability.
5702 * </p>
5703 * <p>
5704 * To enable cross-origin resource sharing (CORS) on a bucket, you add the <code>cors</code> subresource to the
5705 * bucket. The <code>cors</code> subresource is an XML document in which you configure rules that identify origins
5706 * and the HTTP methods that can be executed on your bucket. The document is limited to 64 KB in size.
5707 * </p>
5708 * <p>
5709 * When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS request) against a bucket, it evaluates
5710 * the <code>cors</code> configuration on the bucket and uses the first <code>CORSRule</code> rule that matches the
5711 * incoming browser request to enable a cross-origin request. For a rule to match, the following conditions must be
5712 * met:
5713 * </p>
5714 * <ul>
5715 * <li>
5716 * <p>
5717 * The request's <code>Origin</code> header must match <code>AllowedOrigin</code> elements.
5718 * </p>
5719 * </li>
5720 * <li>
5721 * <p>
5722 * The request method (for example, GET, PUT, HEAD, and so on) or the <code>Access-Control-Request-Method</code>
5723 * header in case of a pre-flight <code>OPTIONS</code> request must be one of the <code>AllowedMethod</code>
5724 * elements.
5725 * </p>
5726 * </li>
5727 * <li>
5728 * <p>
5729 * Every header specified in the <code>Access-Control-Request-Headers</code> request header of a pre-flight request
5730 * must match an <code>AllowedHeader</code> element.
5731 * </p>
5732 * </li>
5733 * </ul>
5734 * <p>
5735 * For more information about CORS, go to <a
5736 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html">Enabling Cross-Origin Resource Sharing</a> in
5737 * the <i>Amazon Simple Storage Service Developer Guide</i>.
5738 * </p>
5739 * <p class="title">
5740 * <b>Related Resources</b>
5741 * </p>
5742 * <ul>
5743 * <li>
5744 * <p>
5745 * <a>GetBucketCors</a>
5746 * </p>
5747 * </li>
5748 * <li>
5749 * <p>
5750 * <a>DeleteBucketCors</a>
5751 * </p>
5752 * </li>
5753 * <li>
5754 * <p>
5755 * <a>RESTOPTIONSobject</a>
5756 * </p>
5757 * </li>
5758 * </ul>
5759 *
5760 * @param putBucketCorsRequest
5761 * @return Result of the PutBucketCors operation returned by the service.
5762 * @throws SdkException
5763 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5764 * catch all scenarios.
5765 * @throws SdkClientException
5766 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5767 * @throws S3Exception
5768 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5769 * @sample S3Client.PutBucketCors
5770 */
5771 @Override
5772 public PutBucketCorsResponse putBucketCors(PutBucketCorsRequest putBucketCorsRequest) throws AwsServiceException,
5773 SdkClientException, S3Exception {
5774
5775 HttpResponseHandler<Response<PutBucketCorsResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
5776 PutBucketCorsResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5777
5778 return clientHandler.execute(new ClientExecutionParams<PutBucketCorsRequest, PutBucketCorsResponse>()
5779 .withOperationName("PutBucketCors").withCombinedResponseHandler(responseHandler).withInput(putBucketCorsRequest)
5780 .withMarshaller(new PutBucketCorsRequestMarshaller(protocolFactory)));
5781 }
5782
5783 /**
5784 * <p>
5785 * This implementation of the <code>PUT</code> operation uses the <code>encryption</code> subresource to set the
5786 * default encryption state of an existing bucket.
5787 * </p>
5788 * <p>
5789 * This implementation of the <code>PUT</code> operation sets default encryption for a bucket using server-side
5790 * encryption with Amazon S3-managed keys SSE-S3 or AWS KMS customer master keys (CMKs) (SSE-KMS). For information
5791 * about the Amazon S3 default encryption feature, see <a
5792 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html">Amazon S3 Default Bucket
5793 * Encryption</a>.
5794 * </p>
5795 * <important>
5796 * <p>
5797 * This operation requires AWS Signature Version 4. For more information, see <a
5798 * href="sig-v4-authenticating-requests.html"> Authenticating Requests (AWS Signature Version 4)</a>.
5799 * </p>
5800 * </important>
5801 * <p>
5802 * To use this operation, you must have permissions to perform the <code>s3:PutEncryptionConfiguration</code>
5803 * action. The bucket owner has this permission by default. The bucket owner can grant this permission to others.
5804 * For more information about permissions, see <a href=
5805 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
5806 * >Permissions Related to Bucket Subresource Operations</a> and <a
5807 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
5808 * Amazon S3 Resources</a> in the Amazon Simple Storage Service Developer Guide.
5809 * </p>
5810 * <p class="title">
5811 * <b>Related Resources</b>
5812 * </p>
5813 * <ul>
5814 * <li>
5815 * <p>
5816 * <a>GetBucketEncryption</a>
5817 * </p>
5818 * </li>
5819 * <li>
5820 * <p>
5821 * <a>DeleteBucketEncryption</a>
5822 * </p>
5823 * </li>
5824 * </ul>
5825 *
5826 * @param putBucketEncryptionRequest
5827 * @return Result of the PutBucketEncryption operation returned by the service.
5828 * @throws SdkException
5829 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5830 * catch all scenarios.
5831 * @throws SdkClientException
5832 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5833 * @throws S3Exception
5834 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5835 * @sample S3Client.PutBucketEncryption
5836 */
5837 @Override
5838 public PutBucketEncryptionResponse putBucketEncryption(PutBucketEncryptionRequest putBucketEncryptionRequest)
5839 throws AwsServiceException, SdkClientException, S3Exception {
5840
5841 HttpResponseHandler<Response<PutBucketEncryptionResponse>> responseHandler = protocolFactory
5842 .createCombinedResponseHandler(PutBucketEncryptionResponse::builder,
5843 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5844
5845 return clientHandler.execute(new ClientExecutionParams<PutBucketEncryptionRequest, PutBucketEncryptionResponse>()
5846 .withOperationName("PutBucketEncryption").withCombinedResponseHandler(responseHandler)
5847 .withInput(putBucketEncryptionRequest).withMarshaller(new PutBucketEncryptionRequestMarshaller(protocolFactory)));
5848 }
5849
5850 /**
5851 * <p>
5852 * This implementation of the <code>PUT</code> operation adds an inventory configuration (identified by the
5853 * inventory ID) to the bucket. You can have up to 1,000 inventory configurations per bucket.
5854 * </p>
5855 * <p>
5856 * Amazon S3 inventory generates inventories of the objects in the bucket on a daily or weekly basis, and the
5857 * results are published to a flat file. The bucket that is inventoried is called the <i>source</i> bucket, and the
5858 * bucket where the inventory flat file is stored is called the <i>destination</i> bucket. The <i>destination</i>
5859 * bucket must be in the same AWS Region as the <i>source</i> bucket.
5860 * </p>
5861 * <p>
5862 * When you configure an inventory for a <i>source</i> bucket, you specify the <i>destination</i> bucket where you
5863 * want the inventory to be stored, and whether to generate the inventory daily or weekly. You can also configure
5864 * what object metadata to include and whether to inventory all object versions or only current versions. For more
5865 * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html">Amazon S3
5866 * Inventory</a> in the Amazon Simple Storage Service Developer Guide.
5867 * </p>
5868 * <important>
5869 * <p>
5870 * You must create a bucket policy on the <i>destination</i> bucket to grant permissions to Amazon S3 to write
5871 * objects to the bucket in the defined location. For an example policy, see <a href=
5872 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9"
5873 * > Granting Permissions for Amazon S3 Inventory and Storage Class Analysis</a>.
5874 * </p>
5875 * </important>
5876 * <p>
5877 * To use this operation, you must have permissions to perform the <code>s3:PutInventoryConfiguration</code> action.
5878 * The bucket owner has this permission by default and can grant this permission to others. For more information
5879 * about permissions, see <a href=
5880 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
5881 * >Permissions Related to Bucket Subresource Operations</a> and <a
5882 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
5883 * Amazon S3 Resources</a> in the Amazon Simple Storage Service Developer Guide.
5884 * </p>
5885 * <p class="title">
5886 * <b>Special Errors</b>
5887 * </p>
5888 * <ul>
5889 * <li>
5890 * <p class="title">
5891 * <b>HTTP 400 Bad Request Error</b>
5892 * </p>
5893 * <ul>
5894 * <li>
5895 * <p>
5896 * <i>Code:</i> InvalidArgument
5897 * </p>
5898 * </li>
5899 * <li>
5900 * <p>
5901 * <i>Cause:</i> Invalid Argument
5902 * </p>
5903 * </li>
5904 * </ul>
5905 * </li>
5906 * <li>
5907 * <p class="title">
5908 * <b>HTTP 400 Bad Request Error</b>
5909 * </p>
5910 * <ul>
5911 * <li>
5912 * <p>
5913 * <i>Code:</i> TooManyConfigurations
5914 * </p>
5915 * </li>
5916 * <li>
5917 * <p>
5918 * <i>Cause:</i> You are attempting to create a new configuration but have already reached the 1,000-configuration
5919 * limit.
5920 * </p>
5921 * </li>
5922 * </ul>
5923 * </li>
5924 * <li>
5925 * <p class="title">
5926 * <b>HTTP 403 Forbidden Error</b>
5927 * </p>
5928 * <ul>
5929 * <li>
5930 * <p>
5931 * <i>Code:</i> AccessDenied
5932 * </p>
5933 * </li>
5934 * <li>
5935 * <p>
5936 * <i>Cause:</i> You are not the owner of the specified bucket, or you do not have the
5937 * <code>s3:PutInventoryConfiguration</code> bucket permission to set the configuration on the bucket.
5938 * </p>
5939 * </li>
5940 * </ul>
5941 * </li>
5942 * </ul>
5943 * <p class="title">
5944 * <b>Related Resources</b>
5945 * </p>
5946 * <ul>
5947 * <li>
5948 * <p>
5949 * <a>GetBucketInventoryConfiguration</a>
5950 * </p>
5951 * </li>
5952 * <li>
5953 * <p>
5954 * <a>DeleteBucketInventoryConfiguration</a>
5955 * </p>
5956 * </li>
5957 * <li>
5958 * <p>
5959 * <a>ListBucketInventoryConfigurations</a>
5960 * </p>
5961 * </li>
5962 * </ul>
5963 *
5964 * @param putBucketInventoryConfigurationRequest
5965 * @return Result of the PutBucketInventoryConfiguration operation returned by the service.
5966 * @throws SdkException
5967 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
5968 * catch all scenarios.
5969 * @throws SdkClientException
5970 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
5971 * @throws S3Exception
5972 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
5973 * @sample S3Client.PutBucketInventoryConfiguration
5974 */
5975 @Override
5976 public PutBucketInventoryConfigurationResponse putBucketInventoryConfiguration(
5977 PutBucketInventoryConfigurationRequest putBucketInventoryConfigurationRequest) throws AwsServiceException,
5978 SdkClientException, S3Exception {
5979
5980 HttpResponseHandler<Response<PutBucketInventoryConfigurationResponse>> responseHandler = protocolFactory
5981 .createCombinedResponseHandler(PutBucketInventoryConfigurationResponse::builder,
5982 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
5983
5984 return clientHandler
5985 .execute(new ClientExecutionParams<PutBucketInventoryConfigurationRequest, PutBucketInventoryConfigurationResponse>()
5986 .withOperationName("PutBucketInventoryConfiguration").withCombinedResponseHandler(responseHandler)
5987 .withInput(putBucketInventoryConfigurationRequest)
5988 .withMarshaller(new PutBucketInventoryConfigurationRequestMarshaller(protocolFactory)));
5989 }
5990
5991 /**
5992 * <p>
5993 * Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. For
5994 * information about lifecycle configuration, see <a
5995 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
5996 * Amazon S3 Resources</a>.
5997 * </p>
5998 * <note>
5999 * <p>
6000 * Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or
6001 * more object tags, or a combination of both. Accordingly, this section describes the latest API. The previous
6002 * version of the API supported filtering based only on an object key name prefix, which is supported for backward
6003 * compatibility. For the related API description, see <a>PutBucketLifecycle</a>.
6004 * </p>
6005 * </note>
6006 * <p>
6007 * <b>Rules</b>
6008 * </p>
6009 * <p>
6010 * You specify the lifecycle configuration in your request body. The lifecycle configuration is specified as XML
6011 * consisting of one or more rules. Each rule consists of the following:
6012 * </p>
6013 * <ul>
6014 * <li>
6015 * <p>
6016 * Filter identifying a subset of objects to which the rule applies. The filter can be based on a key name prefix,
6017 * object tags, or a combination of both.
6018 * </p>
6019 * </li>
6020 * <li>
6021 * <p>
6022 * Status whether the rule is in effect.
6023 * </p>
6024 * </li>
6025 * <li>
6026 * <p>
6027 * One or more lifecycle transition and expiration actions that you want Amazon S3 to perform on the objects
6028 * identified by the filter. If the state of your bucket is versioning-enabled or versioning-suspended, you can have
6029 * many versions of the same object (one current version and zero or more noncurrent versions). Amazon S3 provides
6030 * predefined actions that you can specify for current and noncurrent object versions.
6031 * </p>
6032 * </li>
6033 * </ul>
6034 * <p>
6035 * For more information, see <a
6036 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html">Object Lifecycle Management</a>
6037 * and <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html">Lifecycle Configuration
6038 * Elements</a>.
6039 * </p>
6040 * <p>
6041 * <b>Permissions</b>
6042 * </p>
6043 * <p>
6044 * By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for
6045 * example, lifecycle configuration and website configuration). Only the resource owner (that is, the AWS account
6046 * that created it) can access the resource. The resource owner can optionally grant access permissions to others by
6047 * writing an access policy. For this operation, a user must get the s3:PutLifecycleConfiguration permission.
6048 * </p>
6049 * <p>
6050 * You can also explicitly deny permissions. Explicit deny also supersedes any other permissions. If you want to
6051 * block users or accounts from removing or deleting objects from your bucket, you must deny them permissions for
6052 * the following actions:
6053 * </p>
6054 * <ul>
6055 * <li>
6056 * <p>
6057 * s3:DeleteObject
6058 * </p>
6059 * </li>
6060 * <li>
6061 * <p>
6062 * s3:DeleteObjectVersion
6063 * </p>
6064 * </li>
6065 * <li>
6066 * <p>
6067 * s3:PutLifecycleConfiguration
6068 * </p>
6069 * </li>
6070 * </ul>
6071 * <p>
6072 * For more information about permissions, see <a
6073 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
6074 * Amazon S3 Resources</a>.
6075 * </p>
6076 * <p>
6077 * The following are related to <code>PutBucketLifecycleConfiguration</code>:
6078 * </p>
6079 * <ul>
6080 * <li>
6081 * <p>
6082 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html">Examples of
6083 * Lifecycle Configuration</a>
6084 * </p>
6085 * </li>
6086 * <li>
6087 * <p>
6088 * <a>GetBucketLifecycleConfiguration</a>
6089 * </p>
6090 * </li>
6091 * <li>
6092 * <p>
6093 * <a>DeleteBucketLifecycle</a>
6094 * </p>
6095 * </li>
6096 * </ul>
6097 *
6098 * @param putBucketLifecycleConfigurationRequest
6099 * @return Result of the PutBucketLifecycleConfiguration operation returned by the service.
6100 * @throws SdkException
6101 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6102 * catch all scenarios.
6103 * @throws SdkClientException
6104 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6105 * @throws S3Exception
6106 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6107 * @sample S3Client.PutBucketLifecycleConfiguration
6108 */
6109 @Override
6110 public PutBucketLifecycleConfigurationResponse putBucketLifecycleConfiguration(
6111 PutBucketLifecycleConfigurationRequest putBucketLifecycleConfigurationRequest) throws AwsServiceException,
6112 SdkClientException, S3Exception {
6113
6114 HttpResponseHandler<Response<PutBucketLifecycleConfigurationResponse>> responseHandler = protocolFactory
6115 .createCombinedResponseHandler(PutBucketLifecycleConfigurationResponse::builder,
6116 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6117
6118 return clientHandler
6119 .execute(new ClientExecutionParams<PutBucketLifecycleConfigurationRequest, PutBucketLifecycleConfigurationResponse>()
6120 .withOperationName("PutBucketLifecycleConfiguration").withCombinedResponseHandler(responseHandler)
6121 .withInput(putBucketLifecycleConfigurationRequest)
6122 .withMarshaller(new PutBucketLifecycleConfigurationRequestMarshaller(protocolFactory)));
6123 }
6124
6125 /**
6126 * <p>
6127 * Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging
6128 * parameters. All logs are saved to buckets in the same AWS Region as the source bucket. To set the logging status
6129 * of a bucket, you must be the bucket owner.
6130 * </p>
6131 * <p>
6132 * The bucket owner is automatically granted FULL_CONTROL to all logs. You use the <code>Grantee</code> request
6133 * element to grant access to other people. The <code>Permissions</code> request element specifies the kind of
6134 * access the grantee has to the logs.
6135 * </p>
6136 * <p>
6137 * <b>Grantee Values</b>
6138 * </p>
6139 * <p>
6140 * You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the
6141 * following ways:
6142 * </p>
6143 * <ul>
6144 * <li>
6145 * <p>
6146 * By the person's ID:
6147 * </p>
6148 * <p>
6149 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID><>ID<></ID><DisplayName><>GranteesEmail<></DisplayName> </Grantee></code>
6150 * </p>
6151 * <p>
6152 * DisplayName is optional and ignored in the request.
6153 * </p>
6154 * </li>
6155 * <li>
6156 * <p>
6157 * By Email address:
6158 * </p>
6159 * <p>
6160 * <code> <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"><EmailAddress><>Grantees@email.com<></EmailAddress></Grantee></code>
6161 * </p>
6162 * <p>
6163 * The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the
6164 * CanonicalUser.
6165 * </p>
6166 * </li>
6167 * <li>
6168 * <p>
6169 * By URI:
6170 * </p>
6171 * <p>
6172 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<></URI></Grantee></code>
6173 * </p>
6174 * </li>
6175 * </ul>
6176 * <p>
6177 * To enable logging, you use LoggingEnabled and its children request elements. To disable logging, you use an empty
6178 * BucketLoggingStatus request element:
6179 * </p>
6180 * <p>
6181 * <code><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" /></code>
6182 * </p>
6183 * <p>
6184 * For more information about server access logging, see <a
6185 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html">Server Access Logging</a>.
6186 * </p>
6187 * <p>
6188 * For more information about creating a bucket, see <a>CreateBucket</a>. For more information about returning the
6189 * logging status of a bucket, see <a>GetBucketLogging</a>.
6190 * </p>
6191 * <p>
6192 * The following operations are related to <code>PutBucketLogging</code>:
6193 * </p>
6194 * <ul>
6195 * <li>
6196 * <p>
6197 * <a>PutObject</a>
6198 * </p>
6199 * </li>
6200 * <li>
6201 * <p>
6202 * <a>DeleteBucket</a>
6203 * </p>
6204 * </li>
6205 * <li>
6206 * <p>
6207 * <a>CreateBucket</a>
6208 * </p>
6209 * </li>
6210 * <li>
6211 * <p>
6212 * <a>GetBucketLogging</a>
6213 * </p>
6214 * </li>
6215 * </ul>
6216 *
6217 * @param putBucketLoggingRequest
6218 * @return Result of the PutBucketLogging operation returned by the service.
6219 * @throws SdkException
6220 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6221 * catch all scenarios.
6222 * @throws SdkClientException
6223 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6224 * @throws S3Exception
6225 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6226 * @sample S3Client.PutBucketLogging
6227 */
6228 @Override
6229 public PutBucketLoggingResponse putBucketLogging(PutBucketLoggingRequest putBucketLoggingRequest) throws AwsServiceException,
6230 SdkClientException, S3Exception {
6231
6232 HttpResponseHandler<Response<PutBucketLoggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
6233 PutBucketLoggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6234
6235 return clientHandler.execute(new ClientExecutionParams<PutBucketLoggingRequest, PutBucketLoggingResponse>()
6236 .withOperationName("PutBucketLogging").withCombinedResponseHandler(responseHandler)
6237 .withInput(putBucketLoggingRequest).withMarshaller(new PutBucketLoggingRequestMarshaller(protocolFactory)));
6238 }
6239
6240 /**
6241 * <p>
6242 * Sets a metrics configuration (specified by the metrics configuration ID) for the bucket. You can have up to 1,000
6243 * metrics configurations per bucket. If you're updating an existing metrics configuration, note that this is a full
6244 * replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are
6245 * erased.
6246 * </p>
6247 * <p>
6248 * To use this operation, you must have permissions to perform the <code>s3:PutMetricsConfiguration</code> action.
6249 * The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more
6250 * information about permissions, see <a href=
6251 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
6252 * >Permissions Related to Bucket Subresource Operations</a> and <a
6253 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
6254 * Amazon S3 Resources</a>.
6255 * </p>
6256 * <p>
6257 * For information about CloudWatch request metrics for Amazon S3, see <a
6258 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html">Monitoring Metrics with Amazon
6259 * CloudWatch</a>.
6260 * </p>
6261 * <p>
6262 * The following operations are related to <code>PutBucketMetricsConfiguration</code>:
6263 * </p>
6264 * <ul>
6265 * <li>
6266 * <p>
6267 * <a>DeleteBucketMetricsConfiguration</a>
6268 * </p>
6269 * </li>
6270 * <li>
6271 * <p>
6272 * <a>PutBucketMetricsConfiguration</a>
6273 * </p>
6274 * </li>
6275 * <li>
6276 * <p>
6277 * <a>ListBucketMetricsConfigurations</a>
6278 * </p>
6279 * </li>
6280 * </ul>
6281 * <p>
6282 * <code>GetBucketLifecycle</code> has the following special error:
6283 * </p>
6284 * <ul>
6285 * <li>
6286 * <p>
6287 * Error code: <code>TooManyConfigurations</code>
6288 * </p>
6289 * <ul>
6290 * <li>
6291 * <p>
6292 * Description: You are attempting to create a new configuration but have already reached the 1,000-configuration
6293 * limit.
6294 * </p>
6295 * </li>
6296 * <li>
6297 * <p>
6298 * HTTP Status Code: HTTP 400 Bad Request
6299 * </p>
6300 * </li>
6301 * </ul>
6302 * </li>
6303 * </ul>
6304 *
6305 * @param putBucketMetricsConfigurationRequest
6306 * @return Result of the PutBucketMetricsConfiguration operation returned by the service.
6307 * @throws SdkException
6308 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6309 * catch all scenarios.
6310 * @throws SdkClientException
6311 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6312 * @throws S3Exception
6313 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6314 * @sample S3Client.PutBucketMetricsConfiguration
6315 */
6316 @Override
6317 public PutBucketMetricsConfigurationResponse putBucketMetricsConfiguration(
6318 PutBucketMetricsConfigurationRequest putBucketMetricsConfigurationRequest) throws AwsServiceException,
6319 SdkClientException, S3Exception {
6320
6321 HttpResponseHandler<Response<PutBucketMetricsConfigurationResponse>> responseHandler = protocolFactory
6322 .createCombinedResponseHandler(PutBucketMetricsConfigurationResponse::builder,
6323 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6324
6325 return clientHandler
6326 .execute(new ClientExecutionParams<PutBucketMetricsConfigurationRequest, PutBucketMetricsConfigurationResponse>()
6327 .withOperationName("PutBucketMetricsConfiguration").withCombinedResponseHandler(responseHandler)
6328 .withInput(putBucketMetricsConfigurationRequest)
6329 .withMarshaller(new PutBucketMetricsConfigurationRequestMarshaller(protocolFactory)));
6330 }
6331
6332 /**
6333 * <p>
6334 * Enables notifications of specified events for a bucket. For more information about event notifications, see <a
6335 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Configuring Event
6336 * Notifications</a>.
6337 * </p>
6338 * <p>
6339 * Using this API, you can replace an existing notification configuration. The configuration is an XML file that
6340 * defines the event types that you want Amazon S3 to publish and the destination where you want Amazon S3 to
6341 * publish an event notification when it detects an event of the specified type.
6342 * </p>
6343 * <p>
6344 * By default, your bucket has no event notifications configured. That is, the notification configuration will be an
6345 * empty <code>NotificationConfiguration</code>.
6346 * </p>
6347 * <p>
6348 * <code><NotificationConfiguration></code>
6349 * </p>
6350 * <p>
6351 * <code></NotificationConfiguration></code>
6352 * </p>
6353 * <p>
6354 * This operation replaces the existing notification configuration with the configuration you include in the request
6355 * body.
6356 * </p>
6357 * <p>
6358 * After Amazon S3 receives this request, it first verifies that any Amazon Simple Notification Service (Amazon SNS)
6359 * or Amazon Simple Queue Service (Amazon SQS) destination exists, and that the bucket owner has permission to
6360 * publish to it by sending a test notification. In the case of AWS Lambda destinations, Amazon S3 verifies that the
6361 * Lambda function permissions grant Amazon S3 permission to invoke the function from the Amazon S3 bucket. For more
6362 * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Configuring
6363 * Notifications for Amazon S3 Events</a>.
6364 * </p>
6365 * <p>
6366 * You can disable notifications by adding the empty NotificationConfiguration element.
6367 * </p>
6368 * <p>
6369 * By default, only the bucket owner can configure notifications on a bucket. However, bucket owners can use a
6370 * bucket policy to grant permission to other users to set this configuration with
6371 * <code>s3:PutBucketNotification</code> permission.
6372 * </p>
6373 * <note>
6374 * <p>
6375 * The PUT notification is an atomic operation. For example, suppose your notification configuration includes SNS
6376 * topic, SQS queue, and Lambda function configurations. When you send a PUT request with this configuration, Amazon
6377 * S3 sends test messages to your SNS topic. If the message fails, the entire PUT operation will fail, and Amazon S3
6378 * will not add the configuration to your bucket.
6379 * </p>
6380 * </note>
6381 * <p>
6382 * <b>Responses</b>
6383 * </p>
6384 * <p>
6385 * If the configuration in the request body includes only one <code>TopicConfiguration</code> specifying only the
6386 * <code>s3:ReducedRedundancyLostObject</code> event type, the response will also include the
6387 * <code>x-amz-sns-test-message-id</code> header containing the message ID of the test notification sent to the
6388 * topic.
6389 * </p>
6390 * <p>
6391 * The following operation is related to <code>PutBucketNotificationConfiguration</code>:
6392 * </p>
6393 * <ul>
6394 * <li>
6395 * <p>
6396 * <a>GetBucketNotificationConfiguration</a>
6397 * </p>
6398 * </li>
6399 * </ul>
6400 *
6401 * @param putBucketNotificationConfigurationRequest
6402 * @return Result of the PutBucketNotificationConfiguration operation returned by the service.
6403 * @throws SdkException
6404 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6405 * catch all scenarios.
6406 * @throws SdkClientException
6407 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6408 * @throws S3Exception
6409 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6410 * @sample S3Client.PutBucketNotificationConfiguration
6411 */
6412 @Override
6413 public PutBucketNotificationConfigurationResponse putBucketNotificationConfiguration(
6414 PutBucketNotificationConfigurationRequest putBucketNotificationConfigurationRequest) throws AwsServiceException,
6415 SdkClientException, S3Exception {
6416
6417 HttpResponseHandler<Response<PutBucketNotificationConfigurationResponse>> responseHandler = protocolFactory
6418 .createCombinedResponseHandler(PutBucketNotificationConfigurationResponse::builder,
6419 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6420
6421 return clientHandler
6422 .execute(new ClientExecutionParams<PutBucketNotificationConfigurationRequest, PutBucketNotificationConfigurationResponse>()
6423 .withOperationName("PutBucketNotificationConfiguration").withCombinedResponseHandler(responseHandler)
6424 .withInput(putBucketNotificationConfigurationRequest)
6425 .withMarshaller(new PutBucketNotificationConfigurationRequestMarshaller(protocolFactory)));
6426 }
6427
6428 /**
6429 * <p>
6430 * Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using an identity other than the root user
6431 * of the AWS account that owns the bucket, the calling identity must have the <code>PutBucketPolicy</code>
6432 * permissions on the specified bucket and belong to the bucket owner's account in order to use this operation.
6433 * </p>
6434 * <p>
6435 * If you don't have <code>PutBucketPolicy</code> permissions, Amazon S3 returns a <code>403 Access Denied</code>
6436 * error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's
6437 * account, Amazon S3 returns a <code>405 Method Not Allowed</code> error.
6438 * </p>
6439 * <important>
6440 * <p>
6441 * As a security precaution, the root user of the AWS account that owns a bucket can always use this operation, even
6442 * if the policy explicitly denies the root user the ability to perform this action.
6443 * </p>
6444 * </important>
6445 * <p>
6446 * For more information about bucket policies, see <a
6447 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using Bucket Policies and User
6448 * Policies</a>.
6449 * </p>
6450 * <p>
6451 * The following operations are related to <code>PutBucketPolicy</code>:
6452 * </p>
6453 * <ul>
6454 * <li>
6455 * <p>
6456 * <a>CreateBucket</a>
6457 * </p>
6458 * </li>
6459 * <li>
6460 * <p>
6461 * <a>DeleteBucket</a>
6462 * </p>
6463 * </li>
6464 * </ul>
6465 *
6466 * @param putBucketPolicyRequest
6467 * @return Result of the PutBucketPolicy operation returned by the service.
6468 * @throws SdkException
6469 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6470 * catch all scenarios.
6471 * @throws SdkClientException
6472 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6473 * @throws S3Exception
6474 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6475 * @sample S3Client.PutBucketPolicy
6476 */
6477 @Override
6478 public PutBucketPolicyResponse putBucketPolicy(PutBucketPolicyRequest putBucketPolicyRequest) throws AwsServiceException,
6479 SdkClientException, S3Exception {
6480
6481 HttpResponseHandler<Response<PutBucketPolicyResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
6482 PutBucketPolicyResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6483
6484 return clientHandler.execute(new ClientExecutionParams<PutBucketPolicyRequest, PutBucketPolicyResponse>()
6485 .withOperationName("PutBucketPolicy").withCombinedResponseHandler(responseHandler)
6486 .withInput(putBucketPolicyRequest).withMarshaller(new PutBucketPolicyRequestMarshaller(protocolFactory)));
6487 }
6488
6489 /**
6490 * <p>
6491 * Creates a replication configuration or replaces an existing one. For more information, see <a
6492 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html">Replication</a> in the <i>Amazon S3
6493 * Developer Guide</i>.
6494 * </p>
6495 * <note>
6496 * <p>
6497 * To perform this operation, the user or role performing the operation must have the <a
6498 * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html">iam:PassRole</a> permission.
6499 * </p>
6500 * </note>
6501 * <p>
6502 * Specify the replication configuration in the request body. In the replication configuration, you provide the name
6503 * of the destination bucket where you want Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume
6504 * to replicate objects on your behalf, and other relevant information.
6505 * </p>
6506 * <p>
6507 * A replication configuration must include at least one rule, and can contain a maximum of 1,000. Each rule
6508 * identifies a subset of objects to replicate by filtering the objects in the source bucket. To choose additional
6509 * subsets of objects to replicate, add a rule for each subset. All rules must specify the same destination bucket.
6510 * </p>
6511 * <p>
6512 * To specify a subset of the objects in the source bucket to apply a replication rule to, add the Filter element as
6513 * a child of the Rule element. You can filter objects based on an object key prefix, one or more object tags, or
6514 * both. When you add the Filter element in the configuration, you must also add the following elements:
6515 * <code>DeleteMarkerReplication</code>, <code>Status</code>, and <code>Priority</code>.
6516 * </p>
6517 * <p>
6518 * For information about enabling versioning on a bucket, see <a
6519 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html">Using Versioning</a>.
6520 * </p>
6521 * <p>
6522 * By default, a resource owner, in this case the AWS account that created the bucket, can perform this operation.
6523 * The resource owner can also grant others permissions to perform the operation. For more information about
6524 * permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying
6525 * Permissions in a Policy</a> and <a
6526 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
6527 * Amazon S3 Resources</a>.
6528 * </p>
6529 * <p>
6530 * <b>Handling Replication of Encrypted Objects</b>
6531 * </p>
6532 * <p>
6533 * By default, Amazon S3 doesn't replicate objects that are stored at rest using server-side encryption with CMKs
6534 * stored in AWS KMS. To replicate AWS KMS-encrypted objects, add the following:
6535 * <code>SourceSelectionCriteria</code>, <code>SseKmsEncryptedObjects</code>, <code>Status</code>,
6536 * <code>EncryptionConfiguration</code>, and <code>ReplicaKmsKeyID</code>. For information about replication
6537 * configuration, see <a
6538 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html">Replicating
6539 * Objects Created with SSE Using CMKs stored in AWS KMS</a>.
6540 * </p>
6541 * <p>
6542 * For information on <code>PutBucketReplication</code> errors, see <a>ReplicationErrorCodeList</a>
6543 * </p>
6544 * <p>
6545 * The following operations are related to <code>PutBucketReplication</code>:
6546 * </p>
6547 * <ul>
6548 * <li>
6549 * <p>
6550 * <a>GetBucketReplication</a>
6551 * </p>
6552 * </li>
6553 * <li>
6554 * <p>
6555 * <a>DeleteBucketReplication</a>
6556 * </p>
6557 * </li>
6558 * </ul>
6559 *
6560 * @param putBucketReplicationRequest
6561 * @return Result of the PutBucketReplication operation returned by the service.
6562 * @throws SdkException
6563 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6564 * catch all scenarios.
6565 * @throws SdkClientException
6566 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6567 * @throws S3Exception
6568 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6569 * @sample S3Client.PutBucketReplication
6570 */
6571 @Override
6572 public PutBucketReplicationResponse putBucketReplication(PutBucketReplicationRequest putBucketReplicationRequest)
6573 throws AwsServiceException, SdkClientException, S3Exception {
6574
6575 HttpResponseHandler<Response<PutBucketReplicationResponse>> responseHandler = protocolFactory
6576 .createCombinedResponseHandler(PutBucketReplicationResponse::builder,
6577 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6578
6579 return clientHandler.execute(new ClientExecutionParams<PutBucketReplicationRequest, PutBucketReplicationResponse>()
6580 .withOperationName("PutBucketReplication").withCombinedResponseHandler(responseHandler)
6581 .withInput(putBucketReplicationRequest)
6582 .withMarshaller(new PutBucketReplicationRequestMarshaller(protocolFactory)));
6583 }
6584
6585 /**
6586 * <p>
6587 * Sets the request payment configuration for a bucket. By default, the bucket owner pays for downloads from the
6588 * bucket. This configuration parameter enables the bucket owner (only) to specify that the person requesting the
6589 * download will be charged for the download. For more information, see <a
6590 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html">Requester Pays Buckets</a>.
6591 * </p>
6592 * <p>
6593 * The following operations are related to <code>PutBucketRequestPayment</code>:
6594 * </p>
6595 * <ul>
6596 * <li>
6597 * <p>
6598 * <a>CreateBucket</a>
6599 * </p>
6600 * </li>
6601 * <li>
6602 * <p>
6603 * <a>GetBucketRequestPayment</a>
6604 * </p>
6605 * </li>
6606 * </ul>
6607 *
6608 * @param putBucketRequestPaymentRequest
6609 * @return Result of the PutBucketRequestPayment operation returned by the service.
6610 * @throws SdkException
6611 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6612 * catch all scenarios.
6613 * @throws SdkClientException
6614 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6615 * @throws S3Exception
6616 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6617 * @sample S3Client.PutBucketRequestPayment
6618 */
6619 @Override
6620 public PutBucketRequestPaymentResponse putBucketRequestPayment(PutBucketRequestPaymentRequest putBucketRequestPaymentRequest)
6621 throws AwsServiceException, SdkClientException, S3Exception {
6622
6623 HttpResponseHandler<Response<PutBucketRequestPaymentResponse>> responseHandler = protocolFactory
6624 .createCombinedResponseHandler(PutBucketRequestPaymentResponse::builder,
6625 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6626
6627 return clientHandler.execute(new ClientExecutionParams<PutBucketRequestPaymentRequest, PutBucketRequestPaymentResponse>()
6628 .withOperationName("PutBucketRequestPayment").withCombinedResponseHandler(responseHandler)
6629 .withInput(putBucketRequestPaymentRequest)
6630 .withMarshaller(new PutBucketRequestPaymentRequestMarshaller(protocolFactory)));
6631 }
6632
6633 /**
6634 * <p>
6635 * Sets the tags for a bucket.
6636 * </p>
6637 * <p>
6638 * Use tags to organize your AWS bill to reflect your own cost structure. To do this, sign up to get your AWS
6639 * account bill with tag key values included. Then, to see the cost of combined resources, organize your billing
6640 * information according to resources with the same tag key values. For example, you can tag several resources with
6641 * a specific application name, and then organize your billing information to see the total cost of that application
6642 * across several services. For more information, see <a
6643 * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Cost Allocation and
6644 * Tagging</a>.
6645 * </p>
6646 * <note>
6647 * <p>
6648 * Within a bucket, if you add a tag that has the same key as an existing tag, the new value overwrites the old
6649 * value. For more information, see <a
6650 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/CostAllocTagging.html">Using Cost Allocation in Amazon S3
6651 * Bucket Tags</a>.
6652 * </p>
6653 * </note>
6654 * <p>
6655 * To use this operation, you must have permissions to perform the <code>s3:PutBucketTagging</code> action. The
6656 * bucket owner has this permission by default and can grant this permission to others. For more information about
6657 * permissions, see <a href=
6658 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
6659 * >Permissions Related to Bucket Subresource Operations</a> and <a
6660 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
6661 * Amazon S3 Resources</a>.
6662 * </p>
6663 * <p>
6664 * <code>PutBucketTagging</code> has the following special errors:
6665 * </p>
6666 * <ul>
6667 * <li>
6668 * <p>
6669 * Error code: <code>InvalidTagError</code>
6670 * </p>
6671 * <ul>
6672 * <li>
6673 * <p>
6674 * Description: The tag provided was not a valid tag. This error can occur if the tag did not pass input validation.
6675 * For information about tag restrictions, see <a
6676 * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined
6677 * Tag Restrictions</a> and <a
6678 * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html">AWS-Generated Cost
6679 * Allocation Tag Restrictions</a>.
6680 * </p>
6681 * </li>
6682 * </ul>
6683 * </li>
6684 * <li>
6685 * <p>
6686 * Error code: <code>MalformedXMLError</code>
6687 * </p>
6688 * <ul>
6689 * <li>
6690 * <p>
6691 * Description: The XML provided does not match the schema.
6692 * </p>
6693 * </li>
6694 * </ul>
6695 * </li>
6696 * <li>
6697 * <p>
6698 * Error code: <code>OperationAbortedError </code>
6699 * </p>
6700 * <ul>
6701 * <li>
6702 * <p>
6703 * Description: A conflicting conditional operation is currently in progress against this resource. Please try
6704 * again.
6705 * </p>
6706 * </li>
6707 * </ul>
6708 * </li>
6709 * <li>
6710 * <p>
6711 * Error code: <code>InternalError</code>
6712 * </p>
6713 * <ul>
6714 * <li>
6715 * <p>
6716 * Description: The service was unable to apply the provided tag to the bucket.
6717 * </p>
6718 * </li>
6719 * </ul>
6720 * </li>
6721 * </ul>
6722 * <p>
6723 * The following operations are related to <code>PutBucketTagging</code>:
6724 * </p>
6725 * <ul>
6726 * <li>
6727 * <p>
6728 * <a>GetBucketTagging</a>
6729 * </p>
6730 * </li>
6731 * <li>
6732 * <p>
6733 * <a>DeleteBucketTagging</a>
6734 * </p>
6735 * </li>
6736 * </ul>
6737 *
6738 * @param putBucketTaggingRequest
6739 * @return Result of the PutBucketTagging operation returned by the service.
6740 * @throws SdkException
6741 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6742 * catch all scenarios.
6743 * @throws SdkClientException
6744 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6745 * @throws S3Exception
6746 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6747 * @sample S3Client.PutBucketTagging
6748 */
6749 @Override
6750 public PutBucketTaggingResponse putBucketTagging(PutBucketTaggingRequest putBucketTaggingRequest) throws AwsServiceException,
6751 SdkClientException, S3Exception {
6752
6753 HttpResponseHandler<Response<PutBucketTaggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
6754 PutBucketTaggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6755
6756 return clientHandler.execute(new ClientExecutionParams<PutBucketTaggingRequest, PutBucketTaggingResponse>()
6757 .withOperationName("PutBucketTagging").withCombinedResponseHandler(responseHandler)
6758 .withInput(putBucketTaggingRequest).withMarshaller(new PutBucketTaggingRequestMarshaller(protocolFactory)));
6759 }
6760
6761 /**
6762 * <p>
6763 * Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.
6764 * </p>
6765 * <p>
6766 * You can set the versioning state with one of the following values:
6767 * </p>
6768 * <p>
6769 * <b>Enabled</b>—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique
6770 * version ID.
6771 * </p>
6772 * <p>
6773 * <b>Suspended</b>—Disables versioning for the objects in the bucket. All objects added to the bucket receive the
6774 * version ID null.
6775 * </p>
6776 * <p>
6777 * If the versioning state has never been set on a bucket, it has no versioning state; a <a>GetBucketVersioning</a>
6778 * request does not return a versioning state value.
6779 * </p>
6780 * <p>
6781 * If the bucket owner enables MFA Delete in the bucket versioning configuration, the bucket owner must include the
6782 * <code>x-amz-mfa request</code> header and the <code>Status</code> and the <code>MfaDelete</code> request elements
6783 * in a request to set the versioning state of the bucket.
6784 * </p>
6785 * <important>
6786 * <p>
6787 * If you have an object expiration lifecycle policy in your non-versioned bucket and you want to maintain the same
6788 * permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent
6789 * expiration lifecycle policy will manage the deletes of the noncurrent object versions in the version-enabled
6790 * bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more
6791 * information, see <a href=
6792 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config"
6793 * >Lifecycle and Versioning</a>.
6794 * </p>
6795 * </important>
6796 * <p class="title">
6797 * <b>Related Resources</b>
6798 * </p>
6799 * <ul>
6800 * <li>
6801 * <p>
6802 * <a>CreateBucket</a>
6803 * </p>
6804 * </li>
6805 * <li>
6806 * <p>
6807 * <a>DeleteBucket</a>
6808 * </p>
6809 * </li>
6810 * <li>
6811 * <p>
6812 * <a>GetBucketVersioning</a>
6813 * </p>
6814 * </li>
6815 * </ul>
6816 *
6817 * @param putBucketVersioningRequest
6818 * @return Result of the PutBucketVersioning operation returned by the service.
6819 * @throws SdkException
6820 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6821 * catch all scenarios.
6822 * @throws SdkClientException
6823 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6824 * @throws S3Exception
6825 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6826 * @sample S3Client.PutBucketVersioning
6827 */
6828 @Override
6829 public PutBucketVersioningResponse putBucketVersioning(PutBucketVersioningRequest putBucketVersioningRequest)
6830 throws AwsServiceException, SdkClientException, S3Exception {
6831
6832 HttpResponseHandler<Response<PutBucketVersioningResponse>> responseHandler = protocolFactory
6833 .createCombinedResponseHandler(PutBucketVersioningResponse::builder,
6834 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6835
6836 return clientHandler.execute(new ClientExecutionParams<PutBucketVersioningRequest, PutBucketVersioningResponse>()
6837 .withOperationName("PutBucketVersioning").withCombinedResponseHandler(responseHandler)
6838 .withInput(putBucketVersioningRequest).withMarshaller(new PutBucketVersioningRequestMarshaller(protocolFactory)));
6839 }
6840
6841 /**
6842 * <p>
6843 * Sets the configuration of the website that is specified in the <code>website</code> subresource. To configure a
6844 * bucket as a website, you can add this subresource on the bucket with website configuration information such as
6845 * the file name of the index document and any redirect rules. For more information, see <a
6846 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Hosting Websites on Amazon S3</a>.
6847 * </p>
6848 * <p>
6849 * This PUT operation requires the <code>S3:PutBucketWebsite</code> permission. By default, only the bucket owner
6850 * can configure the website attached to a bucket; however, bucket owners can allow other users to set the website
6851 * configuration by writing a bucket policy that grants them the <code>S3:PutBucketWebsite</code> permission.
6852 * </p>
6853 * <p>
6854 * To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the
6855 * following elements. Because all requests are sent to another website, you don't need to provide index document
6856 * name for the bucket.
6857 * </p>
6858 * <ul>
6859 * <li>
6860 * <p>
6861 * <code>WebsiteConfiguration</code>
6862 * </p>
6863 * </li>
6864 * <li>
6865 * <p>
6866 * <code>RedirectAllRequestsTo</code>
6867 * </p>
6868 * </li>
6869 * <li>
6870 * <p>
6871 * <code>HostName</code>
6872 * </p>
6873 * </li>
6874 * <li>
6875 * <p>
6876 * <code>Protocol</code>
6877 * </p>
6878 * </li>
6879 * </ul>
6880 * <p>
6881 * If you want granular control over redirects, you can use the following elements to add routing rules that
6882 * describe conditions for redirecting requests and information about the redirect destination. In this case, the
6883 * website configuration must provide an index document for the bucket, because some requests might not be
6884 * redirected.
6885 * </p>
6886 * <ul>
6887 * <li>
6888 * <p>
6889 * <code>WebsiteConfiguration</code>
6890 * </p>
6891 * </li>
6892 * <li>
6893 * <p>
6894 * <code>IndexDocument</code>
6895 * </p>
6896 * </li>
6897 * <li>
6898 * <p>
6899 * <code>Suffix</code>
6900 * </p>
6901 * </li>
6902 * <li>
6903 * <p>
6904 * <code>ErrorDocument</code>
6905 * </p>
6906 * </li>
6907 * <li>
6908 * <p>
6909 * <code>Key</code>
6910 * </p>
6911 * </li>
6912 * <li>
6913 * <p>
6914 * <code>RoutingRules</code>
6915 * </p>
6916 * </li>
6917 * <li>
6918 * <p>
6919 * <code>RoutingRule</code>
6920 * </p>
6921 * </li>
6922 * <li>
6923 * <p>
6924 * <code>Condition</code>
6925 * </p>
6926 * </li>
6927 * <li>
6928 * <p>
6929 * <code>HttpErrorCodeReturnedEquals</code>
6930 * </p>
6931 * </li>
6932 * <li>
6933 * <p>
6934 * <code>KeyPrefixEquals</code>
6935 * </p>
6936 * </li>
6937 * <li>
6938 * <p>
6939 * <code>Redirect</code>
6940 * </p>
6941 * </li>
6942 * <li>
6943 * <p>
6944 * <code>Protocol</code>
6945 * </p>
6946 * </li>
6947 * <li>
6948 * <p>
6949 * <code>HostName</code>
6950 * </p>
6951 * </li>
6952 * <li>
6953 * <p>
6954 * <code>ReplaceKeyPrefixWith</code>
6955 * </p>
6956 * </li>
6957 * <li>
6958 * <p>
6959 * <code>ReplaceKeyWith</code>
6960 * </p>
6961 * </li>
6962 * <li>
6963 * <p>
6964 * <code>HttpRedirectCode</code>
6965 * </p>
6966 * </li>
6967 * </ul>
6968 * <p>
6969 * Amazon S3 has a limitation of 50 routing rules per website configuration. If you require more than 50 routing
6970 * rules, you can use object redirect. For more information, see <a
6971 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html">Configuring an Object
6972 * Redirect</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
6973 * </p>
6974 *
6975 * @param putBucketWebsiteRequest
6976 * @return Result of the PutBucketWebsite operation returned by the service.
6977 * @throws SdkException
6978 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
6979 * catch all scenarios.
6980 * @throws SdkClientException
6981 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
6982 * @throws S3Exception
6983 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
6984 * @sample S3Client.PutBucketWebsite
6985 */
6986 @Override
6987 public PutBucketWebsiteResponse putBucketWebsite(PutBucketWebsiteRequest putBucketWebsiteRequest) throws AwsServiceException,
6988 SdkClientException, S3Exception {
6989
6990 HttpResponseHandler<Response<PutBucketWebsiteResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
6991 PutBucketWebsiteResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
6992
6993 return clientHandler.execute(new ClientExecutionParams<PutBucketWebsiteRequest, PutBucketWebsiteResponse>()
6994 .withOperationName("PutBucketWebsite").withCombinedResponseHandler(responseHandler)
6995 .withInput(putBucketWebsiteRequest).withMarshaller(new PutBucketWebsiteRequestMarshaller(protocolFactory)));
6996 }
6997
6998 /**
6999 * <p>
7000 * Adds an object to a bucket. You must have WRITE permissions on a bucket to add an object to it.
7001 * </p>
7002 * <p>
7003 * Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the
7004 * bucket.
7005 * </p>
7006 * <p>
7007 * Amazon S3 is a distributed system. If it receives multiple write requests for the same object simultaneously, it
7008 * overwrites all but the last object written. Amazon S3 does not provide object locking; if you need this, make
7009 * sure to build it into your application layer or use versioning instead.
7010 * </p>
7011 * <p>
7012 * To ensure that data is not corrupted traversing the network, use the <code>Content-MD5</code> header. When you
7013 * use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, returns an
7014 * error. Additionally, you can calculate the MD5 while putting an object to Amazon S3 and compare the returned ETag
7015 * to the calculated MD5 value.
7016 * </p>
7017 * <note>
7018 * <p>
7019 * The <code>Content-MD5</code> header is required for any request to upload an object with a retention period
7020 * configured using Amazon S3 Object Lock. For more information about Amazon S3 Object Lock, see <a
7021 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html">Amazon S3 Object Lock
7022 * Overview</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7023 * </p>
7024 * </note>
7025 * <p>
7026 * <b>Server-side Encryption</b>
7027 * </p>
7028 * <p>
7029 * You can optionally request server-side encryption. With server-side encryption, Amazon S3 encrypts your data as
7030 * it writes it to disks in its data centers and decrypts the data when you access it. You have the option to
7031 * provide your own encryption key or use AWS managed encryption keys. For more information, see <a
7032 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">Using Server-Side
7033 * Encryption</a>.
7034 * </p>
7035 * <p>
7036 * <b>Access Control List (ACL)-Specific Request Headers</b>
7037 * </p>
7038 * <p>
7039 * You can use headers to grant ACL- based permissions. By default, all objects are private. Only the owner has full
7040 * access control. When adding a new object, you can grant permissions to individual AWS accounts or to predefined
7041 * groups defined by Amazon S3. These permissions are then added to the ACL on the object. For more information, see
7042 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL)
7043 * Overview</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html">Managing ACLs
7044 * Using the REST API</a>.
7045 * </p>
7046 * <p>
7047 * <b>Storage Class Options</b>
7048 * </p>
7049 * <p>
7050 * By default, Amazon S3 uses the STANDARD storage class to store newly created objects. The STANDARD storage class
7051 * provides high durability and high availability. Depending on performance needs, you can specify a different
7052 * storage class. For more information, see <a
7053 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage Classes</a> in the
7054 * <i>Amazon S3 Service Developer Guide</i>.
7055 * </p>
7056 * <p>
7057 * <b>Versioning</b>
7058 * </p>
7059 * <p>
7060 * If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being
7061 * stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives
7062 * multiple write requests for the same object simultaneously, it stores all of the objects.
7063 * </p>
7064 * <p>
7065 * For more information about versioning, see <a
7066 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html">Adding
7067 * Objects to Versioning Enabled Buckets</a>. For information about returning the versioning state of a bucket, see
7068 * <a>GetBucketVersioning</a>.
7069 * </p>
7070 * <p class="title">
7071 * <b>Related Resources</b>
7072 * </p>
7073 * <ul>
7074 * <li>
7075 * <p>
7076 * <a>CopyObject</a>
7077 * </p>
7078 * </li>
7079 * <li>
7080 * <p>
7081 * <a>DeleteObject</a>
7082 * </p>
7083 * </li>
7084 * </ul>
7085 *
7086 * @param putObjectRequest
7087 * @param requestBody
7088 * The content to send to the service. A {@link RequestBody} can be created using one of several factory
7089 * methods for various sources of data. For example, to create a request body from a file you can do the
7090 * following.
7091 *
7092 * <pre>
7093 * {@code RequestBody.fromFile(new File("myfile.txt"))}
7094 * </pre>
7095 *
7096 * See documentation in {@link RequestBody} for additional details and which sources of data are supported.
7097 * The service documentation for the request content is as follows '
7098 * <p>
7099 * Object data.
7100 * </p>
7101 * '
7102 * @return Result of the PutObject operation returned by the service.
7103 * @throws SdkException
7104 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7105 * catch all scenarios.
7106 * @throws SdkClientException
7107 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7108 * @throws S3Exception
7109 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7110 * @sample S3Client.PutObject
7111 */
7112 @Override
7113 public PutObjectResponse putObject(PutObjectRequest putObjectRequest, RequestBody requestBody) throws AwsServiceException,
7114 SdkClientException, S3Exception {
7115
7116 HttpResponseHandler<Response<PutObjectResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
7117 PutObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7118
7119 return clientHandler.execute(new ClientExecutionParams<PutObjectRequest, PutObjectResponse>()
7120 .withOperationName("PutObject")
7121 .withCombinedResponseHandler(responseHandler)
7122 .withInput(putObjectRequest)
7123 .withRequestBody(requestBody)
7124 .withMarshaller(
7125 StreamingRequestMarshaller.builder().delegateMarshaller(new PutObjectRequestMarshaller(protocolFactory))
7126 .requestBody(requestBody).build()));
7127 }
7128
7129 /**
7130 * <p>
7131 * Uses the <code>acl</code> subresource to set the access control list (ACL) permissions for an object that already
7132 * exists in a bucket. You must have <code>WRITE_ACP</code> permission to set the ACL of an object.
7133 * </p>
7134 * <p>
7135 * Depending on your application needs, you can choose to set the ACL on an object using either the request body or
7136 * the headers. For example, if you have an existing application that updates a bucket ACL using the request body,
7137 * you can continue to use that approach. For more information, see <a
7138 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL) Overview</a>
7139 * in the <i>Amazon S3 Developer Guide</i>.
7140 * </p>
7141 * <p>
7142 * <b>Access Permissions</b>
7143 * </p>
7144 * <p>
7145 * You can set access permissions using one of the following methods:
7146 * </p>
7147 * <ul>
7148 * <li>
7149 * <p>
7150 * Specify a canned ACL with the <code>x-amz-acl</code> request header. Amazon S3 supports a set of predefined ACLs,
7151 * known as canned ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL
7152 * name as the value of <code>x-amz-ac</code>l. If you use this header, you cannot use other access control-specific
7153 * headers in your request. For more information, see <a
7154 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned ACL</a>.
7155 * </p>
7156 * </li>
7157 * <li>
7158 * <p>
7159 * Specify access permissions explicitly with the <code>x-amz-grant-read</code>, <code>x-amz-grant-read-acp</code>,
7160 * <code>x-amz-grant-write-acp</code>, and <code>x-amz-grant-full-control</code> headers. When using these headers,
7161 * you specify explicit access permissions and grantees (AWS accounts or Amazon S3 groups) who will receive the
7162 * permission. If you use these ACL-specific headers, you cannot use <code>x-amz-acl</code> header to set a canned
7163 * ACL. These parameters map to the set of permissions that Amazon S3 supports in an ACL. For more information, see
7164 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL)
7165 * Overview</a>.
7166 * </p>
7167 * <p>
7168 * You specify each grantee as a type=value pair, where the type is one of the following:
7169 * </p>
7170 * <ul>
7171 * <li>
7172 * <p>
7173 * <code>id</code> – if the value specified is the canonical user ID of an AWS account
7174 * </p>
7175 * </li>
7176 * <li>
7177 * <p>
7178 * <code>uri</code> – if you are granting permissions to a predefined group
7179 * </p>
7180 * </li>
7181 * <li>
7182 * <p>
7183 * <code>emailAddress</code> – if the value specified is the email address of an AWS account
7184 * </p>
7185 * <note>
7186 * <p>
7187 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
7188 * </p>
7189 * <ul>
7190 * <li>
7191 * <p>
7192 * US East (N. Virginia)
7193 * </p>
7194 * </li>
7195 * <li>
7196 * <p>
7197 * US West (N. California)
7198 * </p>
7199 * </li>
7200 * <li>
7201 * <p>
7202 * US West (Oregon)
7203 * </p>
7204 * </li>
7205 * <li>
7206 * <p>
7207 * Asia Pacific (Singapore)
7208 * </p>
7209 * </li>
7210 * <li>
7211 * <p>
7212 * Asia Pacific (Sydney)
7213 * </p>
7214 * </li>
7215 * <li>
7216 * <p>
7217 * Asia Pacific (Tokyo)
7218 * </p>
7219 * </li>
7220 * <li>
7221 * <p>
7222 * Europe (Ireland)
7223 * </p>
7224 * </li>
7225 * <li>
7226 * <p>
7227 * South America (São Paulo)
7228 * </p>
7229 * </li>
7230 * </ul>
7231 * <p>
7232 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
7233 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
7234 * General Reference.
7235 * </p>
7236 * </note></li>
7237 * </ul>
7238 * <p>
7239 * For example, the following <code>x-amz-grant-read</code> header grants list objects permission to the two AWS
7240 * accounts identified by their email addresses.
7241 * </p>
7242 * <p>
7243 * <code>x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" </code>
7244 * </p>
7245 * </li>
7246 * </ul>
7247 * <p>
7248 * You can use either a canned ACL or specify access permissions explicitly. You cannot do both.
7249 * </p>
7250 * <p>
7251 * <b>Grantee Values</b>
7252 * </p>
7253 * <p>
7254 * You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the
7255 * following ways:
7256 * </p>
7257 * <ul>
7258 * <li>
7259 * <p>
7260 * By the person's ID:
7261 * </p>
7262 * <p>
7263 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID><>ID<></ID><DisplayName><>GranteesEmail<></DisplayName> </Grantee></code>
7264 * </p>
7265 * <p>
7266 * DisplayName is optional and ignored in the request.
7267 * </p>
7268 * </li>
7269 * <li>
7270 * <p>
7271 * By URI:
7272 * </p>
7273 * <p>
7274 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<></URI></Grantee></code>
7275 * </p>
7276 * </li>
7277 * <li>
7278 * <p>
7279 * By Email address:
7280 * </p>
7281 * <p>
7282 * <code><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"><EmailAddress><>Grantees@email.com<></EmailAddress>lt;/Grantee></code>
7283 * </p>
7284 * <p>
7285 * The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the
7286 * CanonicalUser.
7287 * </p>
7288 * <note>
7289 * <p>
7290 * Using email addresses to specify a grantee is only supported in the following AWS Regions:
7291 * </p>
7292 * <ul>
7293 * <li>
7294 * <p>
7295 * US East (N. Virginia)
7296 * </p>
7297 * </li>
7298 * <li>
7299 * <p>
7300 * US West (N. California)
7301 * </p>
7302 * </li>
7303 * <li>
7304 * <p>
7305 * US West (Oregon)
7306 * </p>
7307 * </li>
7308 * <li>
7309 * <p>
7310 * Asia Pacific (Singapore)
7311 * </p>
7312 * </li>
7313 * <li>
7314 * <p>
7315 * Asia Pacific (Sydney)
7316 * </p>
7317 * </li>
7318 * <li>
7319 * <p>
7320 * Asia Pacific (Tokyo)
7321 * </p>
7322 * </li>
7323 * <li>
7324 * <p>
7325 * Europe (Ireland)
7326 * </p>
7327 * </li>
7328 * <li>
7329 * <p>
7330 * South America (São Paulo)
7331 * </p>
7332 * </li>
7333 * </ul>
7334 * <p>
7335 * For a list of all the Amazon S3 supported Regions and endpoints, see <a
7336 * href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the AWS
7337 * General Reference.
7338 * </p>
7339 * </note></li>
7340 * </ul>
7341 * <p>
7342 * <b>Versioning</b>
7343 * </p>
7344 * <p>
7345 * The ACL of an object is set at the object version level. By default, PUT sets the ACL of the current version of
7346 * an object. To set the ACL of a different version, use the <code>versionId</code> subresource.
7347 * </p>
7348 * <p class="title">
7349 * <b>Related Resources</b>
7350 * </p>
7351 * <ul>
7352 * <li>
7353 * <p>
7354 * <a>CopyObject</a>
7355 * </p>
7356 * </li>
7357 * <li>
7358 * <p>
7359 * <a>GetObject</a>
7360 * </p>
7361 * </li>
7362 * </ul>
7363 *
7364 * @param putObjectAclRequest
7365 * @return Result of the PutObjectAcl operation returned by the service.
7366 * @throws NoSuchKeyException
7367 * The specified key does not exist.
7368 * @throws SdkException
7369 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7370 * catch all scenarios.
7371 * @throws SdkClientException
7372 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7373 * @throws S3Exception
7374 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7375 * @sample S3Client.PutObjectAcl
7376 */
7377 @Override
7378 public PutObjectAclResponse putObjectAcl(PutObjectAclRequest putObjectAclRequest) throws NoSuchKeyException,
7379 AwsServiceException, SdkClientException, S3Exception {
7380
7381 HttpResponseHandler<Response<PutObjectAclResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
7382 PutObjectAclResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7383
7384 return clientHandler.execute(new ClientExecutionParams<PutObjectAclRequest, PutObjectAclResponse>()
7385 .withOperationName("PutObjectAcl").withCombinedResponseHandler(responseHandler).withInput(putObjectAclRequest)
7386 .withMarshaller(new PutObjectAclRequestMarshaller(protocolFactory)));
7387 }
7388
7389 /**
7390 * <p>
7391 * Applies a Legal Hold configuration to the specified object.
7392 * </p>
7393 * <p class="title">
7394 * <b>Related Resources</b>
7395 * </p>
7396 * <ul>
7397 * <li>
7398 * <p>
7399 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>
7400 * </p>
7401 * </li>
7402 * </ul>
7403 *
7404 * @param putObjectLegalHoldRequest
7405 * @return Result of the PutObjectLegalHold operation returned by the service.
7406 * @throws SdkException
7407 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7408 * catch all scenarios.
7409 * @throws SdkClientException
7410 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7411 * @throws S3Exception
7412 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7413 * @sample S3Client.PutObjectLegalHold
7414 */
7415 @Override
7416 public PutObjectLegalHoldResponse putObjectLegalHold(PutObjectLegalHoldRequest putObjectLegalHoldRequest)
7417 throws AwsServiceException, SdkClientException, S3Exception {
7418
7419 HttpResponseHandler<Response<PutObjectLegalHoldResponse>> responseHandler = protocolFactory
7420 .createCombinedResponseHandler(PutObjectLegalHoldResponse::builder,
7421 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7422
7423 return clientHandler.execute(new ClientExecutionParams<PutObjectLegalHoldRequest, PutObjectLegalHoldResponse>()
7424 .withOperationName("PutObjectLegalHold").withCombinedResponseHandler(responseHandler)
7425 .withInput(putObjectLegalHoldRequest).withMarshaller(new PutObjectLegalHoldRequestMarshaller(protocolFactory)));
7426 }
7427
7428 /**
7429 * <p>
7430 * Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration
7431 * will be applied by default to every new object placed in the specified bucket.
7432 * </p>
7433 * <note>
7434 * <p>
7435 * <code>DefaultRetention</code> requires either Days or Years. You can't specify both at the same time.
7436 * </p>
7437 * </note>
7438 * <p class="title">
7439 * <b>Related Resources</b>
7440 * </p>
7441 * <ul>
7442 * <li>
7443 * <p>
7444 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>
7445 * </p>
7446 * </li>
7447 * </ul>
7448 *
7449 * @param putObjectLockConfigurationRequest
7450 * @return Result of the PutObjectLockConfiguration operation returned by the service.
7451 * @throws SdkException
7452 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7453 * catch all scenarios.
7454 * @throws SdkClientException
7455 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7456 * @throws S3Exception
7457 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7458 * @sample S3Client.PutObjectLockConfiguration
7459 */
7460 @Override
7461 public PutObjectLockConfigurationResponse putObjectLockConfiguration(
7462 PutObjectLockConfigurationRequest putObjectLockConfigurationRequest) throws AwsServiceException, SdkClientException,
7463 S3Exception {
7464
7465 HttpResponseHandler<Response<PutObjectLockConfigurationResponse>> responseHandler = protocolFactory
7466 .createCombinedResponseHandler(PutObjectLockConfigurationResponse::builder,
7467 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7468
7469 return clientHandler
7470 .execute(new ClientExecutionParams<PutObjectLockConfigurationRequest, PutObjectLockConfigurationResponse>()
7471 .withOperationName("PutObjectLockConfiguration").withCombinedResponseHandler(responseHandler)
7472 .withInput(putObjectLockConfigurationRequest)
7473 .withMarshaller(new PutObjectLockConfigurationRequestMarshaller(protocolFactory)));
7474 }
7475
7476 /**
7477 * <p>
7478 * Places an Object Retention configuration on an object.
7479 * </p>
7480 * <p class="title">
7481 * <b>Related Resources</b>
7482 * </p>
7483 * <ul>
7484 * <li>
7485 * <p>
7486 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html">Locking Objects</a>
7487 * </p>
7488 * </li>
7489 * </ul>
7490 *
7491 * @param putObjectRetentionRequest
7492 * @return Result of the PutObjectRetention operation returned by the service.
7493 * @throws SdkException
7494 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7495 * catch all scenarios.
7496 * @throws SdkClientException
7497 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7498 * @throws S3Exception
7499 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7500 * @sample S3Client.PutObjectRetention
7501 */
7502 @Override
7503 public PutObjectRetentionResponse putObjectRetention(PutObjectRetentionRequest putObjectRetentionRequest)
7504 throws AwsServiceException, SdkClientException, S3Exception {
7505
7506 HttpResponseHandler<Response<PutObjectRetentionResponse>> responseHandler = protocolFactory
7507 .createCombinedResponseHandler(PutObjectRetentionResponse::builder,
7508 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7509
7510 return clientHandler.execute(new ClientExecutionParams<PutObjectRetentionRequest, PutObjectRetentionResponse>()
7511 .withOperationName("PutObjectRetention").withCombinedResponseHandler(responseHandler)
7512 .withInput(putObjectRetentionRequest).withMarshaller(new PutObjectRetentionRequestMarshaller(protocolFactory)));
7513 }
7514
7515 /**
7516 * <p>
7517 * Sets the supplied tag-set to an object that already exists in a bucket.
7518 * </p>
7519 * <p>
7520 * A tag is a key-value pair. You can associate tags with an object by sending a PUT request against the tagging
7521 * subresource that is associated with the object. You can retrieve tags by sending a GET request. For more
7522 * information, see <a>GetObjectTagging</a>.
7523 * </p>
7524 * <p>
7525 * For tagging-related restrictions related to characters and encodings, see <a
7526 * href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">Tag
7527 * Restrictions</a>. Note that Amazon S3 limits the maximum number of tags to 10 tags per object.
7528 * </p>
7529 * <p>
7530 * To use this operation, you must have permission to perform the <code>s3:PutObjectTagging</code> action. By
7531 * default, the bucket owner has this permission and can grant this permission to others.
7532 * </p>
7533 * <p>
7534 * To put tags of any other version, use the <code>versionId</code> query parameter. You also need permission for
7535 * the <code>s3:PutObjectVersionTagging</code> action.
7536 * </p>
7537 * <p>
7538 * For information about the Amazon S3 object tagging feature, see <a
7539 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html">Object Tagging</a>.
7540 * </p>
7541 * <p class="title">
7542 * <b>Special Errors</b>
7543 * </p>
7544 * <ul>
7545 * <li>
7546 * <p class="title">
7547 * <b/>
7548 * </p>
7549 * <ul>
7550 * <li>
7551 * <p>
7552 * <i>Code: InvalidTagError </i>
7553 * </p>
7554 * </li>
7555 * <li>
7556 * <p>
7557 * <i>Cause: The tag provided was not a valid tag. This error can occur if the tag did not pass input validation.
7558 * For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html">Object
7559 * Tagging</a>.</i>
7560 * </p>
7561 * </li>
7562 * </ul>
7563 * </li>
7564 * <li>
7565 * <p class="title">
7566 * <b/>
7567 * </p>
7568 * <ul>
7569 * <li>
7570 * <p>
7571 * <i>Code: MalformedXMLError </i>
7572 * </p>
7573 * </li>
7574 * <li>
7575 * <p>
7576 * <i>Cause: The XML provided does not match the schema.</i>
7577 * </p>
7578 * </li>
7579 * </ul>
7580 * </li>
7581 * <li>
7582 * <ul>
7583 * <li>
7584 * <p>
7585 * <i>Code: OperationAbortedError </i>
7586 * </p>
7587 * </li>
7588 * <li>
7589 * <p>
7590 * <i>Cause: A conflicting conditional operation is currently in progress against this resource. Please try
7591 * again.</i>
7592 * </p>
7593 * </li>
7594 * </ul>
7595 * </li>
7596 * <li>
7597 * <ul>
7598 * <li>
7599 * <p>
7600 * <i>Code: InternalError</i>
7601 * </p>
7602 * </li>
7603 * <li>
7604 * <p>
7605 * <i>Cause: The service was unable to apply the provided tag to the object.</i>
7606 * </p>
7607 * </li>
7608 * </ul>
7609 * </li>
7610 * </ul>
7611 * <p class="title">
7612 * <b>Related Resources</b>
7613 * </p>
7614 * <ul>
7615 * <li>
7616 * <p>
7617 * <a>GetObjectTagging</a>
7618 * </p>
7619 * </li>
7620 * </ul>
7621 *
7622 * @param putObjectTaggingRequest
7623 * @return Result of the PutObjectTagging operation returned by the service.
7624 * @throws SdkException
7625 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7626 * catch all scenarios.
7627 * @throws SdkClientException
7628 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7629 * @throws S3Exception
7630 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7631 * @sample S3Client.PutObjectTagging
7632 */
7633 @Override
7634 public PutObjectTaggingResponse putObjectTagging(PutObjectTaggingRequest putObjectTaggingRequest) throws AwsServiceException,
7635 SdkClientException, S3Exception {
7636
7637 HttpResponseHandler<Response<PutObjectTaggingResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
7638 PutObjectTaggingResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7639
7640 return clientHandler.execute(new ClientExecutionParams<PutObjectTaggingRequest, PutObjectTaggingResponse>()
7641 .withOperationName("PutObjectTagging").withCombinedResponseHandler(responseHandler)
7642 .withInput(putObjectTaggingRequest).withMarshaller(new PutObjectTaggingRequestMarshaller(protocolFactory)));
7643 }
7644
7645 /**
7646 * <p>
7647 * Creates or modifies the <code>PublicAccessBlock</code> configuration for an Amazon S3 bucket. To use this
7648 * operation, you must have the <code>s3:PutBucketPublicAccessBlock</code> permission. For more information about
7649 * Amazon S3 permissions, see <a
7650 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html">Specifying Permissions in a
7651 * Policy</a>.
7652 * </p>
7653 * <important>
7654 * <p>
7655 * When Amazon S3 evaluates the <code>PublicAccessBlock</code> configuration for a bucket or an object, it checks
7656 * the <code>PublicAccessBlock</code> configuration for both the bucket (or the bucket that contains the object) and
7657 * the bucket owner's account. If the <code>PublicAccessBlock</code> configurations are different between the bucket
7658 * and the account, Amazon S3 uses the most restrictive combination of the bucket-level and account-level settings.
7659 * </p>
7660 * </important>
7661 * <p>
7662 * For more information about when Amazon S3 considers a bucket or an object public, see <a href=
7663 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status"
7664 * >The Meaning of "Public"</a>.
7665 * </p>
7666 * <p class="title">
7667 * <b>Related Resources</b>
7668 * </p>
7669 * <ul>
7670 * <li>
7671 * <p>
7672 * <a>GetPublicAccessBlock</a>
7673 * </p>
7674 * </li>
7675 * <li>
7676 * <p>
7677 * <a>DeletePublicAccessBlock</a>
7678 * </p>
7679 * </li>
7680 * <li>
7681 * <p>
7682 * <a>GetBucketPolicyStatus</a>
7683 * </p>
7684 * </li>
7685 * <li>
7686 * <p>
7687 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html">Using Amazon S3
7688 * Block Public Access</a>
7689 * </p>
7690 * </li>
7691 * </ul>
7692 *
7693 * @param putPublicAccessBlockRequest
7694 * @return Result of the PutPublicAccessBlock operation returned by the service.
7695 * @throws SdkException
7696 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
7697 * catch all scenarios.
7698 * @throws SdkClientException
7699 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
7700 * @throws S3Exception
7701 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
7702 * @sample S3Client.PutPublicAccessBlock
7703 */
7704 @Override
7705 public PutPublicAccessBlockResponse putPublicAccessBlock(PutPublicAccessBlockRequest putPublicAccessBlockRequest)
7706 throws AwsServiceException, SdkClientException, S3Exception {
7707
7708 HttpResponseHandler<Response<PutPublicAccessBlockResponse>> responseHandler = protocolFactory
7709 .createCombinedResponseHandler(PutPublicAccessBlockResponse::builder,
7710 new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
7711
7712 return clientHandler.execute(new ClientExecutionParams<PutPublicAccessBlockRequest, PutPublicAccessBlockResponse>()
7713 .withOperationName("PutPublicAccessBlock").withCombinedResponseHandler(responseHandler)
7714 .withInput(putPublicAccessBlockRequest)
7715 .withMarshaller(new PutPublicAccessBlockRequestMarshaller(protocolFactory)));
7716 }
7717
7718 /**
7719 * <p>
7720 * Restores an archived copy of an object back into Amazon S3
7721 * </p>
7722 * <p>
7723 * This operation performs the following types of requests:
7724 * </p>
7725 * <ul>
7726 * <li>
7727 * <p>
7728 * <code>select</code> - Perform a select query on an archived object
7729 * </p>
7730 * </li>
7731 * <li>
7732 * <p>
7733 * <code>restore an archive</code> - Restore an archived object
7734 * </p>
7735 * </li>
7736 * </ul>
7737 * <p>
7738 * To use this operation, you must have permissions to perform the <code>s3:RestoreObject</code> action. The bucket
7739 * owner has this permission by default and can grant this permission to others. For more information about
7740 * permissions, see <a href=
7741 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"
7742 * >Permissions Related to Bucket Subresource Operations</a> and <a
7743 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html">Managing Access Permissions to Your
7744 * Amazon S3 Resources</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7745 * </p>
7746 * <p>
7747 * <b>Querying Archives with Select Requests</b>
7748 * </p>
7749 * <p>
7750 * You use a select type of request to perform SQL queries on archived objects. The archived objects that are being
7751 * queried by the select request must be formatted as uncompressed comma-separated values (CSV) files. You can run
7752 * queries and custom analytics on your archived data without having to restore your data to a hotter Amazon S3
7753 * tier. For an overview about select requests, see <a
7754 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html">Querying Archived
7755 * Objects</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7756 * </p>
7757 * <p>
7758 * When making a select request, do the following:
7759 * </p>
7760 * <ul>
7761 * <li>
7762 * <p>
7763 * Define an output location for the select query's output. This must be an Amazon S3 bucket in the same AWS Region
7764 * as the bucket that contains the archive object that is being queried. The AWS account that initiates the job must
7765 * have permissions to write to the S3 bucket. You can specify the storage class and encryption for the output
7766 * objects stored in the bucket. For more information about output, see <a
7767 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html">Querying Archived
7768 * Objects</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7769 * </p>
7770 * <p>
7771 * For more information about the <code>S3</code> structure in the request body, see the following:
7772 * </p>
7773 * <ul>
7774 * <li>
7775 * <p>
7776 * <a>PutObject</a>
7777 * </p>
7778 * </li>
7779 * <li>
7780 * <p>
7781 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html">Managing Access with ACLs</a> in
7782 * the <i>Amazon Simple Storage Service Developer Guide</i>
7783 * </p>
7784 * </li>
7785 * <li>
7786 * <p>
7787 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html">Protecting Data Using
7788 * Server-Side Encryption</a> in the <i>Amazon Simple Storage Service Developer Guide</i>
7789 * </p>
7790 * </li>
7791 * </ul>
7792 * </li>
7793 * <li>
7794 * <p>
7795 * Define the SQL expression for the <code>SELECT</code> type of restoration for your query in the request body's
7796 * <code>SelectParameters</code> structure. You can use expressions like the following examples.
7797 * </p>
7798 * <ul>
7799 * <li>
7800 * <p>
7801 * The following expression returns all records from the specified object.
7802 * </p>
7803 * <p>
7804 * <code>SELECT * FROM Object</code>
7805 * </p>
7806 * </li>
7807 * <li>
7808 * <p>
7809 * Assuming that you are not using any headers for data stored in the object, you can specify columns with
7810 * positional headers.
7811 * </p>
7812 * <p>
7813 * <code>SELECT s._1, s._2 FROM Object s WHERE s._3 > 100</code>
7814 * </p>
7815 * </li>
7816 * <li>
7817 * <p>
7818 * If you have headers and you set the <code>fileHeaderInfo</code> in the <code>CSV</code> structure in the request
7819 * body to <code>USE</code>, you can specify headers in the query. (If you set the <code>fileHeaderInfo</code> field
7820 * to <code>IGNORE</code>, the first row is skipped for the query.) You cannot mix ordinal positions with header
7821 * column names.
7822 * </p>
7823 * <p>
7824 * <code>SELECT s.Id, s.FirstName, s.SSN FROM S3Object s</code>
7825 * </p>
7826 * </li>
7827 * </ul>
7828 * </li>
7829 * </ul>
7830 * <p>
7831 * For more information about using SQL with S3 Glacier Select restore, see <a
7832 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html">SQL Reference for
7833 * Amazon S3 Select and S3 Glacier Select</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7834 * </p>
7835 * <p>
7836 * When making a select request, you can also do the following:
7837 * </p>
7838 * <ul>
7839 * <li>
7840 * <p>
7841 * To expedite your queries, specify the <code>Expedited</code> tier. For more information about tiers, see
7842 * "Restoring Archives," later in this topic.
7843 * </p>
7844 * </li>
7845 * <li>
7846 * <p>
7847 * Specify details about the data serialization format of both the input object that is being queried and the
7848 * serialization of the CSV-encoded query results.
7849 * </p>
7850 * </li>
7851 * </ul>
7852 * <p>
7853 * The following are additional important facts about the select feature:
7854 * </p>
7855 * <ul>
7856 * <li>
7857 * <p>
7858 * The output results are new Amazon S3 objects. Unlike archive retrievals, they are stored until explicitly
7859 * deleted-manually or through a lifecycle policy.
7860 * </p>
7861 * </li>
7862 * <li>
7863 * <p>
7864 * You can issue more than one select request on the same Amazon S3 object. Amazon S3 doesn't deduplicate requests,
7865 * so avoid issuing duplicate requests.
7866 * </p>
7867 * </li>
7868 * <li>
7869 * <p>
7870 * Amazon S3 accepts a select request even if the object has already been restored. A select request doesn’t return
7871 * error response <code>409</code>.
7872 * </p>
7873 * </li>
7874 * </ul>
7875 * <p>
7876 * <b>Restoring Archives</b>
7877 * </p>
7878 * <p>
7879 * Objects in the GLACIER and DEEP_ARCHIVE storage classes are archived. To access an archived object, you must
7880 * first initiate a restore request. This restores a temporary copy of the archived object. In a restore request,
7881 * you specify the number of days that you want the restored copy to exist. After the specified period, Amazon S3
7882 * deletes the temporary copy but the object remains archived in the GLACIER or DEEP_ARCHIVE storage class that
7883 * object was restored from.
7884 * </p>
7885 * <p>
7886 * To restore a specific object version, you can provide a version ID. If you don't provide a version ID, Amazon S3
7887 * restores the current version.
7888 * </p>
7889 * <p>
7890 * The time it takes restore jobs to finish depends on which storage class the object is being restored from and
7891 * which data access tier you specify.
7892 * </p>
7893 * <p>
7894 * When restoring an archived object (or using a select request), you can specify one of the following data access
7895 * tier options in the <code>Tier</code> element of the request body:
7896 * </p>
7897 * <ul>
7898 * <li>
7899 * <p>
7900 * <b> <code>Expedited</code> </b> - Expedited retrievals allow you to quickly access your data stored in the
7901 * GLACIER storage class when occasional urgent requests for a subset of archives are required. For all but the
7902 * largest archived objects (250 MB+), data accessed using Expedited retrievals are typically made available within
7903 * 1–5 minutes. Provisioned capacity ensures that retrieval capacity for Expedited retrievals is available when you
7904 * need it. Expedited retrievals and provisioned capacity are not available for the DEEP_ARCHIVE storage class.
7905 * </p>
7906 * </li>
7907 * <li>
7908 * <p>
7909 * <b> <code>Standard</code> </b> - S3 Standard retrievals allow you to access any of your archived objects within
7910 * several hours. This is the default option for the GLACIER and DEEP_ARCHIVE retrieval requests that do not specify
7911 * the retrieval option. S3 Standard retrievals typically complete within 3-5 hours from the GLACIER storage class
7912 * and typically complete within 12 hours from the DEEP_ARCHIVE storage class.
7913 * </p>
7914 * </li>
7915 * <li>
7916 * <p>
7917 * <b> <code>Bulk</code> </b> - Bulk retrievals are Amazon S3 Glacier’s lowest-cost retrieval option, enabling you
7918 * to retrieve large amounts, even petabytes, of data inexpensively in a day. Bulk retrievals typically complete
7919 * within 5-12 hours from the GLACIER storage class and typically complete within 48 hours from the DEEP_ARCHIVE
7920 * storage class.
7921 * </p>
7922 * </li>
7923 * </ul>
7924 * <p>
7925 * For more information about archive retrieval options and provisioned capacity for <code>Expedited</code> data
7926 * access, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html">Restoring Archived
7927 * Objects</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7928 * </p>
7929 * <p>
7930 * You can use Amazon S3 restore speed upgrade to change the restore speed to a faster speed while it is in
7931 * progress. You upgrade the speed of an in-progress restoration by issuing another restore request to the same
7932 * object, setting a new <code>Tier</code> request element. When issuing a request to upgrade the restore tier, you
7933 * must choose a tier that is faster than the tier that the in-progress restore is using. You must not change any
7934 * other parameters, such as the <code>Days</code> request element. For more information, see <a href=
7935 * "https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html"
7936 * > Upgrading the Speed of an In-Progress Restore</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7937 * </p>
7938 * <p>
7939 * To get the status of object restoration, you can send a <code>HEAD</code> request. Operations return the
7940 * <code>x-amz-restore</code> header, which provides information about the restoration status, in the response. You
7941 * can use Amazon S3 event notifications to notify you when a restore is initiated or completed. For more
7942 * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html">Configuring
7943 * Amazon S3 Event Notifications</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
7944 * </p>
7945 * <p>
7946 * After restoring an archived object, you can update the restoration period by reissuing the request with a new
7947 * period. Amazon S3 updates the restoration period relative to the current time and charges only for the
7948 * request-there are no data transfer charges. You cannot update the restoration period when Amazon S3 is actively
7949 * processing your current restore request for the object.
7950 * </p>
7951 * <p>
7952 * If your bucket has a lifecycle configuration with a rule that includes an expiration action, the object
7953 * expiration overrides the life span that you specify in a restore request. For example, if you restore an object
7954 * copy for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the object in 3 days. For
7955 * more information about lifecycle configuration, see <a>PutBucketLifecycleConfiguration</a> and <a
7956 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html">Object Lifecycle Management</a>
7957 * in <i>Amazon Simple Storage Service Developer Guide</i>.
7958 * </p>
7959 * <p>
7960 * <b>Responses</b>
7961 * </p>
7962 * <p>
7963 * A successful operation returns either the <code>200 OK</code> or <code>202 Accepted</code> status code.
7964 * </p>
7965 * <ul>
7966 * <li>
7967 * <p>
7968 * If the object copy is not previously restored, then Amazon S3 returns <code>202 Accepted</code> in the response.
7969 * </p>
7970 * </li>
7971 * <li>
7972 * <p>
7973 * If the object copy is previously restored, Amazon S3 returns <code>200 OK</code> in the response.
7974 * </p>
7975 * </li>
7976 * </ul>
7977 * <p class="title">
7978 * <b>Special Errors</b>
7979 * </p>
7980 * <ul>
7981 * <li>
7982 * <p class="title">
7983 * <b/>
7984 * </p>
7985 * <ul>
7986 * <li>
7987 * <p>
7988 * <i>Code: RestoreAlreadyInProgress</i>
7989 * </p>
7990 * </li>
7991 * <li>
7992 * <p>
7993 * <i>Cause: Object restore is already in progress. (This error does not apply to SELECT type requests.)</i>
7994 * </p>
7995 * </li>
7996 * <li>
7997 * <p>
7998 * <i>HTTP Status Code: 409 Conflict</i>
7999 * </p>
8000 * </li>
8001 * <li>
8002 * <p>
8003 * <i>SOAP Fault Code Prefix: Client</i>
8004 * </p>
8005 * </li>
8006 * </ul>
8007 * </li>
8008 * <li>
8009 * <p class="title">
8010 * <b/>
8011 * </p>
8012 * <ul>
8013 * <li>
8014 * <p>
8015 * <i>Code: GlacierExpeditedRetrievalNotAvailable</i>
8016 * </p>
8017 * </li>
8018 * <li>
8019 * <p>
8020 * <i>Cause: S3 Glacier expedited retrievals are currently not available. Try again later. (Returned if there is
8021 * insufficient capacity to process the Expedited request. This error applies only to Expedited retrievals and not
8022 * to S3 Standard or Bulk retrievals.)</i>
8023 * </p>
8024 * </li>
8025 * <li>
8026 * <p>
8027 * <i>HTTP Status Code: 503</i>
8028 * </p>
8029 * </li>
8030 * <li>
8031 * <p>
8032 * <i>SOAP Fault Code Prefix: N/A</i>
8033 * </p>
8034 * </li>
8035 * </ul>
8036 * </li>
8037 * </ul>
8038 * <p class="title">
8039 * <b>Related Resources</b>
8040 * </p>
8041 * <ul>
8042 * <li>
8043 * <p>
8044 * <a>PutBucketLifecycleConfiguration</a>
8045 * </p>
8046 * </li>
8047 * <li>
8048 * <p>
8049 * <a>GetBucketNotificationConfiguration</a>
8050 * </p>
8051 * </li>
8052 * <li>
8053 * <p>
8054 * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html">SQL Reference for
8055 * Amazon S3 Select and S3 Glacier Select </a> in the <i>Amazon Simple Storage Service Developer Guide</i>
8056 * </p>
8057 * </li>
8058 * </ul>
8059 *
8060 * @param restoreObjectRequest
8061 * @return Result of the RestoreObject operation returned by the service.
8062 * @throws ObjectAlreadyInActiveTierErrorException
8063 * This operation is not allowed against this storage tier.
8064 * @throws SdkException
8065 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
8066 * catch all scenarios.
8067 * @throws SdkClientException
8068 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
8069 * @throws S3Exception
8070 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
8071 * @sample S3Client.RestoreObject
8072 */
8073 @Override
8074 public RestoreObjectResponse restoreObject(RestoreObjectRequest restoreObjectRequest)
8075 throws ObjectAlreadyInActiveTierErrorException, AwsServiceException, SdkClientException, S3Exception {
8076
8077 HttpResponseHandler<Response<RestoreObjectResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
8078 RestoreObjectResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
8079
8080 return clientHandler.execute(new ClientExecutionParams<RestoreObjectRequest, RestoreObjectResponse>()
8081 .withOperationName("RestoreObject").withCombinedResponseHandler(responseHandler).withInput(restoreObjectRequest)
8082 .withMarshaller(new RestoreObjectRequestMarshaller(protocolFactory)));
8083 }
8084
8085 /**
8086 * <p>
8087 * Uploads a part in a multipart upload.
8088 * </p>
8089 * <note>
8090 * <p>
8091 * In this operation, you provide part data in your request. However, you have an option to specify your existing
8092 * Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you
8093 * use the <a>UploadPartCopy</a> operation.
8094 * </p>
8095 * </note>
8096 * <p>
8097 * You must initiate a multipart upload (see <a>CreateMultipartUpload</a>) before you can upload any part. In
8098 * response to your initiate request, Amazon S3 returns an upload ID, a unique identifier, that you must include in
8099 * your upload part request.
8100 * </p>
8101 * <p>
8102 * Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also
8103 * defines its position within the object being created. If you upload a new part using the same part number that
8104 * was used with a previous part, the previously uploaded part is overwritten. Each part must be at least 5 MB in
8105 * size, except the last part. There is no size limit on the last part of your multipart upload.
8106 * </p>
8107 * <p>
8108 * To ensure that data is not corrupted when traversing the network, specify the <code>Content-MD5</code> header in
8109 * the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match,
8110 * Amazon S3 returns an error.
8111 * </p>
8112 * <p>
8113 * <b>Note:</b> After you initiate multipart upload and upload one or more parts, you must either complete or abort
8114 * multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either
8115 * complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts
8116 * storage.
8117 * </p>
8118 * <p>
8119 * For more information on multipart uploads, go to <a
8120 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html">Multipart Upload Overview</a> in the
8121 * <i>Amazon Simple Storage Service Developer Guide </i>.
8122 * </p>
8123 * <p>
8124 * For information on the permissions required to use the multipart upload API, go to <a
8125 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
8126 * Permissions</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
8127 * </p>
8128 * <p>
8129 * You can optionally request server-side encryption where Amazon S3 encrypts your data as it writes it to disks in
8130 * its data centers and decrypts it for you when you access it. You have the option of providing your own encryption
8131 * key, or you can use the AWS managed encryption keys. If you choose to provide your own encryption key, the
8132 * request headers you provide in the request must match the headers you used in the request to initiate the upload
8133 * by using <a>CreateMultipartUpload</a>. For more information, go to <a
8134 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">Using Server-Side
8135 * Encryption</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
8136 * </p>
8137 * <p>
8138 * Server-side encryption is supported by the S3 Multipart Upload actions. Unless you are using a customer-provided
8139 * encryption key, you don't need to specify the encryption parameters in each UploadPart request. Instead, you only
8140 * need to specify the server-side encryption parameters in the initial Initiate Multipart request. For more
8141 * information, see <a>CreateMultipartUpload</a>.
8142 * </p>
8143 * <p>
8144 * If you requested server-side encryption using a customer-provided encryption key in your initiate multipart
8145 * upload request, you must provide identical encryption information in each part upload using the following
8146 * headers.
8147 * </p>
8148 * <ul>
8149 * <li>
8150 * <p>
8151 * x-amz-server-side-encryption-customer-algorithm
8152 * </p>
8153 * </li>
8154 * <li>
8155 * <p>
8156 * x-amz-server-side-encryption-customer-key
8157 * </p>
8158 * </li>
8159 * <li>
8160 * <p>
8161 * x-amz-server-side-encryption-customer-key-MD5
8162 * </p>
8163 * </li>
8164 * </ul>
8165 * <p class="title">
8166 * <b>Special Errors</b>
8167 * </p>
8168 * <ul>
8169 * <li>
8170 * <p class="title">
8171 * <b/>
8172 * </p>
8173 * <ul>
8174 * <li>
8175 * <p>
8176 * <i>Code: NoSuchUpload</i>
8177 * </p>
8178 * </li>
8179 * <li>
8180 * <p>
8181 * <i>Cause: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload
8182 * might have been aborted or completed.</i>
8183 * </p>
8184 * </li>
8185 * <li>
8186 * <p>
8187 * <i> HTTP Status Code: 404 Not Found </i>
8188 * </p>
8189 * </li>
8190 * <li>
8191 * <p>
8192 * <i>SOAP Fault Code Prefix: Client</i>
8193 * </p>
8194 * </li>
8195 * </ul>
8196 * </li>
8197 * </ul>
8198 * <p class="title">
8199 * <b>Related Resources</b>
8200 * </p>
8201 * <ul>
8202 * <li>
8203 * <p>
8204 * <a>CreateMultipartUpload</a>
8205 * </p>
8206 * </li>
8207 * <li>
8208 * <p>
8209 * <a>CompleteMultipartUpload</a>
8210 * </p>
8211 * </li>
8212 * <li>
8213 * <p>
8214 * <a>AbortMultipartUpload</a>
8215 * </p>
8216 * </li>
8217 * <li>
8218 * <p>
8219 * <a>ListParts</a>
8220 * </p>
8221 * </li>
8222 * <li>
8223 * <p>
8224 * <a>ListMultipartUploads</a>
8225 * </p>
8226 * </li>
8227 * </ul>
8228 *
8229 * @param uploadPartRequest
8230 * @param requestBody
8231 * The content to send to the service. A {@link RequestBody} can be created using one of several factory
8232 * methods for various sources of data. For example, to create a request body from a file you can do the
8233 * following.
8234 *
8235 * <pre>
8236 * {@code RequestBody.fromFile(new File("myfile.txt"))}
8237 * </pre>
8238 *
8239 * See documentation in {@link RequestBody} for additional details and which sources of data are supported.
8240 * The service documentation for the request content is as follows '
8241 * <p>
8242 * Object data.
8243 * </p>
8244 * '
8245 * @return Result of the UploadPart operation returned by the service.
8246 * @throws SdkException
8247 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
8248 * catch all scenarios.
8249 * @throws SdkClientException
8250 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
8251 * @throws S3Exception
8252 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
8253 * @sample S3Client.UploadPart
8254 */
8255 @Override
8256 public UploadPartResponse uploadPart(UploadPartRequest uploadPartRequest, RequestBody requestBody)
8257 throws AwsServiceException, SdkClientException, S3Exception {
8258
8259 HttpResponseHandler<Response<UploadPartResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
8260 UploadPartResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
8261
8262 return clientHandler.execute(new ClientExecutionParams<UploadPartRequest, UploadPartResponse>()
8263 .withOperationName("UploadPart")
8264 .withCombinedResponseHandler(responseHandler)
8265 .withInput(uploadPartRequest)
8266 .withRequestBody(requestBody)
8267 .withMarshaller(
8268 StreamingRequestMarshaller.builder().delegateMarshaller(new UploadPartRequestMarshaller(protocolFactory))
8269 .requestBody(requestBody).build()));
8270 }
8271
8272 /**
8273 * <p>
8274 * Uploads a part by copying data from an existing object as data source. You specify the data source by adding the
8275 * request header <code>x-amz-copy-source</code> in your request and a byte range by adding the request header
8276 * <code>x-amz-copy-source-range</code> in your request.
8277 * </p>
8278 * <p>
8279 * The minimum allowable part size for a multipart upload is 5 MB. For more information about multipart upload
8280 * limits, go to <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html">Quick Facts</a> in the
8281 * <i>Amazon Simple Storage Service Developer Guide</i>.
8282 * </p>
8283 * <note>
8284 * <p>
8285 * Instead of using an existing object as part data, you might use the <a>UploadPart</a> operation and provide data
8286 * in your request.
8287 * </p>
8288 * </note>
8289 * <p>
8290 * You must initiate a multipart upload before you can upload any part. In response to your initiate request. Amazon
8291 * S3 returns a unique identifier, the upload ID, that you must include in your upload part request.
8292 * </p>
8293 * <p>
8294 * For more information about using the <code>UploadPartCopy</code> operation, see the following:
8295 * </p>
8296 * <ul>
8297 * <li>
8298 * <p>
8299 * For conceptual information about multipart uploads, see <a
8300 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart
8301 * Upload</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
8302 * </p>
8303 * </li>
8304 * <li>
8305 * <p>
8306 * For information about permissions required to use the multipart upload API, see <a
8307 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload API and
8308 * Permissions</a> in the <i>Amazon Simple Storage Service Developer Guide</i>.
8309 * </p>
8310 * </li>
8311 * <li>
8312 * <p>
8313 * For information about copying objects using a single atomic operation vs. the multipart upload, see <a
8314 * href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html">Operations on Objects</a> in the
8315 * <i>Amazon Simple Storage Service Developer Guide</i>.
8316 * </p>
8317 * </li>
8318 * <li>
8319 * <p>
8320 * For information about using server-side encryption with customer-provided encryption keys with the UploadPartCopy
8321 * operation, see <a>CopyObject</a> and <a>UploadPart</a>.
8322 * </p>
8323 * </li>
8324 * </ul>
8325 * <p>
8326 * Note the following additional considerations about the request headers <code>x-amz-copy-source-if-match</code>,
8327 * <code>x-amz-copy-source-if-none-match</code>, <code>x-amz-copy-source-if-unmodified-since</code>, and
8328 * <code>x-amz-copy-source-if-modified-since</code>:
8329 * </p>
8330 * <p>
8331 * </p>
8332 * <ul>
8333 * <li>
8334 * <p>
8335 * <b>Consideration 1</b> - If both of the <code>x-amz-copy-source-if-match</code> and
8336 * <code>x-amz-copy-source-if-unmodified-since</code> headers are present in the request as follows:
8337 * </p>
8338 * <p>
8339 * <code>x-amz-copy-source-if-match</code> condition evaluates to <code>true</code>, and;
8340 * </p>
8341 * <p>
8342 * <code>x-amz-copy-source-if-unmodified-since</code> condition evaluates to <code>false</code>;
8343 * </p>
8344 * <p>
8345 * Amazon S3 returns <code>200 OK</code> and copies the data.
8346 * </p>
8347 * </li>
8348 * <li>
8349 * <p>
8350 * <b>Consideration 2</b> - If both of the <code>x-amz-copy-source-if-none-match</code> and
8351 * <code>x-amz-copy-source-if-modified-since</code> headers are present in the request as follows:
8352 * </p>
8353 * <p>
8354 * <code>x-amz-copy-source-if-none-match</code> condition evaluates to <code>false</code>, and;
8355 * </p>
8356 * <p>
8357 * <code>x-amz-copy-source-if-modified-since</code> condition evaluates to <code>true</code>;
8358 * </p>
8359 * <p>
8360 * Amazon S3 returns <code>412 Precondition Failed</code> response code.
8361 * </p>
8362 * </li>
8363 * </ul>
8364 * <p>
8365 * <b>Versioning</b>
8366 * </p>
8367 * <p>
8368 * If your bucket has versioning enabled, you could have multiple versions of the same object. By default,
8369 * <code>x-amz-copy-source</code> identifies the current version of the object to copy. If the current version is a
8370 * delete marker and you don't specify a versionId in the <code>x-amz-copy-source</code>, Amazon S3 returns a 404
8371 * error, because the object does not exist. If you specify versionId in the <code>x-amz-copy-source</code> and the
8372 * versionId is a delete marker, Amazon S3 returns an HTTP 400 error, because you are not allowed to specify a
8373 * delete marker as a version for the <code>x-amz-copy-source</code>.
8374 * </p>
8375 * <p>
8376 * You can optionally specify a specific version of the source object to copy by adding the <code>versionId</code>
8377 * subresource as shown in the following example:
8378 * </p>
8379 * <p>
8380 * <code>x-amz-copy-source: /bucket/object?versionId=version id</code>
8381 * </p>
8382 * <p class="title">
8383 * <b>Special Errors</b>
8384 * </p>
8385 * <ul>
8386 * <li>
8387 * <p class="title">
8388 * <b/>
8389 * </p>
8390 * <ul>
8391 * <li>
8392 * <p>
8393 * <i>Code: NoSuchUpload</i>
8394 * </p>
8395 * </li>
8396 * <li>
8397 * <p>
8398 * <i>Cause: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload
8399 * might have been aborted or completed.</i>
8400 * </p>
8401 * </li>
8402 * <li>
8403 * <p>
8404 * <i>HTTP Status Code: 404 Not Found</i>
8405 * </p>
8406 * </li>
8407 * </ul>
8408 * </li>
8409 * <li>
8410 * <p class="title">
8411 * <b/>
8412 * </p>
8413 * <ul>
8414 * <li>
8415 * <p>
8416 * <i>Code: InvalidRequest</i>
8417 * </p>
8418 * </li>
8419 * <li>
8420 * <p>
8421 * <i>Cause: The specified copy source is not supported as a byte-range copy source.</i>
8422 * </p>
8423 * </li>
8424 * <li>
8425 * <p>
8426 * <i>HTTP Status Code: 400 Bad Request</i>
8427 * </p>
8428 * </li>
8429 * </ul>
8430 * </li>
8431 * </ul>
8432 * <p class="title">
8433 * <b>Related Resources</b>
8434 * </p>
8435 * <ul>
8436 * <li>
8437 * <p>
8438 * <a>CreateMultipartUpload</a>
8439 * </p>
8440 * </li>
8441 * <li>
8442 * <p>
8443 * <a>UploadPart</a>
8444 * </p>
8445 * </li>
8446 * <li>
8447 * <p>
8448 * <a>CompleteMultipartUpload</a>
8449 * </p>
8450 * </li>
8451 * <li>
8452 * <p>
8453 * <a>AbortMultipartUpload</a>
8454 * </p>
8455 * </li>
8456 * <li>
8457 * <p>
8458 * <a>ListParts</a>
8459 * </p>
8460 * </li>
8461 * <li>
8462 * <p>
8463 * <a>ListMultipartUploads</a>
8464 * </p>
8465 * </li>
8466 * </ul>
8467 *
8468 * @param uploadPartCopyRequest
8469 * @return Result of the UploadPartCopy operation returned by the service.
8470 * @throws SdkException
8471 * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
8472 * catch all scenarios.
8473 * @throws SdkClientException
8474 * If any client side error occurs such as an IO related failure, failure to get credentials, etc.
8475 * @throws S3Exception
8476 * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
8477 * @sample S3Client.UploadPartCopy
8478 */
8479 @Override
8480 public UploadPartCopyResponse uploadPartCopy(UploadPartCopyRequest uploadPartCopyRequest) throws AwsServiceException,
8481 SdkClientException, S3Exception {
8482
8483 HttpResponseHandler<Response<UploadPartCopyResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(
8484 UploadPartCopyResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
8485
8486 return clientHandler.execute(new ClientExecutionParams<UploadPartCopyRequest, UploadPartCopyResponse>()
8487 .withOperationName("UploadPartCopy").withCombinedResponseHandler(responseHandler)
8488 .withInput(uploadPartCopyRequest).withMarshaller(new UploadPartCopyRequestMarshaller(protocolFactory)));
8489 }
8490
8491 private AwsS3ProtocolFactory init() {
8492 return AwsS3ProtocolFactory
8493 .builder()
8494 .registerModeledException(
8495 ExceptionMetadata.builder().errorCode("NoSuchUpload")
8496 .exceptionBuilderSupplier(NoSuchUploadException::builder).build())
8497 .registerModeledException(
8498 ExceptionMetadata.builder().errorCode("ObjectAlreadyInActiveTierError")
8499 .exceptionBuilderSupplier(ObjectAlreadyInActiveTierErrorException::builder).build())
8500 .registerModeledException(
8501 ExceptionMetadata.builder().errorCode("BucketAlreadyExists")
8502 .exceptionBuilderSupplier(BucketAlreadyExistsException::builder).build())
8503 .registerModeledException(
8504 ExceptionMetadata.builder().errorCode("NoSuchBucket")
8505 .exceptionBuilderSupplier(NoSuchBucketException::builder).build())
8506 .registerModeledException(
8507 ExceptionMetadata.builder().errorCode("ObjectNotInActiveTierError")
8508 .exceptionBuilderSupplier(ObjectNotInActiveTierErrorException::builder).build())
8509 .registerModeledException(
8510 ExceptionMetadata.builder().errorCode("BucketAlreadyOwnedByYou")
8511 .exceptionBuilderSupplier(BucketAlreadyOwnedByYouException::builder).build())
8512 .registerModeledException(
8513 ExceptionMetadata.builder().errorCode("NoSuchKey").exceptionBuilderSupplier(NoSuchKeyException::builder)
8514 .build()).clientConfiguration(clientConfiguration)
8515 .defaultServiceExceptionSupplier(S3Exception::builder).build();
8516 }
8517
8518 @Override
8519 public void close() {
8520 clientHandler.close();
8521 }
8522
8523 private <T extends S3Request> T applyPaginatorUserAgent(T request) {
8524 Consumer<AwsRequestOverrideConfiguration.Builder> userAgentApplier = b -> b.addApiName(ApiName.builder()
8525 .version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
8526 AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
8527 .map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
8528 .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
8529 return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
8530 }
8531
8532 @Override
8533 public S3Utilities utilities() {
8534 return S3Utilities.create(clientConfiguration);
8535 }
8536 }
8537