aws-sdk-s3 1.13.0 → 1.146.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1131 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/bucket.rb +805 -91
  6. data/lib/aws-sdk-s3/bucket_acl.rb +66 -17
  7. data/lib/aws-sdk-s3/bucket_cors.rb +79 -17
  8. data/lib/aws-sdk-s3/bucket_lifecycle.rb +66 -19
  9. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +68 -19
  10. data/lib/aws-sdk-s3/bucket_logging.rb +68 -18
  11. data/lib/aws-sdk-s3/bucket_notification.rb +56 -20
  12. data/lib/aws-sdk-s3/bucket_policy.rb +107 -17
  13. data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
  14. data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
  15. data/lib/aws-sdk-s3/bucket_tagging.rb +71 -17
  16. data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
  17. data/lib/aws-sdk-s3/bucket_website.rb +78 -17
  18. data/lib/aws-sdk-s3/client.rb +16336 -3915
  19. data/lib/aws-sdk-s3/client_api.rb +1364 -173
  20. data/lib/aws-sdk-s3/customizations/bucket.rb +57 -38
  21. data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
  22. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  23. data/lib/aws-sdk-s3/customizations/object.rb +327 -53
  24. data/lib/aws-sdk-s3/customizations/object_summary.rb +12 -0
  25. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  26. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  27. data/lib/aws-sdk-s3/customizations.rb +12 -1
  28. data/lib/aws-sdk-s3/encryption/client.rb +29 -8
  29. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  30. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  31. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  32. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  33. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  34. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +11 -3
  35. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  36. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  37. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
  39. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  40. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  41. data/lib/aws-sdk-s3/encryption.rb +4 -0
  42. data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
  43. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
  44. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  45. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  46. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  47. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  48. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  49. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  50. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  51. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  52. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
  53. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  54. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  55. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  56. data/lib/aws-sdk-s3/endpoint_parameters.rb +178 -0
  57. data/lib/aws-sdk-s3/endpoint_provider.rb +591 -0
  58. data/lib/aws-sdk-s3/endpoints.rb +2590 -0
  59. data/lib/aws-sdk-s3/errors.rb +123 -1
  60. data/lib/aws-sdk-s3/event_streams.rb +20 -7
  61. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  62. data/lib/aws-sdk-s3/express_credentials_cache.rb +30 -0
  63. data/lib/aws-sdk-s3/express_credentials_provider.rb +36 -0
  64. data/lib/aws-sdk-s3/file_downloader.rb +184 -51
  65. data/lib/aws-sdk-s3/file_part.rb +16 -13
  66. data/lib/aws-sdk-s3/file_uploader.rb +39 -20
  67. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  68. data/lib/aws-sdk-s3/multipart_file_uploader.rb +82 -23
  69. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +202 -0
  70. data/lib/aws-sdk-s3/multipart_upload.rb +242 -31
  71. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  72. data/lib/aws-sdk-s3/multipart_upload_part.rb +371 -47
  73. data/lib/aws-sdk-s3/object.rb +2260 -217
  74. data/lib/aws-sdk-s3/object_acl.rb +105 -24
  75. data/lib/aws-sdk-s3/object_copier.rb +9 -5
  76. data/lib/aws-sdk-s3/object_multipart_copier.rb +43 -19
  77. data/lib/aws-sdk-s3/object_summary.rb +1851 -186
  78. data/lib/aws-sdk-s3/object_version.rb +457 -74
  79. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  80. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  81. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
  82. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  83. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  84. data/lib/aws-sdk-s3/plugins/endpoints.rb +274 -0
  85. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  86. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +91 -0
  87. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  88. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
  89. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  90. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  91. data/lib/aws-sdk-s3/plugins/md5s.rb +35 -27
  92. data/lib/aws-sdk-s3/plugins/redirects.rb +5 -1
  93. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  94. data/lib/aws-sdk-s3/plugins/s3_signer.rb +60 -91
  95. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  96. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  97. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
  98. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  99. data/lib/aws-sdk-s3/presigned_post.rb +160 -99
  100. data/lib/aws-sdk-s3/presigner.rb +172 -77
  101. data/lib/aws-sdk-s3/resource.rb +122 -6
  102. data/lib/aws-sdk-s3/types.rb +13937 -5517
  103. data/lib/aws-sdk-s3/waiters.rb +67 -1
  104. data/lib/aws-sdk-s3.rb +16 -6
  105. data/sig/bucket.rbs +212 -0
  106. data/sig/bucket_acl.rbs +78 -0
  107. data/sig/bucket_cors.rbs +69 -0
  108. data/sig/bucket_lifecycle.rbs +88 -0
  109. data/sig/bucket_lifecycle_configuration.rbs +111 -0
  110. data/sig/bucket_logging.rbs +76 -0
  111. data/sig/bucket_notification.rbs +114 -0
  112. data/sig/bucket_policy.rbs +59 -0
  113. data/sig/bucket_request_payment.rbs +54 -0
  114. data/sig/bucket_tagging.rbs +65 -0
  115. data/sig/bucket_versioning.rbs +77 -0
  116. data/sig/bucket_website.rbs +93 -0
  117. data/sig/client.rbs +2360 -0
  118. data/sig/errors.rbs +34 -0
  119. data/sig/multipart_upload.rbs +110 -0
  120. data/sig/multipart_upload_part.rbs +105 -0
  121. data/sig/object.rbs +436 -0
  122. data/sig/object_acl.rbs +86 -0
  123. data/sig/object_summary.rbs +334 -0
  124. data/sig/object_version.rbs +131 -0
  125. data/sig/resource.rbs +124 -0
  126. data/sig/types.rbs +2562 -0
  127. data/sig/waiters.rbs +83 -0
  128. metadata +70 -16
@@ -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/master/CONTRIBUTING.md
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,18 @@ 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
+
54
65
  # Size in bytes of the object.
55
66
  # @return [Integer]
56
67
  def size
@@ -82,17 +93,32 @@ module Aws::S3
82
93
  data[:is_latest]
83
94
  end
84
95
 
85
- # Date and time the object was last modified.
96
+ # Date and time when the object was last modified.
86
97
  # @return [Time]
87
98
  def last_modified
88
99
  data[:last_modified]
89
100
  end
90
101
 
102
+ # Specifies the owner of the object.
91
103
  # @return [Types::Owner]
92
104
  def owner
93
105
  data[:owner]
94
106
  end
95
107
 
108
+ # Specifies the restoration status of an object. Objects in certain
109
+ # storage classes must be restored before they can be retrieved. For
110
+ # more information about these storage classes and how to work with
111
+ # archived objects, see [ Working with archived objects][1] in the
112
+ # *Amazon S3 User Guide*.
113
+ #
114
+ #
115
+ #
116
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html
117
+ # @return [Types::RestoreStatus]
118
+ def restore_status
119
+ data[:restore_status]
120
+ end
121
+
96
122
  # @!endgroup
97
123
 
98
124
  # @return [Client]
@@ -128,7 +154,8 @@ module Aws::S3
128
154
  # Waiter polls an API operation until a resource enters a desired
129
155
  # state.
130
156
  #
131
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
157
+ # @note The waiting operation is performed on a copy. The original resource
158
+ # remains unchanged.
132
159
  #
133
160
  # ## Basic Usage
134
161
  #
@@ -141,13 +168,15 @@ module Aws::S3
141
168
  #
142
169
  # ## Example
143
170
  #
144
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
171
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
172
+ # instance.state.name == 'running'
173
+ # end
145
174
  #
146
175
  # ## Configuration
147
176
  #
148
177
  # You can configure the maximum number of polling attempts, and the
149
- # delay (in seconds) between each polling attempt. The waiting condition is set
150
- # by passing a block to {#wait_until}:
178
+ # delay (in seconds) between each polling attempt. The waiting condition is
179
+ # set by passing a block to {#wait_until}:
151
180
  #
152
181
  # # poll for ~25 seconds
153
182
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -178,17 +207,16 @@ module Aws::S3
178
207
  # # resource did not enter the desired state in time
179
208
  # end
180
209
  #
210
+ # @yieldparam [Resource] resource to be used in the waiting condition.
181
211
  #
182
- # @yield param [Resource] resource to be used in the waiting condition
183
- #
184
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
185
- # because the waiter has entered a state that it will not transition
186
- # out of, preventing success.
212
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
213
+ # terminates because the waiter has entered a state that it will not
214
+ # transition out of, preventing success.
187
215
  #
188
216
  # yet successful.
189
217
  #
190
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
191
- # while polling for a resource that is not expected.
218
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
219
+ # encountered while polling for a resource that is not expected.
192
220
  #
193
221
  # @raise [NotImplementedError] Raised when the resource does not
194
222
  #
@@ -215,7 +243,9 @@ module Aws::S3
215
243
  :retry
216
244
  end
217
245
  end
218
- Aws::Waiters::Waiter.new(options).wait({})
246
+ Aws::Plugins::UserAgent.feature('resource') do
247
+ Aws::Waiters::Waiter.new(options).wait({})
248
+ end
219
249
  end
220
250
 
221
251
  # @!group Actions
@@ -225,17 +255,47 @@ module Aws::S3
225
255
  # object_version.delete({
226
256
  # mfa: "MFA",
227
257
  # request_payer: "requester", # accepts requester
258
+ # bypass_governance_retention: false,
259
+ # expected_bucket_owner: "AccountId",
228
260
  # })
229
261
  # @param [Hash] options ({})
230
262
  # @option options [String] :mfa
231
263
  # The concatenation of the authentication device's serial number, a
232
264
  # space, and the value that is displayed on your authentication device.
265
+ # Required to permanently delete a versioned object if versioning is
266
+ # configured with MFA delete enabled.
267
+ #
268
+ # <note markdown="1"> This functionality is not supported for directory buckets.
269
+ #
270
+ # </note>
233
271
  # @option options [String] :request_payer
234
- # Confirms that the requester knows that she or he will be charged for
235
- # the request. Bucket owners need not specify this parameter in their
236
- # requests. Documentation on downloading objects from requester pays
237
- # buckets can be found at
238
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
272
+ # Confirms that the requester knows that they will be charged for the
273
+ # request. Bucket owners need not specify this parameter in their
274
+ # requests. If either the source or destination S3 bucket has Requester
275
+ # Pays enabled, the requester will pay for corresponding charges to copy
276
+ # the object. For information about downloading objects from Requester
277
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
278
+ # in the *Amazon S3 User Guide*.
279
+ #
280
+ # <note markdown="1"> This functionality is not supported for directory buckets.
281
+ #
282
+ # </note>
283
+ #
284
+ #
285
+ #
286
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
287
+ # @option options [Boolean] :bypass_governance_retention
288
+ # Indicates whether S3 Object Lock should bypass Governance-mode
289
+ # restrictions to process this operation. To use this header, you must
290
+ # have the `s3:BypassGovernanceRetention` permission.
291
+ #
292
+ # <note markdown="1"> This functionality is not supported for directory buckets.
293
+ #
294
+ # </note>
295
+ # @option options [String] :expected_bucket_owner
296
+ # The account ID of the expected bucket owner. If the account ID that
297
+ # you provide does not match the actual owner of the bucket, the request
298
+ # fails with the HTTP status code `403 Forbidden` (access denied).
239
299
  # @return [Types::DeleteObjectOutput]
240
300
  def delete(options = {})
241
301
  options = options.merge(
@@ -243,7 +303,9 @@ module Aws::S3
243
303
  key: @object_key,
244
304
  version_id: @id
245
305
  )
246
- resp = @client.delete_object(options)
306
+ resp = Aws::Plugins::UserAgent.feature('resource') do
307
+ @client.delete_object(options)
308
+ end
247
309
  resp.data
248
310
  end
249
311
 
@@ -266,60 +328,201 @@ module Aws::S3
266
328
  # sse_customer_key_md5: "SSECustomerKeyMD5",
267
329
  # request_payer: "requester", # accepts requester
268
330
  # part_number: 1,
331
+ # expected_bucket_owner: "AccountId",
332
+ # checksum_mode: "ENABLED", # accepts ENABLED
269
333
  # })
270
334
  # @param [Hash] options ({})
271
335
  # @option options [String] :if_match
272
336
  # Return the object only if its entity tag (ETag) is the same as the one
273
- # specified, otherwise return a 412 (precondition failed).
337
+ # specified in this header; otherwise, return a `412 Precondition
338
+ # Failed` error.
339
+ #
340
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
341
+ # present in the request as follows: `If-Match` condition evaluates to
342
+ # `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
343
+ # then, S3 returns `200 OK` and the data requested.
344
+ #
345
+ # For more information about conditional requests, see [RFC 7232][1].
346
+ #
347
+ #
348
+ #
349
+ # [1]: https://tools.ietf.org/html/rfc7232
274
350
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
275
351
  # Return the object only if it has been modified since the specified
276
- # time, otherwise return a 304 (not modified).
352
+ # time; otherwise, return a `304 Not Modified` error.
353
+ #
354
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
355
+ # present in the request as follows:` If-None-Match` condition evaluates
356
+ # to `false`, and; `If-Modified-Since` condition evaluates to `true`;
357
+ # then, S3 returns `304 Not Modified` status code.
358
+ #
359
+ # For more information about conditional requests, see [RFC 7232][1].
360
+ #
361
+ #
362
+ #
363
+ # [1]: https://tools.ietf.org/html/rfc7232
277
364
  # @option options [String] :if_none_match
278
365
  # Return the object only if its entity tag (ETag) is different from the
279
- # one specified, otherwise return a 304 (not modified).
366
+ # one specified in this header; otherwise, return a `304 Not Modified`
367
+ # error.
368
+ #
369
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
370
+ # present in the request as follows:` If-None-Match` condition evaluates
371
+ # to `false`, and; `If-Modified-Since` condition evaluates to `true`;
372
+ # then, S3 returns `304 Not Modified` HTTP status code.
373
+ #
374
+ # For more information about conditional requests, see [RFC 7232][1].
375
+ #
376
+ #
377
+ #
378
+ # [1]: https://tools.ietf.org/html/rfc7232
280
379
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
281
380
  # Return the object only if it has not been modified since the specified
282
- # time, otherwise return a 412 (precondition failed).
381
+ # time; otherwise, return a `412 Precondition Failed` error.
382
+ #
383
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
384
+ # present in the request as follows: `If-Match` condition evaluates to
385
+ # `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
386
+ # then, S3 returns `200 OK` and the data requested.
387
+ #
388
+ # For more information about conditional requests, see [RFC 7232][1].
389
+ #
390
+ #
391
+ #
392
+ # [1]: https://tools.ietf.org/html/rfc7232
283
393
  # @option options [String] :range
284
- # Downloads the specified range bytes of an object. For more information
285
- # about the HTTP Range header, go to
286
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
394
+ # Downloads the specified byte range of an object. For more information
395
+ # about the HTTP Range header, see
396
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-range][1].
397
+ #
398
+ # <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
399
+ # `GET` request.
400
+ #
401
+ # </note>
402
+ #
403
+ #
404
+ #
405
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range
287
406
  # @option options [String] :response_cache_control
288
- # Sets the Cache-Control header of the response.
407
+ # Sets the `Cache-Control` header of the response.
289
408
  # @option options [String] :response_content_disposition
290
- # Sets the Content-Disposition header of the response
409
+ # Sets the `Content-Disposition` header of the response.
291
410
  # @option options [String] :response_content_encoding
292
- # Sets the Content-Encoding header of the response.
411
+ # Sets the `Content-Encoding` header of the response.
293
412
  # @option options [String] :response_content_language
294
- # Sets the Content-Language header of the response.
413
+ # Sets the `Content-Language` header of the response.
295
414
  # @option options [String] :response_content_type
296
- # Sets the Content-Type header of the response.
415
+ # Sets the `Content-Type` header of the response.
297
416
  # @option options [Time,DateTime,Date,Integer,String] :response_expires
298
- # Sets the Expires header of the response.
417
+ # Sets the `Expires` header of the response.
299
418
  # @option options [String] :sse_customer_algorithm
300
- # Specifies the algorithm to use to when encrypting the object (e.g.,
301
- # AES256).
419
+ # Specifies the algorithm to use when decrypting the object (for
420
+ # example, `AES256`).
421
+ #
422
+ # If you encrypt an object by using server-side encryption with
423
+ # customer-provided encryption keys (SSE-C) when you store the object in
424
+ # Amazon S3, then when you GET the object, you must use the following
425
+ # headers:
426
+ #
427
+ # * `x-amz-server-side-encryption-customer-algorithm`
428
+ #
429
+ # * `x-amz-server-side-encryption-customer-key`
430
+ #
431
+ # * `x-amz-server-side-encryption-customer-key-MD5`
432
+ #
433
+ # For more information about SSE-C, see [Server-Side Encryption (Using
434
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
435
+ #
436
+ # <note markdown="1"> This functionality is not supported for directory buckets.
437
+ #
438
+ # </note>
439
+ #
440
+ #
441
+ #
442
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
302
443
  # @option options [String] :sse_customer_key
303
- # Specifies the customer-provided encryption key for Amazon S3 to use in
304
- # encrypting data. This value is used to store the object and then it is
305
- # discarded; Amazon does not store the encryption key. The key must be
306
- # appropriate for use with the algorithm specified in the
307
- # x-amz-server-side​-encryption​-customer-algorithm header.
444
+ # Specifies the customer-provided encryption key that you originally
445
+ # provided for Amazon S3 to encrypt the data before storing it. This
446
+ # value is used to decrypt the object when recovering it and must match
447
+ # the one used when storing the data. The key must be appropriate for
448
+ # use with the algorithm specified in the
449
+ # `x-amz-server-side-encryption-customer-algorithm` header.
450
+ #
451
+ # If you encrypt an object by using server-side encryption with
452
+ # customer-provided encryption keys (SSE-C) when you store the object in
453
+ # Amazon S3, then when you GET the object, you must use the following
454
+ # headers:
455
+ #
456
+ # * `x-amz-server-side-encryption-customer-algorithm`
457
+ #
458
+ # * `x-amz-server-side-encryption-customer-key`
459
+ #
460
+ # * `x-amz-server-side-encryption-customer-key-MD5`
461
+ #
462
+ # For more information about SSE-C, see [Server-Side Encryption (Using
463
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
464
+ #
465
+ # <note markdown="1"> This functionality is not supported for directory buckets.
466
+ #
467
+ # </note>
468
+ #
469
+ #
470
+ #
471
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
308
472
  # @option options [String] :sse_customer_key_md5
309
- # Specifies the 128-bit MD5 digest of the encryption key according to
310
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
311
- # ensure the encryption key was transmitted without error.
473
+ # Specifies the 128-bit MD5 digest of the customer-provided encryption
474
+ # key according to RFC 1321. Amazon S3 uses this header for a message
475
+ # integrity check to ensure that the encryption key was transmitted
476
+ # without error.
477
+ #
478
+ # If you encrypt an object by using server-side encryption with
479
+ # customer-provided encryption keys (SSE-C) when you store the object in
480
+ # Amazon S3, then when you GET the object, you must use the following
481
+ # headers:
482
+ #
483
+ # * `x-amz-server-side-encryption-customer-algorithm`
484
+ #
485
+ # * `x-amz-server-side-encryption-customer-key`
486
+ #
487
+ # * `x-amz-server-side-encryption-customer-key-MD5`
488
+ #
489
+ # For more information about SSE-C, see [Server-Side Encryption (Using
490
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
491
+ #
492
+ # <note markdown="1"> This functionality is not supported for directory buckets.
493
+ #
494
+ # </note>
495
+ #
496
+ #
497
+ #
498
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
312
499
  # @option options [String] :request_payer
313
- # Confirms that the requester knows that she or he will be charged for
314
- # the request. Bucket owners need not specify this parameter in their
315
- # requests. Documentation on downloading objects from requester pays
316
- # buckets can be found at
317
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
500
+ # Confirms that the requester knows that they will be charged for the
501
+ # request. Bucket owners need not specify this parameter in their
502
+ # requests. If either the source or destination S3 bucket has Requester
503
+ # Pays enabled, the requester will pay for corresponding charges to copy
504
+ # the object. For information about downloading objects from Requester
505
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
506
+ # in the *Amazon S3 User Guide*.
507
+ #
508
+ # <note markdown="1"> This functionality is not supported for directory buckets.
509
+ #
510
+ # </note>
511
+ #
512
+ #
513
+ #
514
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
318
515
  # @option options [Integer] :part_number
319
516
  # Part number of the object being read. This is a positive integer
320
517
  # between 1 and 10,000. Effectively performs a 'ranged' GET request
321
518
  # for the part specified. Useful for downloading just a part of an
322
519
  # object.
520
+ # @option options [String] :expected_bucket_owner
521
+ # The account ID of the expected bucket owner. If the account ID that
522
+ # you provide does not match the actual owner of the bucket, the request
523
+ # fails with the HTTP status code `403 Forbidden` (access denied).
524
+ # @option options [String] :checksum_mode
525
+ # To retrieve the checksum, this mode must be enabled.
323
526
  # @return [Types::GetObjectOutput]
324
527
  def get(options = {}, &block)
325
528
  options = options.merge(
@@ -327,7 +530,9 @@ module Aws::S3
327
530
  key: @object_key,
328
531
  version_id: @id
329
532
  )
330
- resp = @client.get_object(options, &block)
533
+ resp = Aws::Plugins::UserAgent.feature('resource') do
534
+ @client.get_object(options, &block)
535
+ end
331
536
  resp.data
332
537
  end
333
538
 
@@ -344,48 +549,144 @@ module Aws::S3
344
549
  # sse_customer_key_md5: "SSECustomerKeyMD5",
345
550
  # request_payer: "requester", # accepts requester
346
551
  # part_number: 1,
552
+ # expected_bucket_owner: "AccountId",
553
+ # checksum_mode: "ENABLED", # accepts ENABLED
347
554
  # })
348
555
  # @param [Hash] options ({})
349
556
  # @option options [String] :if_match
350
557
  # Return the object only if its entity tag (ETag) is the same as the one
351
- # specified, otherwise return a 412 (precondition failed).
558
+ # specified; otherwise, return a 412 (precondition failed) error.
559
+ #
560
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
561
+ # present in the request as follows:
562
+ #
563
+ # * `If-Match` condition evaluates to `true`, and;
564
+ #
565
+ # * `If-Unmodified-Since` condition evaluates to `false`;
566
+ #
567
+ # Then Amazon S3 returns `200 OK` and the data requested.
568
+ #
569
+ # For more information about conditional requests, see [RFC 7232][1].
570
+ #
571
+ #
572
+ #
573
+ # [1]: https://tools.ietf.org/html/rfc7232
352
574
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
353
575
  # Return the object only if it has been modified since the specified
354
- # time, otherwise return a 304 (not modified).
576
+ # time; otherwise, return a 304 (not modified) error.
577
+ #
578
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
579
+ # present in the request as follows:
580
+ #
581
+ # * `If-None-Match` condition evaluates to `false`, and;
582
+ #
583
+ # * `If-Modified-Since` condition evaluates to `true`;
584
+ #
585
+ # Then Amazon S3 returns the `304 Not Modified` response code.
586
+ #
587
+ # For more information about conditional requests, see [RFC 7232][1].
588
+ #
589
+ #
590
+ #
591
+ # [1]: https://tools.ietf.org/html/rfc7232
355
592
  # @option options [String] :if_none_match
356
593
  # Return the object only if its entity tag (ETag) is different from the
357
- # one specified, otherwise return a 304 (not modified).
594
+ # one specified; otherwise, return a 304 (not modified) error.
595
+ #
596
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
597
+ # present in the request as follows:
598
+ #
599
+ # * `If-None-Match` condition evaluates to `false`, and;
600
+ #
601
+ # * `If-Modified-Since` condition evaluates to `true`;
602
+ #
603
+ # Then Amazon S3 returns the `304 Not Modified` response code.
604
+ #
605
+ # For more information about conditional requests, see [RFC 7232][1].
606
+ #
607
+ #
608
+ #
609
+ # [1]: https://tools.ietf.org/html/rfc7232
358
610
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
359
611
  # Return the object only if it has not been modified since the specified
360
- # time, otherwise return a 412 (precondition failed).
612
+ # time; otherwise, return a 412 (precondition failed) error.
613
+ #
614
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
615
+ # present in the request as follows:
616
+ #
617
+ # * `If-Match` condition evaluates to `true`, and;
618
+ #
619
+ # * `If-Unmodified-Since` condition evaluates to `false`;
620
+ #
621
+ # Then Amazon S3 returns `200 OK` and the data requested.
622
+ #
623
+ # For more information about conditional requests, see [RFC 7232][1].
624
+ #
625
+ #
626
+ #
627
+ # [1]: https://tools.ietf.org/html/rfc7232
361
628
  # @option options [String] :range
362
- # Downloads the specified range bytes of an object. For more information
363
- # about the HTTP Range header, go to
364
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
629
+ # HeadObject returns only the metadata for an object. If the Range is
630
+ # satisfiable, only the `ContentLength` is affected in the response. If
631
+ # the Range is not satisfiable, S3 returns a `416 - Requested Range Not
632
+ # Satisfiable` error.
365
633
  # @option options [String] :sse_customer_algorithm
366
- # Specifies the algorithm to use to when encrypting the object (e.g.,
367
- # AES256).
634
+ # Specifies the algorithm to use when encrypting the object (for
635
+ # example, AES256).
636
+ #
637
+ # <note markdown="1"> This functionality is not supported for directory buckets.
638
+ #
639
+ # </note>
368
640
  # @option options [String] :sse_customer_key
369
641
  # Specifies the customer-provided encryption key for Amazon S3 to use in
370
642
  # 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 be
372
- # appropriate for use with the algorithm specified in the
373
- # x-amz-server-side​-encryption​-customer-algorithm header.
643
+ # discarded; Amazon S3 does not store the encryption key. The key must
644
+ # be appropriate for use with the algorithm specified in the
645
+ # `x-amz-server-side-encryption-customer-algorithm` header.
646
+ #
647
+ # <note markdown="1"> This functionality is not supported for directory buckets.
648
+ #
649
+ # </note>
374
650
  # @option options [String] :sse_customer_key_md5
375
651
  # Specifies the 128-bit MD5 digest of the encryption key according to
376
652
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
377
- # ensure the encryption key was transmitted without error.
653
+ # ensure that the encryption key was transmitted without error.
654
+ #
655
+ # <note markdown="1"> This functionality is not supported for directory buckets.
656
+ #
657
+ # </note>
378
658
  # @option options [String] :request_payer
379
- # Confirms that the requester knows that she or he will be charged for
380
- # the request. Bucket owners need not specify this parameter in their
381
- # requests. Documentation on downloading objects from requester pays
382
- # buckets can be found at
383
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
659
+ # Confirms that the requester knows that they will be charged for the
660
+ # request. Bucket owners need not specify this parameter in their
661
+ # requests. If either the source or destination S3 bucket has Requester
662
+ # Pays enabled, the requester will pay for corresponding charges to copy
663
+ # the object. For information about downloading objects from Requester
664
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
665
+ # in the *Amazon S3 User Guide*.
666
+ #
667
+ # <note markdown="1"> This functionality is not supported for directory buckets.
668
+ #
669
+ # </note>
670
+ #
671
+ #
672
+ #
673
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
384
674
  # @option options [Integer] :part_number
385
675
  # Part number of the object being read. This is a positive integer
386
676
  # between 1 and 10,000. Effectively performs a 'ranged' HEAD request
387
677
  # for the part specified. Useful querying about the size of the part and
388
678
  # the number of parts in this object.
679
+ # @option options [String] :expected_bucket_owner
680
+ # The account ID of the expected bucket owner. If the account ID that
681
+ # you provide does not match the actual owner of the bucket, the request
682
+ # fails with the HTTP status code `403 Forbidden` (access denied).
683
+ # @option options [String] :checksum_mode
684
+ # To retrieve the checksum, this parameter must be enabled.
685
+ #
686
+ # In addition, if you enable `ChecksumMode` and the object is encrypted
687
+ # with Amazon Web Services Key Management Service (Amazon Web Services
688
+ # KMS), you must have permission to use the `kms:Decrypt` action for the
689
+ # request to succeed.
389
690
  # @return [Types::HeadObjectOutput]
390
691
  def head(options = {})
391
692
  options = options.merge(
@@ -393,7 +694,9 @@ module Aws::S3
393
694
  key: @object_key,
394
695
  version_id: @id
395
696
  )
396
- resp = @client.head_object(options)
697
+ resp = Aws::Plugins::UserAgent.feature('resource') do
698
+ @client.head_object(options)
699
+ end
397
700
  resp.data
398
701
  end
399
702
 
@@ -463,17 +766,95 @@ module Aws::S3
463
766
  # object_version.batch_delete!({
464
767
  # mfa: "MFA",
465
768
  # request_payer: "requester", # accepts requester
769
+ # bypass_governance_retention: false,
770
+ # expected_bucket_owner: "AccountId",
771
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
466
772
  # })
467
773
  # @param options ({})
468
774
  # @option options [String] :mfa
469
775
  # The concatenation of the authentication device's serial number, a
470
776
  # space, and the value that is displayed on your authentication device.
777
+ # Required to permanently delete a versioned object if versioning is
778
+ # configured with MFA delete enabled.
779
+ #
780
+ # When performing the `DeleteObjects` operation on an MFA delete enabled
781
+ # bucket, which attempts to delete the specified versioned objects, you
782
+ # must include an MFA token. If you don't provide an MFA token, the
783
+ # entire request will fail, even if there are non-versioned objects that
784
+ # you are trying to delete. If you provide an invalid token, whether
785
+ # there are versioned object keys in the request or not, the entire
786
+ # Multi-Object Delete request will fail. For information about MFA
787
+ # Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
788
+ #
789
+ # <note markdown="1"> This functionality is not supported for directory buckets.
790
+ #
791
+ # </note>
792
+ #
793
+ #
794
+ #
795
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
471
796
  # @option options [String] :request_payer
472
- # Confirms that the requester knows that she or he will be charged for
473
- # the request. Bucket owners need not specify this parameter in their
474
- # requests. Documentation on downloading objects from requester pays
475
- # buckets can be found at
476
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
797
+ # Confirms that the requester knows that they will be charged for the
798
+ # request. Bucket owners need not specify this parameter in their
799
+ # requests. If either the source or destination S3 bucket has Requester
800
+ # Pays enabled, the requester will pay for corresponding charges to copy
801
+ # the object. For information about downloading objects from Requester
802
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
803
+ # in the *Amazon S3 User Guide*.
804
+ #
805
+ # <note markdown="1"> This functionality is not supported for directory buckets.
806
+ #
807
+ # </note>
808
+ #
809
+ #
810
+ #
811
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
812
+ # @option options [Boolean] :bypass_governance_retention
813
+ # Specifies whether you want to delete this object even if it has a
814
+ # Governance-type Object Lock in place. To use this header, you must
815
+ # have the `s3:BypassGovernanceRetention` permission.
816
+ #
817
+ # <note markdown="1"> This functionality is not supported for directory buckets.
818
+ #
819
+ # </note>
820
+ # @option options [String] :expected_bucket_owner
821
+ # The account ID of the expected bucket owner. If the account ID that
822
+ # you provide does not match the actual owner of the bucket, the request
823
+ # fails with the HTTP status code `403 Forbidden` (access denied).
824
+ # @option options [String] :checksum_algorithm
825
+ # Indicates the algorithm used to create the checksum for the object
826
+ # when you use the SDK. This header will not provide any additional
827
+ # functionality if you don't use the SDK. When you send this header,
828
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
829
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
830
+ # with the HTTP status code `400 Bad Request`.
831
+ #
832
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
833
+ # the supported algorithm from the following list:
834
+ #
835
+ # * CRC32
836
+ #
837
+ # * CRC32C
838
+ #
839
+ # * SHA1
840
+ #
841
+ # * SHA256
842
+ #
843
+ # For more information, see [Checking object integrity][1] in the
844
+ # *Amazon S3 User Guide*.
845
+ #
846
+ # If the individual checksum value you provide through
847
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
848
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
849
+ # provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
850
+ # that matches the provided value in `x-amz-checksum-algorithm `.
851
+ #
852
+ # If you provide an individual checksum, Amazon S3 ignores any provided
853
+ # `ChecksumAlgorithm` parameter.
854
+ #
855
+ #
856
+ #
857
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
477
858
  # @return [void]
478
859
  def batch_delete!(options = {})
479
860
  batch_enum.each do |batch|
@@ -487,7 +868,9 @@ module Aws::S3
487
868
  version_id: item.id
488
869
  }
489
870
  end
490
- batch[0].client.delete_objects(params)
871
+ Aws::Plugins::UserAgent.feature('resource') do
872
+ batch[0].client.delete_objects(params)
873
+ end
491
874
  end
492
875
  nil
493
876
  end