aws-sdk-s3 1.48.0 → 1.169.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1270 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
- data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
- data/lib/aws-sdk-s3/bucket.rb +959 -106
- data/lib/aws-sdk-s3/bucket_acl.rb +64 -18
- data/lib/aws-sdk-s3/bucket_cors.rb +79 -18
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +66 -20
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +106 -21
- data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
- data/lib/aws-sdk-s3/bucket_notification.rb +52 -20
- data/lib/aws-sdk-s3/bucket_policy.rb +107 -17
- data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
- data/lib/aws-sdk-s3/bucket_tagging.rb +71 -18
- data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
- data/lib/aws-sdk-s3/bucket_website.rb +78 -21
- data/lib/aws-sdk-s3/client.rb +13765 -1019
- data/lib/aws-sdk-s3/client_api.rb +1137 -197
- data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
- data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +288 -68
- data/lib/aws-sdk-s3/customizations/object_summary.rb +10 -0
- data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
- data/lib/aws-sdk-s3/customizations.rb +27 -28
- data/lib/aws-sdk-s3/encryption/client.rb +28 -7
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
- data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
- data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
- data/lib/aws-sdk-s3/encryption.rb +4 -0
- data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
- data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
- data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +592 -0
- data/lib/aws-sdk-s3/endpoints.rb +1392 -0
- data/lib/aws-sdk-s3/errors.rb +126 -1
- data/lib/aws-sdk-s3/event_streams.rb +8 -1
- data/lib/aws-sdk-s3/express_credentials.rb +55 -0
- data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
- data/lib/aws-sdk-s3/file_downloader.rb +176 -44
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +39 -18
- data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +82 -23
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +61 -21
- data/lib/aws-sdk-s3/multipart_upload.rb +265 -32
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +367 -45
- data/lib/aws-sdk-s3/object.rb +2475 -228
- data/lib/aws-sdk-s3/object_acl.rb +103 -25
- data/lib/aws-sdk-s3/object_copier.rb +9 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -22
- data/lib/aws-sdk-s3/object_summary.rb +2075 -203
- data/lib/aws-sdk-s3/object_version.rb +492 -80
- data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
- data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
- data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
- data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
- data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +60 -15
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +35 -30
- data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +63 -94
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +160 -99
- data/lib/aws-sdk-s3/presigner.rb +138 -59
- data/lib/aws-sdk-s3/resource.rb +155 -17
- data/lib/aws-sdk-s3/types.rb +12229 -4377
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +46 -32
- data/sig/bucket.rbs +216 -0
- data/sig/bucket_acl.rbs +78 -0
- data/sig/bucket_cors.rbs +69 -0
- data/sig/bucket_lifecycle.rbs +88 -0
- data/sig/bucket_lifecycle_configuration.rbs +115 -0
- data/sig/bucket_logging.rbs +76 -0
- data/sig/bucket_notification.rbs +114 -0
- data/sig/bucket_policy.rbs +59 -0
- data/sig/bucket_request_payment.rbs +54 -0
- data/sig/bucket_tagging.rbs +65 -0
- data/sig/bucket_versioning.rbs +77 -0
- data/sig/bucket_website.rbs +93 -0
- data/sig/client.rbs +2406 -0
- data/sig/customizations/bucket.rbs +19 -0
- data/sig/customizations/object.rbs +38 -0
- data/sig/customizations/object_summary.rbs +35 -0
- data/sig/errors.rbs +34 -0
- data/sig/multipart_upload.rbs +111 -0
- data/sig/multipart_upload_part.rbs +105 -0
- data/sig/object.rbs +443 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +335 -0
- data/sig/object_version.rbs +137 -0
- data/sig/resource.rbs +132 -0
- data/sig/types.rbs +2596 -0
- data/sig/waiters.rbs +95 -0
- metadata +74 -15
@@ -1,11 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::S3
|
11
|
+
|
9
12
|
class MultipartUploadPart
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -30,6 +33,7 @@ module Aws::S3
|
|
30
33
|
@part_number = extract_part_number(args, options)
|
31
34
|
@data = options.delete(:data)
|
32
35
|
@client = options.delete(:client) || Client.new(options)
|
36
|
+
@waiter_block_warned = false
|
33
37
|
end
|
34
38
|
|
35
39
|
# @!group Read-Only Attributes
|
@@ -72,6 +76,68 @@ module Aws::S3
|
|
72
76
|
data[:size]
|
73
77
|
end
|
74
78
|
|
79
|
+
# This header can be used as a data integrity check to verify that the
|
80
|
+
# data received is the same data that was originally sent. This header
|
81
|
+
# specifies the base64-encoded, 32-bit CRC-32 checksum of the object.
|
82
|
+
# For more information, see [Checking object integrity][1] in the
|
83
|
+
# *Amazon S3 User Guide*.
|
84
|
+
#
|
85
|
+
#
|
86
|
+
#
|
87
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
88
|
+
# @return [String]
|
89
|
+
def checksum_crc32
|
90
|
+
data[:checksum_crc32]
|
91
|
+
end
|
92
|
+
|
93
|
+
# The base64-encoded, 32-bit CRC-32C checksum of the object. This will
|
94
|
+
# only be present if it was uploaded with the object. When you use an
|
95
|
+
# API operation on an object that was uploaded using multipart uploads,
|
96
|
+
# this value may not be a direct checksum value of the full object.
|
97
|
+
# Instead, it's a calculation based on the checksum values of each
|
98
|
+
# individual part. For more information about how checksums are
|
99
|
+
# calculated with multipart uploads, see [ Checking object integrity][1]
|
100
|
+
# in the *Amazon S3 User Guide*.
|
101
|
+
#
|
102
|
+
#
|
103
|
+
#
|
104
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
105
|
+
# @return [String]
|
106
|
+
def checksum_crc32c
|
107
|
+
data[:checksum_crc32c]
|
108
|
+
end
|
109
|
+
|
110
|
+
# The base64-encoded, 160-bit SHA-1 digest of the object. This will only
|
111
|
+
# be present if it was uploaded with the object. When you use the API
|
112
|
+
# operation on an object that was uploaded using multipart uploads, this
|
113
|
+
# value may not be a direct checksum value of the full object. Instead,
|
114
|
+
# it's a calculation based on the checksum values of each individual
|
115
|
+
# part. For more information about how checksums are calculated with
|
116
|
+
# multipart uploads, see [ Checking object integrity][1] in the *Amazon
|
117
|
+
# S3 User Guide*.
|
118
|
+
#
|
119
|
+
#
|
120
|
+
#
|
121
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
122
|
+
# @return [String]
|
123
|
+
def checksum_sha1
|
124
|
+
data[:checksum_sha1]
|
125
|
+
end
|
126
|
+
|
127
|
+
# This header can be used as a data integrity check to verify that the
|
128
|
+
# data received is the same data that was originally sent. This header
|
129
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
130
|
+
# For more information, see [Checking object integrity][1] in the
|
131
|
+
# *Amazon S3 User Guide*.
|
132
|
+
#
|
133
|
+
#
|
134
|
+
#
|
135
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
136
|
+
# @return [String]
|
137
|
+
def checksum_sha256
|
138
|
+
data[:checksum_sha256]
|
139
|
+
end
|
140
|
+
|
75
141
|
# @!endgroup
|
76
142
|
|
77
143
|
# @return [Client]
|
@@ -107,7 +173,8 @@ module Aws::S3
|
|
107
173
|
# Waiter polls an API operation until a resource enters a desired
|
108
174
|
# state.
|
109
175
|
#
|
110
|
-
# @note The waiting operation is performed on a copy. The original resource
|
176
|
+
# @note The waiting operation is performed on a copy. The original resource
|
177
|
+
# remains unchanged.
|
111
178
|
#
|
112
179
|
# ## Basic Usage
|
113
180
|
#
|
@@ -120,13 +187,15 @@ module Aws::S3
|
|
120
187
|
#
|
121
188
|
# ## Example
|
122
189
|
#
|
123
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
190
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
191
|
+
# instance.state.name == 'running'
|
192
|
+
# end
|
124
193
|
#
|
125
194
|
# ## Configuration
|
126
195
|
#
|
127
196
|
# You can configure the maximum number of polling attempts, and the
|
128
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
129
|
-
# by passing a block to {#wait_until}:
|
197
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
198
|
+
# set by passing a block to {#wait_until}:
|
130
199
|
#
|
131
200
|
# # poll for ~25 seconds
|
132
201
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -157,17 +226,16 @@ module Aws::S3
|
|
157
226
|
# # resource did not enter the desired state in time
|
158
227
|
# end
|
159
228
|
#
|
229
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
160
230
|
#
|
161
|
-
# @
|
162
|
-
#
|
163
|
-
#
|
164
|
-
# because the waiter has entered a state that it will not transition
|
165
|
-
# out of, preventing success.
|
231
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
232
|
+
# terminates because the waiter has entered a state that it will not
|
233
|
+
# transition out of, preventing success.
|
166
234
|
#
|
167
235
|
# yet successful.
|
168
236
|
#
|
169
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
170
|
-
# while polling for a resource that is not expected.
|
237
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
238
|
+
# encountered while polling for a resource that is not expected.
|
171
239
|
#
|
172
240
|
# @raise [NotImplementedError] Raised when the resource does not
|
173
241
|
#
|
@@ -194,7 +262,9 @@ module Aws::S3
|
|
194
262
|
:retry
|
195
263
|
end
|
196
264
|
end
|
197
|
-
Aws::
|
265
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
266
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
267
|
+
end
|
198
268
|
end
|
199
269
|
|
200
270
|
# @!group Actions
|
@@ -215,59 +285,213 @@ module Aws::S3
|
|
215
285
|
# copy_source_sse_customer_key: "CopySourceSSECustomerKey",
|
216
286
|
# copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
|
217
287
|
# request_payer: "requester", # accepts requester
|
288
|
+
# expected_bucket_owner: "AccountId",
|
289
|
+
# expected_source_bucket_owner: "AccountId",
|
218
290
|
# })
|
219
291
|
# @param [Hash] options ({})
|
220
292
|
# @option options [required, String] :copy_source
|
221
|
-
#
|
222
|
-
#
|
293
|
+
# Specifies the source object for the copy operation. You specify the
|
294
|
+
# value in one of two formats, depending on whether you want to access
|
295
|
+
# the source object through an [access point][1]:
|
296
|
+
#
|
297
|
+
# * For objects not accessed through an access point, specify the name
|
298
|
+
# of the source bucket and key of the source object, separated by a
|
299
|
+
# slash (/). For example, to copy the object `reports/january.pdf`
|
300
|
+
# from the bucket `awsexamplebucket`, use
|
301
|
+
# `awsexamplebucket/reports/january.pdf`. The value must be
|
302
|
+
# URL-encoded.
|
303
|
+
#
|
304
|
+
# * For objects accessed through access points, specify the Amazon
|
305
|
+
# Resource Name (ARN) of the object as accessed through the access
|
306
|
+
# point, in the format
|
307
|
+
# `arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>`.
|
308
|
+
# For example, to copy the object `reports/january.pdf` through access
|
309
|
+
# point `my-access-point` owned by account `123456789012` in Region
|
310
|
+
# `us-west-2`, use the URL encoding of
|
311
|
+
# `arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf`.
|
312
|
+
# The value must be URL encoded.
|
313
|
+
#
|
314
|
+
# <note markdown="1"> * Amazon S3 supports copy operations using Access points only when
|
315
|
+
# the source and destination buckets are in the same Amazon Web
|
316
|
+
# Services Region.
|
317
|
+
#
|
318
|
+
# * Access points are not supported by directory buckets.
|
319
|
+
#
|
320
|
+
# </note>
|
321
|
+
#
|
322
|
+
# Alternatively, for objects accessed through Amazon S3 on Outposts,
|
323
|
+
# specify the ARN of the object as accessed in the format
|
324
|
+
# `arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>`.
|
325
|
+
# For example, to copy the object `reports/january.pdf` through
|
326
|
+
# outpost `my-outpost` owned by account `123456789012` in Region
|
327
|
+
# `us-west-2`, use the URL encoding of
|
328
|
+
# `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf`.
|
329
|
+
# The value must be URL-encoded.
|
330
|
+
#
|
331
|
+
# If your bucket has versioning enabled, you could have multiple
|
332
|
+
# versions of the same object. By default, `x-amz-copy-source`
|
333
|
+
# identifies the current version of the source object to copy. To copy a
|
334
|
+
# specific version of the source object to copy, append
|
335
|
+
# `?versionId=<version-id>` to the `x-amz-copy-source` request header
|
336
|
+
# (for example, `x-amz-copy-source:
|
337
|
+
# /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893`).
|
338
|
+
#
|
339
|
+
# If the current version is a delete marker and you don't specify a
|
340
|
+
# versionId in the `x-amz-copy-source` request header, Amazon S3 returns
|
341
|
+
# a `404 Not Found` error, because the object does not exist. If you
|
342
|
+
# specify versionId in the `x-amz-copy-source` and the versionId is a
|
343
|
+
# delete marker, Amazon S3 returns an HTTP `400 Bad Request` error,
|
344
|
+
# because you are not allowed to specify a delete marker as a version
|
345
|
+
# for the `x-amz-copy-source`.
|
346
|
+
#
|
347
|
+
# <note markdown="1"> **Directory buckets** - S3 Versioning isn't enabled and supported for
|
348
|
+
# directory buckets.
|
349
|
+
#
|
350
|
+
# </note>
|
351
|
+
#
|
352
|
+
#
|
353
|
+
#
|
354
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html
|
223
355
|
# @option options [String] :copy_source_if_match
|
224
356
|
# Copies the object if its entity tag (ETag) matches the specified tag.
|
357
|
+
#
|
358
|
+
# If both of the `x-amz-copy-source-if-match` and
|
359
|
+
# `x-amz-copy-source-if-unmodified-since` headers are present in the
|
360
|
+
# request as follows:
|
361
|
+
#
|
362
|
+
# `x-amz-copy-source-if-match` condition evaluates to `true`, and;
|
363
|
+
#
|
364
|
+
# `x-amz-copy-source-if-unmodified-since` condition evaluates to
|
365
|
+
# `false`;
|
366
|
+
#
|
367
|
+
# Amazon S3 returns `200 OK` and copies the data.
|
225
368
|
# @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
|
226
369
|
# Copies the object if it has been modified since the specified time.
|
370
|
+
#
|
371
|
+
# If both of the `x-amz-copy-source-if-none-match` and
|
372
|
+
# `x-amz-copy-source-if-modified-since` headers are present in the
|
373
|
+
# request as follows:
|
374
|
+
#
|
375
|
+
# `x-amz-copy-source-if-none-match` condition evaluates to `false`, and;
|
376
|
+
#
|
377
|
+
# `x-amz-copy-source-if-modified-since` condition evaluates to `true`;
|
378
|
+
#
|
379
|
+
# Amazon S3 returns `412 Precondition Failed` response code.
|
227
380
|
# @option options [String] :copy_source_if_none_match
|
228
381
|
# Copies the object if its entity tag (ETag) is different than the
|
229
382
|
# specified ETag.
|
383
|
+
#
|
384
|
+
# If both of the `x-amz-copy-source-if-none-match` and
|
385
|
+
# `x-amz-copy-source-if-modified-since` headers are present in the
|
386
|
+
# request as follows:
|
387
|
+
#
|
388
|
+
# `x-amz-copy-source-if-none-match` condition evaluates to `false`, and;
|
389
|
+
#
|
390
|
+
# `x-amz-copy-source-if-modified-since` condition evaluates to `true`;
|
391
|
+
#
|
392
|
+
# Amazon S3 returns `412 Precondition Failed` response code.
|
230
393
|
# @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since
|
231
394
|
# Copies the object if it hasn't been modified since the specified
|
232
395
|
# time.
|
396
|
+
#
|
397
|
+
# If both of the `x-amz-copy-source-if-match` and
|
398
|
+
# `x-amz-copy-source-if-unmodified-since` headers are present in the
|
399
|
+
# request as follows:
|
400
|
+
#
|
401
|
+
# `x-amz-copy-source-if-match` condition evaluates to `true`, and;
|
402
|
+
#
|
403
|
+
# `x-amz-copy-source-if-unmodified-since` condition evaluates to
|
404
|
+
# `false`;
|
405
|
+
#
|
406
|
+
# Amazon S3 returns `200 OK` and copies the data.
|
233
407
|
# @option options [String] :copy_source_range
|
234
408
|
# The range of bytes to copy from the source object. The range value
|
235
409
|
# must use the form bytes=first-last, where the first and last are the
|
236
410
|
# zero-based byte offsets to copy. For example, bytes=0-9 indicates that
|
237
|
-
# you want to copy the first
|
411
|
+
# you want to copy the first 10 bytes of the source. You can copy a
|
238
412
|
# range only if the source object is greater than 5 MB.
|
239
413
|
# @option options [String] :sse_customer_algorithm
|
240
|
-
# Specifies the algorithm to use
|
241
|
-
# AES256).
|
414
|
+
# Specifies the algorithm to use when encrypting the object (for
|
415
|
+
# example, AES256).
|
416
|
+
#
|
417
|
+
# <note markdown="1"> This functionality is not supported when the destination bucket is a
|
418
|
+
# directory bucket.
|
419
|
+
#
|
420
|
+
# </note>
|
242
421
|
# @option options [String] :sse_customer_key
|
243
422
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
244
423
|
# encrypting data. This value is used to store the object and then it is
|
245
|
-
# discarded; Amazon does not store the encryption key. The key must
|
246
|
-
# appropriate for use with the algorithm specified in the
|
247
|
-
# x-amz-server-side
|
424
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
425
|
+
# be appropriate for use with the algorithm specified in the
|
426
|
+
# `x-amz-server-side-encryption-customer-algorithm` header. This must be
|
248
427
|
# the same encryption key specified in the initiate multipart upload
|
249
428
|
# request.
|
429
|
+
#
|
430
|
+
# <note markdown="1"> This functionality is not supported when the destination bucket is a
|
431
|
+
# directory bucket.
|
432
|
+
#
|
433
|
+
# </note>
|
250
434
|
# @option options [String] :sse_customer_key_md5
|
251
435
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
252
436
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
253
|
-
# ensure the encryption key was transmitted without error.
|
437
|
+
# ensure that the encryption key was transmitted without error.
|
438
|
+
#
|
439
|
+
# <note markdown="1"> This functionality is not supported when the destination bucket is a
|
440
|
+
# directory bucket.
|
441
|
+
#
|
442
|
+
# </note>
|
254
443
|
# @option options [String] :copy_source_sse_customer_algorithm
|
255
|
-
# Specifies the algorithm to use when decrypting the source object
|
256
|
-
#
|
444
|
+
# Specifies the algorithm to use when decrypting the source object (for
|
445
|
+
# example, `AES256`).
|
446
|
+
#
|
447
|
+
# <note markdown="1"> This functionality is not supported when the source object is in a
|
448
|
+
# directory bucket.
|
449
|
+
#
|
450
|
+
# </note>
|
257
451
|
# @option options [String] :copy_source_sse_customer_key
|
258
452
|
# Specifies the customer-provided encryption key for Amazon S3 to use to
|
259
453
|
# decrypt the source object. The encryption key provided in this header
|
260
454
|
# must be one that was used when the source object was created.
|
455
|
+
#
|
456
|
+
# <note markdown="1"> This functionality is not supported when the source object is in a
|
457
|
+
# directory bucket.
|
458
|
+
#
|
459
|
+
# </note>
|
261
460
|
# @option options [String] :copy_source_sse_customer_key_md5
|
262
461
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
263
462
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
264
|
-
# ensure the encryption key was transmitted without error.
|
463
|
+
# ensure that the encryption key was transmitted without error.
|
464
|
+
#
|
465
|
+
# <note markdown="1"> This functionality is not supported when the source object is in a
|
466
|
+
# directory bucket.
|
467
|
+
#
|
468
|
+
# </note>
|
265
469
|
# @option options [String] :request_payer
|
266
|
-
# Confirms that the requester knows that
|
267
|
-
#
|
268
|
-
# requests.
|
269
|
-
#
|
270
|
-
#
|
470
|
+
# Confirms that the requester knows that they will be charged for the
|
471
|
+
# request. Bucket owners need not specify this parameter in their
|
472
|
+
# requests. If either the source or destination S3 bucket has Requester
|
473
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
474
|
+
# the object. For information about downloading objects from Requester
|
475
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
476
|
+
# in the *Amazon S3 User Guide*.
|
477
|
+
#
|
478
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
479
|
+
#
|
480
|
+
# </note>
|
481
|
+
#
|
482
|
+
#
|
483
|
+
#
|
484
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
485
|
+
# @option options [String] :expected_bucket_owner
|
486
|
+
# The account ID of the expected destination bucket owner. If the
|
487
|
+
# account ID that you provide does not match the actual owner of the
|
488
|
+
# destination bucket, the request fails with the HTTP status code `403
|
489
|
+
# Forbidden` (access denied).
|
490
|
+
# @option options [String] :expected_source_bucket_owner
|
491
|
+
# The account ID of the expected source bucket owner. If the account ID
|
492
|
+
# that you provide does not match the actual owner of the source bucket,
|
493
|
+
# the request fails with the HTTP status code `403 Forbidden` (access
|
494
|
+
# denied).
|
271
495
|
# @return [Types::UploadPartCopyOutput]
|
272
496
|
def copy_from(options = {})
|
273
497
|
options = options.merge(
|
@@ -276,7 +500,9 @@ module Aws::S3
|
|
276
500
|
upload_id: @multipart_upload_id,
|
277
501
|
part_number: @part_number
|
278
502
|
)
|
279
|
-
resp =
|
503
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
504
|
+
@client.upload_part_copy(options)
|
505
|
+
end
|
280
506
|
resp.data
|
281
507
|
end
|
282
508
|
|
@@ -286,42 +512,136 @@ module Aws::S3
|
|
286
512
|
# body: source_file,
|
287
513
|
# content_length: 1,
|
288
514
|
# content_md5: "ContentMD5",
|
515
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
516
|
+
# checksum_crc32: "ChecksumCRC32",
|
517
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
518
|
+
# checksum_sha1: "ChecksumSHA1",
|
519
|
+
# checksum_sha256: "ChecksumSHA256",
|
289
520
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
290
521
|
# sse_customer_key: "SSECustomerKey",
|
291
522
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
292
523
|
# request_payer: "requester", # accepts requester
|
524
|
+
# expected_bucket_owner: "AccountId",
|
293
525
|
# })
|
294
526
|
# @param [Hash] options ({})
|
295
|
-
# @option options [String,
|
527
|
+
# @option options [String, StringIO, File] :body
|
296
528
|
# Object data.
|
297
529
|
# @option options [Integer] :content_length
|
298
530
|
# Size of the body in bytes. This parameter is useful when the size of
|
299
531
|
# the body cannot be determined automatically.
|
300
532
|
# @option options [String] :content_md5
|
301
533
|
# The base64-encoded 128-bit MD5 digest of the part data. This parameter
|
302
|
-
# is auto-populated when using the command from the CLI. This
|
534
|
+
# is auto-populated when using the command from the CLI. This parameter
|
303
535
|
# is required if object lock parameters are specified.
|
536
|
+
#
|
537
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
538
|
+
#
|
539
|
+
# </note>
|
540
|
+
# @option options [String] :checksum_algorithm
|
541
|
+
# Indicates the algorithm used to create the checksum for the object
|
542
|
+
# when you use the SDK. This header will not provide any additional
|
543
|
+
# functionality if you don't use the SDK. When you send this header,
|
544
|
+
# there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
|
545
|
+
# header sent. Otherwise, Amazon S3 fails the request with the HTTP
|
546
|
+
# status code `400 Bad Request`. For more information, see [Checking
|
547
|
+
# object integrity][1] in the *Amazon S3 User Guide*.
|
548
|
+
#
|
549
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
550
|
+
# `ChecksumAlgorithm` parameter.
|
551
|
+
#
|
552
|
+
# This checksum algorithm must be the same for all parts and it match
|
553
|
+
# the checksum value supplied in the `CreateMultipartUpload` request.
|
554
|
+
#
|
555
|
+
#
|
556
|
+
#
|
557
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
558
|
+
# @option options [String] :checksum_crc32
|
559
|
+
# This header can be used as a data integrity check to verify that the
|
560
|
+
# data received is the same data that was originally sent. This header
|
561
|
+
# specifies the base64-encoded, 32-bit CRC-32 checksum of the object.
|
562
|
+
# For more information, see [Checking object integrity][1] in the
|
563
|
+
# *Amazon S3 User Guide*.
|
564
|
+
#
|
565
|
+
#
|
566
|
+
#
|
567
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
568
|
+
# @option options [String] :checksum_crc32c
|
569
|
+
# This header can be used as a data integrity check to verify that the
|
570
|
+
# data received is the same data that was originally sent. This header
|
571
|
+
# specifies the base64-encoded, 32-bit CRC-32C checksum of the object.
|
572
|
+
# For more information, see [Checking object integrity][1] in the
|
573
|
+
# *Amazon S3 User Guide*.
|
574
|
+
#
|
575
|
+
#
|
576
|
+
#
|
577
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
578
|
+
# @option options [String] :checksum_sha1
|
579
|
+
# This header can be used as a data integrity check to verify that the
|
580
|
+
# data received is the same data that was originally sent. This header
|
581
|
+
# specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
|
582
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
583
|
+
# User Guide*.
|
584
|
+
#
|
585
|
+
#
|
586
|
+
#
|
587
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
588
|
+
# @option options [String] :checksum_sha256
|
589
|
+
# This header can be used as a data integrity check to verify that the
|
590
|
+
# data received is the same data that was originally sent. This header
|
591
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
592
|
+
# For more information, see [Checking object integrity][1] in the
|
593
|
+
# *Amazon S3 User Guide*.
|
594
|
+
#
|
595
|
+
#
|
596
|
+
#
|
597
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
304
598
|
# @option options [String] :sse_customer_algorithm
|
305
|
-
# Specifies the algorithm to use
|
306
|
-
# AES256).
|
599
|
+
# Specifies the algorithm to use when encrypting the object (for
|
600
|
+
# example, AES256).
|
601
|
+
#
|
602
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
603
|
+
#
|
604
|
+
# </note>
|
307
605
|
# @option options [String] :sse_customer_key
|
308
606
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
309
607
|
# encrypting data. This value is used to store the object and then it is
|
310
|
-
# discarded; Amazon does not store the encryption key. The key must
|
311
|
-
# appropriate for use with the algorithm specified in the
|
312
|
-
# x-amz-server-side
|
608
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
609
|
+
# be appropriate for use with the algorithm specified in the
|
610
|
+
# `x-amz-server-side-encryption-customer-algorithm header`. This must be
|
313
611
|
# the same encryption key specified in the initiate multipart upload
|
314
612
|
# request.
|
613
|
+
#
|
614
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
615
|
+
#
|
616
|
+
# </note>
|
315
617
|
# @option options [String] :sse_customer_key_md5
|
316
618
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
317
619
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
318
|
-
# ensure the encryption key was transmitted without error.
|
620
|
+
# ensure that the encryption key was transmitted without error.
|
621
|
+
#
|
622
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
623
|
+
#
|
624
|
+
# </note>
|
319
625
|
# @option options [String] :request_payer
|
320
|
-
# Confirms that the requester knows that
|
321
|
-
#
|
322
|
-
# requests.
|
323
|
-
#
|
324
|
-
#
|
626
|
+
# Confirms that the requester knows that they will be charged for the
|
627
|
+
# request. Bucket owners need not specify this parameter in their
|
628
|
+
# requests. If either the source or destination S3 bucket has Requester
|
629
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
630
|
+
# the object. For information about downloading objects from Requester
|
631
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
632
|
+
# in the *Amazon S3 User Guide*.
|
633
|
+
#
|
634
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
635
|
+
#
|
636
|
+
# </note>
|
637
|
+
#
|
638
|
+
#
|
639
|
+
#
|
640
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
641
|
+
# @option options [String] :expected_bucket_owner
|
642
|
+
# The account ID of the expected bucket owner. If the account ID that
|
643
|
+
# you provide does not match the actual owner of the bucket, the request
|
644
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
325
645
|
# @return [Types::UploadPartOutput]
|
326
646
|
def upload(options = {})
|
327
647
|
options = options.merge(
|
@@ -330,7 +650,9 @@ module Aws::S3
|
|
330
650
|
upload_id: @multipart_upload_id,
|
331
651
|
part_number: @part_number
|
332
652
|
)
|
333
|
-
resp =
|
653
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
654
|
+
@client.upload_part(options)
|
655
|
+
end
|
334
656
|
resp.data
|
335
657
|
end
|
336
658
|
|