aws-sdk-s3 1.10.0 → 1.208.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1517 -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 +1062 -99
- data/lib/aws-sdk-s3/bucket_acl.rb +67 -17
- data/lib/aws-sdk-s3/bucket_cors.rb +80 -17
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -19
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -20
- data/lib/aws-sdk-s3/bucket_logging.rb +68 -18
- data/lib/aws-sdk-s3/bucket_notification.rb +56 -20
- data/lib/aws-sdk-s3/bucket_policy.rb +108 -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 -17
- data/lib/aws-sdk-s3/bucket_versioning.rb +166 -17
- data/lib/aws-sdk-s3/bucket_website.rb +78 -17
- data/lib/aws-sdk-s3/client.rb +20068 -3879
- data/lib/aws-sdk-s3/client_api.rb +1957 -209
- data/lib/aws-sdk-s3/customizations/bucket.rb +57 -38
- 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 +338 -68
- data/lib/aws-sdk-s3/customizations/object_summary.rb +17 -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 +30 -27
- data/lib/aws-sdk-s3/default_executor.rb +103 -0
- data/lib/aws-sdk-s3/encryption/client.rb +29 -8
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +45 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +15 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +11 -3
- 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 +48 -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 +645 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +68 -0
- data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +187 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +67 -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 +75 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +181 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +108 -0
- data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
- data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
- data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
- data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
- data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
- data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
- data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
- data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
- data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
- data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
- data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
- data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +24 -0
- data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
- data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +886 -0
- data/lib/aws-sdk-s3/endpoints.rb +1544 -0
- data/lib/aws-sdk-s3/errors.rb +181 -1
- data/lib/aws-sdk-s3/event_streams.rb +69 -0
- 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 +261 -82
- data/lib/aws-sdk-s3/file_part.rb +16 -13
- data/lib/aws-sdk-s3/file_uploader.rb +37 -22
- data/lib/aws-sdk-s3/legacy_signer.rb +19 -26
- data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +142 -80
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +191 -0
- data/lib/aws-sdk-s3/multipart_upload.rb +342 -31
- data/lib/aws-sdk-s3/multipart_upload_error.rb +5 -4
- data/lib/aws-sdk-s3/multipart_upload_part.rb +387 -47
- data/lib/aws-sdk-s3/object.rb +2733 -204
- data/lib/aws-sdk-s3/object_acl.rb +112 -25
- data/lib/aws-sdk-s3/object_copier.rb +9 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +50 -23
- data/lib/aws-sdk-s3/object_summary.rb +2265 -181
- data/lib/aws-sdk-s3/object_version.rb +542 -74
- 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/checksum_algorithm.rb +31 -0
- 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 +88 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
- 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 +14 -67
- data/lib/aws-sdk-s3/plugins/redirects.rb +5 -1
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +67 -93
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +137 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +4 -1
- data/lib/aws-sdk-s3/presigned_post.rb +160 -99
- data/lib/aws-sdk-s3/presigner.rb +178 -81
- data/lib/aws-sdk-s3/resource.rb +164 -15
- data/lib/aws-sdk-s3/transfer_manager.rb +303 -0
- data/lib/aws-sdk-s3/types.rb +15981 -4168
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +46 -31
- data/sig/bucket.rbs +231 -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 +2612 -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 +44 -0
- data/sig/multipart_upload.rbs +120 -0
- data/sig/multipart_upload_part.rbs +109 -0
- data/sig/object.rbs +464 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +347 -0
- data/sig/object_version.rbs +143 -0
- data/sig/resource.rbs +141 -0
- data/sig/types.rbs +2899 -0
- data/sig/waiters.rbs +95 -0
- metadata +97 -14
|
@@ -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 ObjectVersion
|
|
10
13
|
|
|
11
14
|
extend Aws::Deprecations
|
|
@@ -27,6 +30,7 @@ module Aws::S3
|
|
|
27
30
|
@id = extract_id(args, options)
|
|
28
31
|
@data = options.delete(:data)
|
|
29
32
|
@client = options.delete(:client) || Client.new(options)
|
|
33
|
+
@waiter_block_warned = false
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @!group Read-Only Attributes
|
|
@@ -46,11 +50,30 @@ module Aws::S3
|
|
|
46
50
|
@id
|
|
47
51
|
end
|
|
48
52
|
|
|
53
|
+
# The entity tag is an MD5 hash of that version of the object.
|
|
49
54
|
# @return [String]
|
|
50
55
|
def etag
|
|
51
56
|
data[:etag]
|
|
52
57
|
end
|
|
53
58
|
|
|
59
|
+
# The algorithm that was used to create a checksum of the object.
|
|
60
|
+
# @return [Array<String>]
|
|
61
|
+
def checksum_algorithm
|
|
62
|
+
data[:checksum_algorithm]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# The checksum type that is used to calculate the object’s checksum
|
|
66
|
+
# value. For more information, see [Checking object integrity][1] in the
|
|
67
|
+
# *Amazon S3 User Guide*.
|
|
68
|
+
#
|
|
69
|
+
#
|
|
70
|
+
#
|
|
71
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
72
|
+
# @return [String]
|
|
73
|
+
def checksum_type
|
|
74
|
+
data[:checksum_type]
|
|
75
|
+
end
|
|
76
|
+
|
|
54
77
|
# Size in bytes of the object.
|
|
55
78
|
# @return [Integer]
|
|
56
79
|
def size
|
|
@@ -82,17 +105,32 @@ module Aws::S3
|
|
|
82
105
|
data[:is_latest]
|
|
83
106
|
end
|
|
84
107
|
|
|
85
|
-
# Date and time the object was last modified.
|
|
108
|
+
# Date and time when the object was last modified.
|
|
86
109
|
# @return [Time]
|
|
87
110
|
def last_modified
|
|
88
111
|
data[:last_modified]
|
|
89
112
|
end
|
|
90
113
|
|
|
114
|
+
# Specifies the owner of the object.
|
|
91
115
|
# @return [Types::Owner]
|
|
92
116
|
def owner
|
|
93
117
|
data[:owner]
|
|
94
118
|
end
|
|
95
119
|
|
|
120
|
+
# Specifies the restoration status of an object. Objects in certain
|
|
121
|
+
# storage classes must be restored before they can be retrieved. For
|
|
122
|
+
# more information about these storage classes and how to work with
|
|
123
|
+
# archived objects, see [ Working with archived objects][1] in the
|
|
124
|
+
# *Amazon S3 User Guide*.
|
|
125
|
+
#
|
|
126
|
+
#
|
|
127
|
+
#
|
|
128
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html
|
|
129
|
+
# @return [Types::RestoreStatus]
|
|
130
|
+
def restore_status
|
|
131
|
+
data[:restore_status]
|
|
132
|
+
end
|
|
133
|
+
|
|
96
134
|
# @!endgroup
|
|
97
135
|
|
|
98
136
|
# @return [Client]
|
|
@@ -128,7 +166,8 @@ module Aws::S3
|
|
|
128
166
|
# Waiter polls an API operation until a resource enters a desired
|
|
129
167
|
# state.
|
|
130
168
|
#
|
|
131
|
-
# @note The waiting operation is performed on a copy. The original resource
|
|
169
|
+
# @note The waiting operation is performed on a copy. The original resource
|
|
170
|
+
# remains unchanged.
|
|
132
171
|
#
|
|
133
172
|
# ## Basic Usage
|
|
134
173
|
#
|
|
@@ -141,13 +180,15 @@ module Aws::S3
|
|
|
141
180
|
#
|
|
142
181
|
# ## Example
|
|
143
182
|
#
|
|
144
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
|
183
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
|
184
|
+
# instance.state.name == 'running'
|
|
185
|
+
# end
|
|
145
186
|
#
|
|
146
187
|
# ## Configuration
|
|
147
188
|
#
|
|
148
189
|
# You can configure the maximum number of polling attempts, and the
|
|
149
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
|
150
|
-
# by passing a block to {#wait_until}:
|
|
190
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
|
191
|
+
# set by passing a block to {#wait_until}:
|
|
151
192
|
#
|
|
152
193
|
# # poll for ~25 seconds
|
|
153
194
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
|
@@ -178,17 +219,16 @@ module Aws::S3
|
|
|
178
219
|
# # resource did not enter the desired state in time
|
|
179
220
|
# end
|
|
180
221
|
#
|
|
222
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
|
181
223
|
#
|
|
182
|
-
# @
|
|
183
|
-
#
|
|
184
|
-
#
|
|
185
|
-
# because the waiter has entered a state that it will not transition
|
|
186
|
-
# out of, preventing success.
|
|
224
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
|
225
|
+
# terminates because the waiter has entered a state that it will not
|
|
226
|
+
# transition out of, preventing success.
|
|
187
227
|
#
|
|
188
228
|
# yet successful.
|
|
189
229
|
#
|
|
190
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
|
191
|
-
# while polling for a resource that is not expected.
|
|
230
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
|
231
|
+
# encountered while polling for a resource that is not expected.
|
|
192
232
|
#
|
|
193
233
|
# @raise [NotImplementedError] Raised when the resource does not
|
|
194
234
|
#
|
|
@@ -215,7 +255,9 @@ module Aws::S3
|
|
|
215
255
|
:retry
|
|
216
256
|
end
|
|
217
257
|
end
|
|
218
|
-
Aws::
|
|
258
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
259
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
|
260
|
+
end
|
|
219
261
|
end
|
|
220
262
|
|
|
221
263
|
# @!group Actions
|
|
@@ -225,17 +267,88 @@ module Aws::S3
|
|
|
225
267
|
# object_version.delete({
|
|
226
268
|
# mfa: "MFA",
|
|
227
269
|
# request_payer: "requester", # accepts requester
|
|
270
|
+
# bypass_governance_retention: false,
|
|
271
|
+
# expected_bucket_owner: "AccountId",
|
|
272
|
+
# if_match: "IfMatch",
|
|
273
|
+
# if_match_last_modified_time: Time.now,
|
|
274
|
+
# if_match_size: 1,
|
|
228
275
|
# })
|
|
229
276
|
# @param [Hash] options ({})
|
|
230
277
|
# @option options [String] :mfa
|
|
231
278
|
# The concatenation of the authentication device's serial number, a
|
|
232
279
|
# space, and the value that is displayed on your authentication device.
|
|
280
|
+
# Required to permanently delete a versioned object if versioning is
|
|
281
|
+
# configured with MFA delete enabled.
|
|
282
|
+
#
|
|
283
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
284
|
+
#
|
|
285
|
+
# </note>
|
|
233
286
|
# @option options [String] :request_payer
|
|
234
|
-
# Confirms that the requester knows that
|
|
235
|
-
#
|
|
236
|
-
# requests.
|
|
237
|
-
#
|
|
238
|
-
#
|
|
287
|
+
# Confirms that the requester knows that they will be charged for the
|
|
288
|
+
# request. Bucket owners need not specify this parameter in their
|
|
289
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
290
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
291
|
+
# the object. For information about downloading objects from Requester
|
|
292
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
293
|
+
# in the *Amazon S3 User Guide*.
|
|
294
|
+
#
|
|
295
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
296
|
+
#
|
|
297
|
+
# </note>
|
|
298
|
+
#
|
|
299
|
+
#
|
|
300
|
+
#
|
|
301
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
302
|
+
# @option options [Boolean] :bypass_governance_retention
|
|
303
|
+
# Indicates whether S3 Object Lock should bypass Governance-mode
|
|
304
|
+
# restrictions to process this operation. To use this header, you must
|
|
305
|
+
# have the `s3:BypassGovernanceRetention` permission.
|
|
306
|
+
#
|
|
307
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
308
|
+
#
|
|
309
|
+
# </note>
|
|
310
|
+
# @option options [String] :expected_bucket_owner
|
|
311
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
312
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
313
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
314
|
+
# @option options [String] :if_match
|
|
315
|
+
# Deletes the object if the ETag (entity tag) value provided during the
|
|
316
|
+
# delete operation matches the ETag of the object in S3. If the ETag
|
|
317
|
+
# values do not match, the operation returns a `412 Precondition Failed`
|
|
318
|
+
# error.
|
|
319
|
+
#
|
|
320
|
+
# Expects the ETag value as a string. `If-Match` does accept a string
|
|
321
|
+
# value of an '*' (asterisk) character to denote a match of any ETag.
|
|
322
|
+
#
|
|
323
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
324
|
+
#
|
|
325
|
+
#
|
|
326
|
+
#
|
|
327
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
328
|
+
# @option options [Time,DateTime,Date,Integer,String] :if_match_last_modified_time
|
|
329
|
+
# If present, the object is deleted only if its modification times
|
|
330
|
+
# matches the provided `Timestamp`. If the `Timestamp` values do not
|
|
331
|
+
# match, the operation returns a `412 Precondition Failed` error. If the
|
|
332
|
+
# `Timestamp` matches or if the object doesn’t exist, the operation
|
|
333
|
+
# returns a `204 Success (No Content)` response.
|
|
334
|
+
#
|
|
335
|
+
# <note markdown="1"> This functionality is only supported for directory buckets.
|
|
336
|
+
#
|
|
337
|
+
# </note>
|
|
338
|
+
# @option options [Integer] :if_match_size
|
|
339
|
+
# If present, the object is deleted only if its size matches the
|
|
340
|
+
# provided size in bytes. If the `Size` value does not match, the
|
|
341
|
+
# operation returns a `412 Precondition Failed` error. If the `Size`
|
|
342
|
+
# matches or if the object doesn’t exist, the operation returns a `204
|
|
343
|
+
# Success (No Content)` response.
|
|
344
|
+
#
|
|
345
|
+
# <note markdown="1"> This functionality is only supported for directory buckets.
|
|
346
|
+
#
|
|
347
|
+
# </note>
|
|
348
|
+
#
|
|
349
|
+
# You can use the `If-Match`, `x-amz-if-match-last-modified-time` and
|
|
350
|
+
# `x-amz-if-match-size` conditional headers in conjunction with
|
|
351
|
+
# each-other or individually.
|
|
239
352
|
# @return [Types::DeleteObjectOutput]
|
|
240
353
|
def delete(options = {})
|
|
241
354
|
options = options.merge(
|
|
@@ -243,7 +356,9 @@ module Aws::S3
|
|
|
243
356
|
key: @object_key,
|
|
244
357
|
version_id: @id
|
|
245
358
|
)
|
|
246
|
-
resp =
|
|
359
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
360
|
+
@client.delete_object(options)
|
|
361
|
+
end
|
|
247
362
|
resp.data
|
|
248
363
|
end
|
|
249
364
|
|
|
@@ -266,60 +381,201 @@ module Aws::S3
|
|
|
266
381
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
|
267
382
|
# request_payer: "requester", # accepts requester
|
|
268
383
|
# part_number: 1,
|
|
384
|
+
# expected_bucket_owner: "AccountId",
|
|
385
|
+
# checksum_mode: "ENABLED", # accepts ENABLED
|
|
269
386
|
# })
|
|
270
387
|
# @param [Hash] options ({})
|
|
271
388
|
# @option options [String] :if_match
|
|
272
389
|
# Return the object only if its entity tag (ETag) is the same as the one
|
|
273
|
-
# specified
|
|
390
|
+
# specified in this header; otherwise, return a `412 Precondition
|
|
391
|
+
# Failed` error.
|
|
392
|
+
#
|
|
393
|
+
# If both of the `If-Match` and `If-Unmodified-Since` headers are
|
|
394
|
+
# present in the request as follows: `If-Match` condition evaluates to
|
|
395
|
+
# `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
|
|
396
|
+
# then, S3 returns `200 OK` and the data requested.
|
|
397
|
+
#
|
|
398
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
399
|
+
#
|
|
400
|
+
#
|
|
401
|
+
#
|
|
402
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
274
403
|
# @option options [Time,DateTime,Date,Integer,String] :if_modified_since
|
|
275
404
|
# Return the object only if it has been modified since the specified
|
|
276
|
-
# time
|
|
405
|
+
# time; otherwise, return a `304 Not Modified` error.
|
|
406
|
+
#
|
|
407
|
+
# If both of the `If-None-Match` and `If-Modified-Since` headers are
|
|
408
|
+
# present in the request as follows:` If-None-Match` condition evaluates
|
|
409
|
+
# to `false`, and; `If-Modified-Since` condition evaluates to `true`;
|
|
410
|
+
# then, S3 returns `304 Not Modified` status code.
|
|
411
|
+
#
|
|
412
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
413
|
+
#
|
|
414
|
+
#
|
|
415
|
+
#
|
|
416
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
277
417
|
# @option options [String] :if_none_match
|
|
278
418
|
# Return the object only if its entity tag (ETag) is different from the
|
|
279
|
-
# one specified
|
|
419
|
+
# one specified in this header; otherwise, return a `304 Not Modified`
|
|
420
|
+
# error.
|
|
421
|
+
#
|
|
422
|
+
# If both of the `If-None-Match` and `If-Modified-Since` headers are
|
|
423
|
+
# present in the request as follows:` If-None-Match` condition evaluates
|
|
424
|
+
# to `false`, and; `If-Modified-Since` condition evaluates to `true`;
|
|
425
|
+
# then, S3 returns `304 Not Modified` HTTP status code.
|
|
426
|
+
#
|
|
427
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
428
|
+
#
|
|
429
|
+
#
|
|
430
|
+
#
|
|
431
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
280
432
|
# @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
|
|
281
433
|
# Return the object only if it has not been modified since the specified
|
|
282
|
-
# time
|
|
434
|
+
# time; otherwise, return a `412 Precondition Failed` error.
|
|
435
|
+
#
|
|
436
|
+
# If both of the `If-Match` and `If-Unmodified-Since` headers are
|
|
437
|
+
# present in the request as follows: `If-Match` condition evaluates to
|
|
438
|
+
# `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
|
|
439
|
+
# then, S3 returns `200 OK` and the data requested.
|
|
440
|
+
#
|
|
441
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
442
|
+
#
|
|
443
|
+
#
|
|
444
|
+
#
|
|
445
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
283
446
|
# @option options [String] :range
|
|
284
|
-
# Downloads the specified range
|
|
285
|
-
# about the HTTP Range header,
|
|
286
|
-
#
|
|
447
|
+
# Downloads the specified byte range of an object. For more information
|
|
448
|
+
# about the HTTP Range header, see
|
|
449
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#name-range][1].
|
|
450
|
+
#
|
|
451
|
+
# <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
|
|
452
|
+
# `GET` request.
|
|
453
|
+
#
|
|
454
|
+
# </note>
|
|
455
|
+
#
|
|
456
|
+
#
|
|
457
|
+
#
|
|
458
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range
|
|
287
459
|
# @option options [String] :response_cache_control
|
|
288
|
-
# Sets the Cache-Control header of the response.
|
|
460
|
+
# Sets the `Cache-Control` header of the response.
|
|
289
461
|
# @option options [String] :response_content_disposition
|
|
290
|
-
# Sets the Content-Disposition header of the response
|
|
462
|
+
# Sets the `Content-Disposition` header of the response.
|
|
291
463
|
# @option options [String] :response_content_encoding
|
|
292
|
-
# Sets the Content-Encoding header of the response.
|
|
464
|
+
# Sets the `Content-Encoding` header of the response.
|
|
293
465
|
# @option options [String] :response_content_language
|
|
294
|
-
# Sets the Content-Language header of the response.
|
|
466
|
+
# Sets the `Content-Language` header of the response.
|
|
295
467
|
# @option options [String] :response_content_type
|
|
296
|
-
# Sets the Content-Type header of the response.
|
|
468
|
+
# Sets the `Content-Type` header of the response.
|
|
297
469
|
# @option options [Time,DateTime,Date,Integer,String] :response_expires
|
|
298
|
-
# Sets the Expires header of the response.
|
|
470
|
+
# Sets the `Expires` header of the response.
|
|
299
471
|
# @option options [String] :sse_customer_algorithm
|
|
300
|
-
# Specifies the algorithm to use
|
|
301
|
-
# AES256).
|
|
472
|
+
# Specifies the algorithm to use when decrypting the object (for
|
|
473
|
+
# example, `AES256`).
|
|
474
|
+
#
|
|
475
|
+
# If you encrypt an object by using server-side encryption with
|
|
476
|
+
# customer-provided encryption keys (SSE-C) when you store the object in
|
|
477
|
+
# Amazon S3, then when you GET the object, you must use the following
|
|
478
|
+
# headers:
|
|
479
|
+
#
|
|
480
|
+
# * `x-amz-server-side-encryption-customer-algorithm`
|
|
481
|
+
#
|
|
482
|
+
# * `x-amz-server-side-encryption-customer-key`
|
|
483
|
+
#
|
|
484
|
+
# * `x-amz-server-side-encryption-customer-key-MD5`
|
|
485
|
+
#
|
|
486
|
+
# For more information about SSE-C, see [Server-Side Encryption (Using
|
|
487
|
+
# Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
|
|
488
|
+
#
|
|
489
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
490
|
+
#
|
|
491
|
+
# </note>
|
|
492
|
+
#
|
|
493
|
+
#
|
|
494
|
+
#
|
|
495
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
302
496
|
# @option options [String] :sse_customer_key
|
|
303
|
-
# Specifies the customer-provided encryption key
|
|
304
|
-
#
|
|
305
|
-
#
|
|
306
|
-
#
|
|
307
|
-
#
|
|
497
|
+
# Specifies the customer-provided encryption key that you originally
|
|
498
|
+
# provided for Amazon S3 to encrypt the data before storing it. This
|
|
499
|
+
# value is used to decrypt the object when recovering it and must match
|
|
500
|
+
# the one used when storing the data. The key must be appropriate for
|
|
501
|
+
# use with the algorithm specified in the
|
|
502
|
+
# `x-amz-server-side-encryption-customer-algorithm` header.
|
|
503
|
+
#
|
|
504
|
+
# If you encrypt an object by using server-side encryption with
|
|
505
|
+
# customer-provided encryption keys (SSE-C) when you store the object in
|
|
506
|
+
# Amazon S3, then when you GET the object, you must use the following
|
|
507
|
+
# headers:
|
|
508
|
+
#
|
|
509
|
+
# * `x-amz-server-side-encryption-customer-algorithm`
|
|
510
|
+
#
|
|
511
|
+
# * `x-amz-server-side-encryption-customer-key`
|
|
512
|
+
#
|
|
513
|
+
# * `x-amz-server-side-encryption-customer-key-MD5`
|
|
514
|
+
#
|
|
515
|
+
# For more information about SSE-C, see [Server-Side Encryption (Using
|
|
516
|
+
# Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
|
|
517
|
+
#
|
|
518
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
519
|
+
#
|
|
520
|
+
# </note>
|
|
521
|
+
#
|
|
522
|
+
#
|
|
523
|
+
#
|
|
524
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
308
525
|
# @option options [String] :sse_customer_key_md5
|
|
309
|
-
# Specifies the 128-bit MD5 digest of the encryption
|
|
310
|
-
# RFC 1321. Amazon S3 uses this header for a message
|
|
311
|
-
# ensure the encryption key was transmitted
|
|
526
|
+
# Specifies the 128-bit MD5 digest of the customer-provided encryption
|
|
527
|
+
# key according to RFC 1321. Amazon S3 uses this header for a message
|
|
528
|
+
# integrity check to ensure that the encryption key was transmitted
|
|
529
|
+
# without error.
|
|
530
|
+
#
|
|
531
|
+
# If you encrypt an object by using server-side encryption with
|
|
532
|
+
# customer-provided encryption keys (SSE-C) when you store the object in
|
|
533
|
+
# Amazon S3, then when you GET the object, you must use the following
|
|
534
|
+
# headers:
|
|
535
|
+
#
|
|
536
|
+
# * `x-amz-server-side-encryption-customer-algorithm`
|
|
537
|
+
#
|
|
538
|
+
# * `x-amz-server-side-encryption-customer-key`
|
|
539
|
+
#
|
|
540
|
+
# * `x-amz-server-side-encryption-customer-key-MD5`
|
|
541
|
+
#
|
|
542
|
+
# For more information about SSE-C, see [Server-Side Encryption (Using
|
|
543
|
+
# Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
|
|
544
|
+
#
|
|
545
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
546
|
+
#
|
|
547
|
+
# </note>
|
|
548
|
+
#
|
|
549
|
+
#
|
|
550
|
+
#
|
|
551
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
312
552
|
# @option options [String] :request_payer
|
|
313
|
-
# Confirms that the requester knows that
|
|
314
|
-
#
|
|
315
|
-
# requests.
|
|
316
|
-
#
|
|
317
|
-
#
|
|
553
|
+
# Confirms that the requester knows that they will be charged for the
|
|
554
|
+
# request. Bucket owners need not specify this parameter in their
|
|
555
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
556
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
557
|
+
# the object. For information about downloading objects from Requester
|
|
558
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
559
|
+
# in the *Amazon S3 User Guide*.
|
|
560
|
+
#
|
|
561
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
562
|
+
#
|
|
563
|
+
# </note>
|
|
564
|
+
#
|
|
565
|
+
#
|
|
566
|
+
#
|
|
567
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
318
568
|
# @option options [Integer] :part_number
|
|
319
569
|
# Part number of the object being read. This is a positive integer
|
|
320
570
|
# between 1 and 10,000. Effectively performs a 'ranged' GET request
|
|
321
571
|
# for the part specified. Useful for downloading just a part of an
|
|
322
572
|
# object.
|
|
573
|
+
# @option options [String] :expected_bucket_owner
|
|
574
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
575
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
576
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
577
|
+
# @option options [String] :checksum_mode
|
|
578
|
+
# To retrieve the checksum, this mode must be enabled.
|
|
323
579
|
# @return [Types::GetObjectOutput]
|
|
324
580
|
def get(options = {}, &block)
|
|
325
581
|
options = options.merge(
|
|
@@ -327,7 +583,9 @@ module Aws::S3
|
|
|
327
583
|
key: @object_key,
|
|
328
584
|
version_id: @id
|
|
329
585
|
)
|
|
330
|
-
resp =
|
|
586
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
587
|
+
@client.get_object(options, &block)
|
|
588
|
+
end
|
|
331
589
|
resp.data
|
|
332
590
|
end
|
|
333
591
|
|
|
@@ -339,53 +597,177 @@ module Aws::S3
|
|
|
339
597
|
# if_none_match: "IfNoneMatch",
|
|
340
598
|
# if_unmodified_since: Time.now,
|
|
341
599
|
# range: "Range",
|
|
600
|
+
# response_cache_control: "ResponseCacheControl",
|
|
601
|
+
# response_content_disposition: "ResponseContentDisposition",
|
|
602
|
+
# response_content_encoding: "ResponseContentEncoding",
|
|
603
|
+
# response_content_language: "ResponseContentLanguage",
|
|
604
|
+
# response_content_type: "ResponseContentType",
|
|
605
|
+
# response_expires: Time.now,
|
|
342
606
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
|
343
607
|
# sse_customer_key: "SSECustomerKey",
|
|
344
608
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
|
345
609
|
# request_payer: "requester", # accepts requester
|
|
346
610
|
# part_number: 1,
|
|
611
|
+
# expected_bucket_owner: "AccountId",
|
|
612
|
+
# checksum_mode: "ENABLED", # accepts ENABLED
|
|
347
613
|
# })
|
|
348
614
|
# @param [Hash] options ({})
|
|
349
615
|
# @option options [String] :if_match
|
|
350
616
|
# Return the object only if its entity tag (ETag) is the same as the one
|
|
351
|
-
# specified
|
|
617
|
+
# specified; otherwise, return a 412 (precondition failed) error.
|
|
618
|
+
#
|
|
619
|
+
# If both of the `If-Match` and `If-Unmodified-Since` headers are
|
|
620
|
+
# present in the request as follows:
|
|
621
|
+
#
|
|
622
|
+
# * `If-Match` condition evaluates to `true`, and;
|
|
623
|
+
#
|
|
624
|
+
# * `If-Unmodified-Since` condition evaluates to `false`;
|
|
625
|
+
#
|
|
626
|
+
# Then Amazon S3 returns `200 OK` and the data requested.
|
|
627
|
+
#
|
|
628
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
629
|
+
#
|
|
630
|
+
#
|
|
631
|
+
#
|
|
632
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
352
633
|
# @option options [Time,DateTime,Date,Integer,String] :if_modified_since
|
|
353
634
|
# Return the object only if it has been modified since the specified
|
|
354
|
-
# time
|
|
635
|
+
# time; otherwise, return a 304 (not modified) error.
|
|
636
|
+
#
|
|
637
|
+
# If both of the `If-None-Match` and `If-Modified-Since` headers are
|
|
638
|
+
# present in the request as follows:
|
|
639
|
+
#
|
|
640
|
+
# * `If-None-Match` condition evaluates to `false`, and;
|
|
641
|
+
#
|
|
642
|
+
# * `If-Modified-Since` condition evaluates to `true`;
|
|
643
|
+
#
|
|
644
|
+
# Then Amazon S3 returns the `304 Not Modified` response code.
|
|
645
|
+
#
|
|
646
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
647
|
+
#
|
|
648
|
+
#
|
|
649
|
+
#
|
|
650
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
355
651
|
# @option options [String] :if_none_match
|
|
356
652
|
# Return the object only if its entity tag (ETag) is different from the
|
|
357
|
-
# one specified
|
|
653
|
+
# one specified; otherwise, return a 304 (not modified) error.
|
|
654
|
+
#
|
|
655
|
+
# If both of the `If-None-Match` and `If-Modified-Since` headers are
|
|
656
|
+
# present in the request as follows:
|
|
657
|
+
#
|
|
658
|
+
# * `If-None-Match` condition evaluates to `false`, and;
|
|
659
|
+
#
|
|
660
|
+
# * `If-Modified-Since` condition evaluates to `true`;
|
|
661
|
+
#
|
|
662
|
+
# Then Amazon S3 returns the `304 Not Modified` response code.
|
|
663
|
+
#
|
|
664
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
665
|
+
#
|
|
666
|
+
#
|
|
667
|
+
#
|
|
668
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
358
669
|
# @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
|
|
359
670
|
# Return the object only if it has not been modified since the specified
|
|
360
|
-
# time
|
|
671
|
+
# time; otherwise, return a 412 (precondition failed) error.
|
|
672
|
+
#
|
|
673
|
+
# If both of the `If-Match` and `If-Unmodified-Since` headers are
|
|
674
|
+
# present in the request as follows:
|
|
675
|
+
#
|
|
676
|
+
# * `If-Match` condition evaluates to `true`, and;
|
|
677
|
+
#
|
|
678
|
+
# * `If-Unmodified-Since` condition evaluates to `false`;
|
|
679
|
+
#
|
|
680
|
+
# Then Amazon S3 returns `200 OK` and the data requested.
|
|
681
|
+
#
|
|
682
|
+
# For more information about conditional requests, see [RFC 7232][1].
|
|
683
|
+
#
|
|
684
|
+
#
|
|
685
|
+
#
|
|
686
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
361
687
|
# @option options [String] :range
|
|
362
|
-
#
|
|
363
|
-
#
|
|
364
|
-
#
|
|
688
|
+
# HeadObject returns only the metadata for an object. If the Range is
|
|
689
|
+
# satisfiable, only the `ContentLength` is affected in the response. If
|
|
690
|
+
# the Range is not satisfiable, S3 returns a `416 - Requested Range Not
|
|
691
|
+
# Satisfiable` error.
|
|
692
|
+
# @option options [String] :response_cache_control
|
|
693
|
+
# Sets the `Cache-Control` header of the response.
|
|
694
|
+
# @option options [String] :response_content_disposition
|
|
695
|
+
# Sets the `Content-Disposition` header of the response.
|
|
696
|
+
# @option options [String] :response_content_encoding
|
|
697
|
+
# Sets the `Content-Encoding` header of the response.
|
|
698
|
+
# @option options [String] :response_content_language
|
|
699
|
+
# Sets the `Content-Language` header of the response.
|
|
700
|
+
# @option options [String] :response_content_type
|
|
701
|
+
# Sets the `Content-Type` header of the response.
|
|
702
|
+
# @option options [Time,DateTime,Date,Integer,String] :response_expires
|
|
703
|
+
# Sets the `Expires` header of the response.
|
|
365
704
|
# @option options [String] :sse_customer_algorithm
|
|
366
|
-
# Specifies the algorithm to use
|
|
367
|
-
# AES256).
|
|
705
|
+
# Specifies the algorithm to use when encrypting the object (for
|
|
706
|
+
# example, AES256).
|
|
707
|
+
#
|
|
708
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
709
|
+
#
|
|
710
|
+
# </note>
|
|
368
711
|
# @option options [String] :sse_customer_key
|
|
369
712
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
|
370
713
|
# encrypting data. This value is used to store the object and then it is
|
|
371
|
-
# discarded; Amazon does not store the encryption key. The key must
|
|
372
|
-
# appropriate for use with the algorithm specified in the
|
|
373
|
-
# x-amz-server-side
|
|
714
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
|
715
|
+
# be appropriate for use with the algorithm specified in the
|
|
716
|
+
# `x-amz-server-side-encryption-customer-algorithm` header.
|
|
717
|
+
#
|
|
718
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
719
|
+
#
|
|
720
|
+
# </note>
|
|
374
721
|
# @option options [String] :sse_customer_key_md5
|
|
375
722
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
|
376
723
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
|
377
|
-
# ensure the encryption key was transmitted without error.
|
|
724
|
+
# ensure that the encryption key was transmitted without error.
|
|
725
|
+
#
|
|
726
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
727
|
+
#
|
|
728
|
+
# </note>
|
|
378
729
|
# @option options [String] :request_payer
|
|
379
|
-
# Confirms that the requester knows that
|
|
380
|
-
#
|
|
381
|
-
# requests.
|
|
382
|
-
#
|
|
383
|
-
#
|
|
730
|
+
# Confirms that the requester knows that they will be charged for the
|
|
731
|
+
# request. Bucket owners need not specify this parameter in their
|
|
732
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
733
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
734
|
+
# the object. For information about downloading objects from Requester
|
|
735
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
736
|
+
# in the *Amazon S3 User Guide*.
|
|
737
|
+
#
|
|
738
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
739
|
+
#
|
|
740
|
+
# </note>
|
|
741
|
+
#
|
|
742
|
+
#
|
|
743
|
+
#
|
|
744
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
384
745
|
# @option options [Integer] :part_number
|
|
385
746
|
# Part number of the object being read. This is a positive integer
|
|
386
747
|
# between 1 and 10,000. Effectively performs a 'ranged' HEAD request
|
|
387
748
|
# for the part specified. Useful querying about the size of the part and
|
|
388
749
|
# the number of parts in this object.
|
|
750
|
+
# @option options [String] :expected_bucket_owner
|
|
751
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
752
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
753
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
754
|
+
# @option options [String] :checksum_mode
|
|
755
|
+
# To retrieve the checksum, this parameter must be enabled.
|
|
756
|
+
#
|
|
757
|
+
# **General purpose buckets** - If you enable checksum mode and the
|
|
758
|
+
# object is uploaded with a [checksum][1] and encrypted with an Key
|
|
759
|
+
# Management Service (KMS) key, you must have permission to use the
|
|
760
|
+
# `kms:Decrypt` action to retrieve the checksum.
|
|
761
|
+
#
|
|
762
|
+
# **Directory buckets** - If you enable `ChecksumMode` and the object is
|
|
763
|
+
# encrypted with Amazon Web Services Key Management Service (Amazon Web
|
|
764
|
+
# Services KMS), you must also have the `kms:GenerateDataKey` and
|
|
765
|
+
# `kms:Decrypt` permissions in IAM identity-based policies and KMS key
|
|
766
|
+
# policies for the KMS key to retrieve the checksum of the object.
|
|
767
|
+
#
|
|
768
|
+
#
|
|
769
|
+
#
|
|
770
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
|
389
771
|
# @return [Types::HeadObjectOutput]
|
|
390
772
|
def head(options = {})
|
|
391
773
|
options = options.merge(
|
|
@@ -393,7 +775,9 @@ module Aws::S3
|
|
|
393
775
|
key: @object_key,
|
|
394
776
|
version_id: @id
|
|
395
777
|
)
|
|
396
|
-
resp =
|
|
778
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
779
|
+
@client.head_object(options)
|
|
780
|
+
end
|
|
397
781
|
resp.data
|
|
398
782
|
end
|
|
399
783
|
|
|
@@ -463,17 +847,96 @@ module Aws::S3
|
|
|
463
847
|
# object_version.batch_delete!({
|
|
464
848
|
# mfa: "MFA",
|
|
465
849
|
# request_payer: "requester", # accepts requester
|
|
850
|
+
# bypass_governance_retention: false,
|
|
851
|
+
# expected_bucket_owner: "AccountId",
|
|
852
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
|
466
853
|
# })
|
|
467
854
|
# @param options ({})
|
|
468
855
|
# @option options [String] :mfa
|
|
469
856
|
# The concatenation of the authentication device's serial number, a
|
|
470
857
|
# space, and the value that is displayed on your authentication device.
|
|
858
|
+
# Required to permanently delete a versioned object if versioning is
|
|
859
|
+
# configured with MFA delete enabled.
|
|
860
|
+
#
|
|
861
|
+
# When performing the `DeleteObjects` operation on an MFA delete enabled
|
|
862
|
+
# bucket, which attempts to delete the specified versioned objects, you
|
|
863
|
+
# must include an MFA token. If you don't provide an MFA token, the
|
|
864
|
+
# entire request will fail, even if there are non-versioned objects that
|
|
865
|
+
# you are trying to delete. If you provide an invalid token, whether
|
|
866
|
+
# there are versioned object keys in the request or not, the entire
|
|
867
|
+
# Multi-Object Delete request will fail. For information about MFA
|
|
868
|
+
# Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
|
|
869
|
+
#
|
|
870
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
871
|
+
#
|
|
872
|
+
# </note>
|
|
873
|
+
#
|
|
874
|
+
#
|
|
875
|
+
#
|
|
876
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
|
|
471
877
|
# @option options [String] :request_payer
|
|
472
|
-
# Confirms that the requester knows that
|
|
473
|
-
#
|
|
474
|
-
# requests.
|
|
475
|
-
#
|
|
476
|
-
#
|
|
878
|
+
# Confirms that the requester knows that they will be charged for the
|
|
879
|
+
# request. Bucket owners need not specify this parameter in their
|
|
880
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
881
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
882
|
+
# the object. For information about downloading objects from Requester
|
|
883
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
884
|
+
# in the *Amazon S3 User Guide*.
|
|
885
|
+
#
|
|
886
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
887
|
+
#
|
|
888
|
+
# </note>
|
|
889
|
+
#
|
|
890
|
+
#
|
|
891
|
+
#
|
|
892
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
893
|
+
# @option options [Boolean] :bypass_governance_retention
|
|
894
|
+
# Specifies whether you want to delete this object even if it has a
|
|
895
|
+
# Governance-type Object Lock in place. To use this header, you must
|
|
896
|
+
# have the `s3:BypassGovernanceRetention` permission.
|
|
897
|
+
#
|
|
898
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
899
|
+
#
|
|
900
|
+
# </note>
|
|
901
|
+
# @option options [String] :expected_bucket_owner
|
|
902
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
903
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
904
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
905
|
+
# @option options [String] :checksum_algorithm
|
|
906
|
+
# Indicates the algorithm used to create the checksum for the object
|
|
907
|
+
# when you use the SDK. This header will not provide any additional
|
|
908
|
+
# functionality if you don't use the SDK. When you send this header,
|
|
909
|
+
# there must be a corresponding `x-amz-checksum-algorithm ` or
|
|
910
|
+
# `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
|
|
911
|
+
# with the HTTP status code `400 Bad Request`.
|
|
912
|
+
#
|
|
913
|
+
# For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
|
|
914
|
+
# the supported algorithm from the following list:
|
|
915
|
+
#
|
|
916
|
+
# * `CRC32`
|
|
917
|
+
#
|
|
918
|
+
# * `CRC32C`
|
|
919
|
+
#
|
|
920
|
+
# * `CRC64NVME`
|
|
921
|
+
#
|
|
922
|
+
# * `SHA1`
|
|
923
|
+
#
|
|
924
|
+
# * `SHA256`
|
|
925
|
+
#
|
|
926
|
+
# For more information, see [Checking object integrity][1] in the
|
|
927
|
+
# *Amazon S3 User Guide*.
|
|
928
|
+
#
|
|
929
|
+
# If the individual checksum value you provide through
|
|
930
|
+
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
|
931
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
|
|
932
|
+
# request with a `BadDigest` error.
|
|
933
|
+
#
|
|
934
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
|
935
|
+
# `ChecksumAlgorithm` parameter.
|
|
936
|
+
#
|
|
937
|
+
#
|
|
938
|
+
#
|
|
939
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
477
940
|
# @return [void]
|
|
478
941
|
def batch_delete!(options = {})
|
|
479
942
|
batch_enum.each do |batch|
|
|
@@ -487,7 +950,9 @@ module Aws::S3
|
|
|
487
950
|
version_id: item.id
|
|
488
951
|
}
|
|
489
952
|
end
|
|
490
|
-
|
|
953
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
954
|
+
batch[0].client.delete_objects(params)
|
|
955
|
+
end
|
|
491
956
|
end
|
|
492
957
|
nil
|
|
493
958
|
end
|
|
@@ -497,3 +962,6 @@ module Aws::S3
|
|
|
497
962
|
end
|
|
498
963
|
end
|
|
499
964
|
end
|
|
965
|
+
|
|
966
|
+
# Load customizations if they exist
|
|
967
|
+
require 'aws-sdk-s3/customizations/object_version'
|