aws-sdk-s3 1.136.0 → 1.176.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +250 -1
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
  5. data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
  6. data/lib/aws-sdk-s3/bucket.rb +671 -139
  7. data/lib/aws-sdk-s3/bucket_acl.rb +12 -12
  8. data/lib/aws-sdk-s3/bucket_cors.rb +16 -16
  9. data/lib/aws-sdk-s3/bucket_lifecycle.rb +21 -16
  10. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +74 -17
  11. data/lib/aws-sdk-s3/bucket_logging.rb +19 -12
  12. data/lib/aws-sdk-s3/bucket_notification.rb +6 -6
  13. data/lib/aws-sdk-s3/bucket_policy.rb +62 -18
  14. data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
  15. data/lib/aws-sdk-s3/bucket_request_payment.rb +12 -12
  16. data/lib/aws-sdk-s3/bucket_tagging.rb +16 -16
  17. data/lib/aws-sdk-s3/bucket_versioning.rb +32 -32
  18. data/lib/aws-sdk-s3/bucket_website.rb +16 -16
  19. data/lib/aws-sdk-s3/client.rb +7597 -2823
  20. data/lib/aws-sdk-s3/client_api.rb +288 -22
  21. data/lib/aws-sdk-s3/customizations/bucket.rb +1 -1
  22. data/lib/aws-sdk-s3/customizations/errors.rb +15 -2
  23. data/lib/aws-sdk-s3/customizations/object.rb +11 -5
  24. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  25. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  26. data/lib/aws-sdk-s3/customizations.rb +25 -31
  27. data/lib/aws-sdk-s3/encryption/client.rb +2 -2
  28. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +2 -2
  29. data/lib/aws-sdk-s3/encryptionV2/client.rb +2 -2
  30. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +2 -2
  31. data/lib/aws-sdk-s3/endpoint_parameters.rb +53 -18
  32. data/lib/aws-sdk-s3/endpoint_provider.rb +125 -6
  33. data/lib/aws-sdk-s3/endpoints.rb +545 -1261
  34. data/lib/aws-sdk-s3/errors.rb +47 -0
  35. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  36. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  37. data/lib/aws-sdk-s3/file_downloader.rb +1 -2
  38. data/lib/aws-sdk-s3/file_uploader.rb +1 -1
  39. data/lib/aws-sdk-s3/multipart_file_uploader.rb +4 -4
  40. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +6 -5
  41. data/lib/aws-sdk-s3/multipart_upload.rb +139 -36
  42. data/lib/aws-sdk-s3/multipart_upload_part.rb +175 -54
  43. data/lib/aws-sdk-s3/object.rb +1923 -313
  44. data/lib/aws-sdk-s3/object_acl.rb +34 -22
  45. data/lib/aws-sdk-s3/object_copier.rb +1 -1
  46. data/lib/aws-sdk-s3/object_multipart_copier.rb +10 -8
  47. data/lib/aws-sdk-s3/object_summary.rb +1690 -250
  48. data/lib/aws-sdk-s3/object_version.rb +397 -67
  49. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  50. data/lib/aws-sdk-s3/plugins/endpoints.rb +32 -208
  51. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
  52. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +55 -18
  53. data/lib/aws-sdk-s3/plugins/location_constraint.rb +3 -1
  54. data/lib/aws-sdk-s3/plugins/md5s.rb +2 -1
  55. data/lib/aws-sdk-s3/plugins/s3_signer.rb +7 -2
  56. data/lib/aws-sdk-s3/presigner.rb +5 -2
  57. data/lib/aws-sdk-s3/resource.rb +121 -22
  58. data/lib/aws-sdk-s3/types.rb +5960 -1526
  59. data/lib/aws-sdk-s3.rb +35 -31
  60. data/sig/bucket.rbs +221 -0
  61. data/sig/bucket_acl.rbs +78 -0
  62. data/sig/bucket_cors.rbs +69 -0
  63. data/sig/bucket_lifecycle.rbs +88 -0
  64. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  65. data/sig/bucket_logging.rbs +76 -0
  66. data/sig/bucket_notification.rbs +114 -0
  67. data/sig/bucket_policy.rbs +59 -0
  68. data/sig/bucket_request_payment.rbs +54 -0
  69. data/sig/bucket_tagging.rbs +65 -0
  70. data/sig/bucket_versioning.rbs +77 -0
  71. data/sig/bucket_website.rbs +93 -0
  72. data/sig/client.rbs +2450 -0
  73. data/sig/customizations/bucket.rbs +19 -0
  74. data/sig/customizations/object.rbs +38 -0
  75. data/sig/customizations/object_summary.rbs +35 -0
  76. data/sig/errors.rbs +42 -0
  77. data/sig/multipart_upload.rbs +113 -0
  78. data/sig/multipart_upload_part.rbs +105 -0
  79. data/sig/object.rbs +448 -0
  80. data/sig/object_acl.rbs +86 -0
  81. data/sig/object_summary.rbs +340 -0
  82. data/sig/object_version.rbs +140 -0
  83. data/sig/resource.rbs +132 -0
  84. data/sig/types.rbs +2682 -0
  85. data/sig/waiters.rbs +95 -0
  86. metadata +44 -11
@@ -29,12 +29,16 @@ module Aws::S3
29
29
  # ## Error Classes
30
30
  # * {BucketAlreadyExists}
31
31
  # * {BucketAlreadyOwnedByYou}
32
+ # * {EncryptionTypeMismatch}
32
33
  # * {InvalidObjectState}
34
+ # * {InvalidRequest}
35
+ # * {InvalidWriteOffset}
33
36
  # * {NoSuchBucket}
34
37
  # * {NoSuchKey}
35
38
  # * {NoSuchUpload}
36
39
  # * {ObjectAlreadyInActiveTierError}
37
40
  # * {ObjectNotInActiveTierError}
41
+ # * {TooManyParts}
38
42
  #
39
43
  # Additionally, error classes are dynamically generated for service errors based on the error code
40
44
  # if they are not defined above.
@@ -62,6 +66,16 @@ module Aws::S3
62
66
  end
63
67
  end
64
68
 
69
+ class EncryptionTypeMismatch < ServiceError
70
+
71
+ # @param [Seahorse::Client::RequestContext] context
72
+ # @param [String] message
73
+ # @param [Aws::S3::Types::EncryptionTypeMismatch] data
74
+ def initialize(context, message, data = Aws::EmptyStructure.new)
75
+ super(context, message, data)
76
+ end
77
+ end
78
+
65
79
  class InvalidObjectState < ServiceError
66
80
 
67
81
  # @param [Seahorse::Client::RequestContext] context
@@ -82,6 +96,26 @@ module Aws::S3
82
96
  end
83
97
  end
84
98
 
99
+ class InvalidRequest < ServiceError
100
+
101
+ # @param [Seahorse::Client::RequestContext] context
102
+ # @param [String] message
103
+ # @param [Aws::S3::Types::InvalidRequest] data
104
+ def initialize(context, message, data = Aws::EmptyStructure.new)
105
+ super(context, message, data)
106
+ end
107
+ end
108
+
109
+ class InvalidWriteOffset < ServiceError
110
+
111
+ # @param [Seahorse::Client::RequestContext] context
112
+ # @param [String] message
113
+ # @param [Aws::S3::Types::InvalidWriteOffset] data
114
+ def initialize(context, message, data = Aws::EmptyStructure.new)
115
+ super(context, message, data)
116
+ end
117
+ end
118
+
85
119
  class NoSuchBucket < ServiceError
86
120
 
87
121
  # @param [Seahorse::Client::RequestContext] context
@@ -132,5 +166,18 @@ module Aws::S3
132
166
  end
133
167
  end
134
168
 
169
+ class TooManyParts < ServiceError
170
+
171
+ # @param [Seahorse::Client::RequestContext] context
172
+ # @param [String] message
173
+ # @param [Aws::S3::Types::TooManyParts] data
174
+ def initialize(context, message, data = Aws::EmptyStructure.new)
175
+ super(context, message, data)
176
+ end
177
+ end
178
+
135
179
  end
136
180
  end
181
+
182
+ # Load customizations if they exist
183
+ require 'aws-sdk-s3/customizations/errors'
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'set'
4
+
5
+ module Aws
6
+ module S3
7
+ # @api private
8
+ class ExpressCredentials
9
+ include CredentialProvider
10
+ include RefreshingCredentials
11
+
12
+ SYNC_EXPIRATION_LENGTH = 60 # 1 minute
13
+ ASYNC_EXPIRATION_LENGTH = 120 # 2 minutes
14
+
15
+ def initialize(options = {})
16
+ @client = options[:client]
17
+ @create_session_params = {}
18
+ options.each_pair do |key, value|
19
+ if self.class.create_session_options.include?(key)
20
+ @create_session_params[key] = value
21
+ end
22
+ end
23
+ @async_refresh = true
24
+ super
25
+ end
26
+
27
+ # @return [S3::Client]
28
+ attr_reader :client
29
+
30
+ private
31
+
32
+ def refresh
33
+ c = @client.create_session(@create_session_params).credentials
34
+ @credentials = Credentials.new(
35
+ c.access_key_id,
36
+ c.secret_access_key,
37
+ c.session_token
38
+ )
39
+ @expiration = c.expiration
40
+ end
41
+
42
+ class << self
43
+
44
+ # @api private
45
+ def create_session_options
46
+ @cso ||= begin
47
+ input = S3::Client.api.operation(:create_session).input
48
+ Set.new(input.shape.member_names)
49
+ end
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module S3
5
+ # @api private
6
+ def self.express_credentials_cache
7
+ @express_credentials_cache ||= LRUCache.new(max_entries: 100)
8
+ end
9
+
10
+ # Returns Credentials class for S3 Express. Accepts CreateSession
11
+ # params as options. See {Client#create_session} for details.
12
+ class ExpressCredentialsProvider
13
+ # @param [Hash] options
14
+ # @option options [Client] :client The S3 client used to create the
15
+ # session.
16
+ # @option options [String] :session_mode (see: {Client#create_session})
17
+ # @option options [Boolean] :caching (true) When true, credentials will
18
+ # be cached.
19
+ # @option options [Callable] :before_refresh Proc called before
20
+ # credentials are refreshed.
21
+ def initialize(options = {})
22
+ @client = options.delete(:client)
23
+ @caching = options.delete(:caching) != false
24
+ @options = options
25
+ return unless @caching
26
+
27
+ @cache = Aws::S3.express_credentials_cache
28
+ end
29
+
30
+ def express_credentials_for(bucket)
31
+ if @caching
32
+ cached_credentials_for(bucket)
33
+ else
34
+ new_credentials_for(bucket)
35
+ end
36
+ end
37
+
38
+ attr_accessor :client
39
+
40
+ private
41
+
42
+ def cached_credentials_for(bucket)
43
+ if @cache.key?(bucket)
44
+ @cache[bucket]
45
+ else
46
+ @cache[bucket] = new_credentials_for(bucket)
47
+ end
48
+ end
49
+
50
+ def new_credentials_for(bucket)
51
+ ExpressCredentials.new(
52
+ bucket: bucket,
53
+ client: @client,
54
+ **@options
55
+ )
56
+ end
57
+ end
58
+ end
59
+ end
@@ -44,7 +44,7 @@ module Aws
44
44
 
45
45
  validate!
46
46
 
47
- Aws::Plugins::UserAgent.feature('s3-transfer') do
47
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
48
48
  case @mode
49
49
  when 'auto' then multipart_download
50
50
  when 'single_request' then single_request
@@ -190,7 +190,6 @@ module Aws
190
190
  raise error
191
191
  end
192
192
  end
193
- thread.abort_on_exception = true
194
193
  threads << thread
195
194
  end
196
195
  threads.map(&:value).compact
@@ -37,7 +37,7 @@ module Aws
37
37
  # objects smaller than the multipart threshold.
38
38
  # @return [void]
39
39
  def upload(source, options = {})
40
- Aws::Plugins::UserAgent.feature('s3-transfer') do
40
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
41
41
  if File.size(source) >= multipart_threshold
42
42
  MultipartFileUploader.new(@options).upload(source, options)
43
43
  else
@@ -89,12 +89,13 @@ module Aws
89
89
  key: options[:key],
90
90
  upload_id: upload_id
91
91
  )
92
- msg = "multipart upload failed: #{errors.map(&:message).join("; ")}"
92
+ msg = "multipart upload failed: #{errors.map(&:message).join('; ')}"
93
93
  raise MultipartUploadError.new(msg, errors)
94
94
  rescue MultipartUploadError => error
95
95
  raise error
96
96
  rescue => error
97
- msg = "failed to abort multipart upload: #{error.message}"
97
+ msg = "failed to abort multipart upload: #{error.message}. "\
98
+ "Multipart upload failed: #{errors.map(&:message).join('; ')}"
98
99
  raise MultipartUploadError.new(msg, errors + [error])
99
100
  end
100
101
 
@@ -146,7 +147,7 @@ module Aws
146
147
  if (callback = options[:progress_callback])
147
148
  progress = MultipartProgress.new(pending, callback)
148
149
  end
149
- @thread_count.times do
150
+ options.fetch(:thread_count, @thread_count).times do
150
151
  thread = Thread.new do
151
152
  begin
152
153
  while part = pending.shift
@@ -175,7 +176,6 @@ module Aws
175
176
  error
176
177
  end
177
178
  end
178
- thread.abort_on_exception = true
179
179
  threads << thread
180
180
  end
181
181
  threads.map(&:value).compact
@@ -43,9 +43,10 @@ module Aws
43
43
 
44
44
  # @option options [required,String] :bucket
45
45
  # @option options [required,String] :key
46
+ # @option options [Integer] :thread_count (THREAD_COUNT)
46
47
  # @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
47
48
  def upload(options = {}, &block)
48
- Aws::Plugins::UserAgent.feature('s3-transfer') do
49
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
49
50
  upload_id = initiate_upload(options)
50
51
  parts = upload_parts(upload_id, options, &block)
51
52
  complete_upload(upload_id, parts, options)
@@ -101,12 +102,13 @@ module Aws
101
102
  key: options[:key],
102
103
  upload_id: upload_id
103
104
  )
104
- msg = "multipart upload failed: #{errors.map(&:message).join("; ")}"
105
+ msg = "multipart upload failed: #{errors.map(&:message).join('; ')}"
105
106
  raise MultipartUploadError.new(msg, errors)
106
107
  rescue MultipartUploadError => error
107
108
  raise error
108
109
  rescue => error
109
- msg = "failed to abort multipart upload: #{error.message}"
110
+ msg = "failed to abort multipart upload: #{error.message}. "\
111
+ "Multipart upload failed: #{errors.map(&:message).join('; ')}"
110
112
  raise MultipartUploadError.new(msg, errors + [error])
111
113
  end
112
114
 
@@ -151,7 +153,7 @@ module Aws
151
153
  def upload_in_threads(read_pipe, completed, options, thread_errors)
152
154
  mutex = Mutex.new
153
155
  part_number = 0
154
- @thread_count.times.map do
156
+ options.fetch(:thread_count, @thread_count).times.map do
155
157
  thread = Thread.new do
156
158
  begin
157
159
  loop do
@@ -192,7 +194,6 @@ module Aws
192
194
  error
193
195
  end
194
196
  end
195
- thread.abort_on_exception = true
196
197
  thread
197
198
  end
198
199
  end
@@ -69,6 +69,11 @@ module Aws::S3
69
69
  end
70
70
 
71
71
  # The class of storage used to store the object.
72
+ #
73
+ # <note markdown="1"> **Directory buckets** - Only the S3 Express One Zone storage class is
74
+ # supported by directory buckets to store objects.
75
+ #
76
+ # </note>
72
77
  # @return [String]
73
78
  def storage_class
74
79
  data[:storage_class]
@@ -76,6 +81,11 @@ module Aws::S3
76
81
 
77
82
  # Specifies the owner of the object that is part of the multipart
78
83
  # upload.
84
+ #
85
+ # <note markdown="1"> **Directory buckets** - The bucket owner is returned as the object
86
+ # owner for all the objects.
87
+ #
88
+ # </note>
79
89
  # @return [Types::Owner]
80
90
  def owner
81
91
  data[:owner]
@@ -217,7 +227,7 @@ module Aws::S3
217
227
  :retry
218
228
  end
219
229
  end
220
- Aws::Plugins::UserAgent.feature('resource') do
230
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
221
231
  Aws::Waiters::Waiter.new(options).wait({})
222
232
  end
223
233
  end
@@ -229,24 +239,40 @@ module Aws::S3
229
239
  # multipart_upload.abort({
230
240
  # request_payer: "requester", # accepts requester
231
241
  # expected_bucket_owner: "AccountId",
242
+ # if_match_initiated_time: Time.now,
232
243
  # })
233
244
  # @param [Hash] options ({})
234
245
  # @option options [String] :request_payer
235
246
  # Confirms that the requester knows that they will be charged for the
236
247
  # request. Bucket owners need not specify this parameter in their
237
- # requests. If either the source or destination Amazon S3 bucket has
238
- # Requester Pays enabled, the requester will pay for corresponding
239
- # charges to copy the object. For information about downloading objects
240
- # from Requester Pays buckets, see [Downloading Objects in Requester
241
- # Pays Buckets][1] in the *Amazon S3 User Guide*.
248
+ # requests. If either the source or destination S3 bucket has Requester
249
+ # Pays enabled, the requester will pay for corresponding charges to copy
250
+ # the object. For information about downloading objects from Requester
251
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
252
+ # in the *Amazon S3 User Guide*.
253
+ #
254
+ # <note markdown="1"> This functionality is not supported for directory buckets.
255
+ #
256
+ # </note>
242
257
  #
243
258
  #
244
259
  #
245
260
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
246
261
  # @option options [String] :expected_bucket_owner
247
- # The account ID of the expected bucket owner. If the bucket is owned by
248
- # a different account, the request fails with the HTTP status code `403
249
- # Forbidden` (access denied).
262
+ # The account ID of the expected bucket owner. If the account ID that
263
+ # you provide does not match the actual owner of the bucket, the request
264
+ # fails with the HTTP status code `403 Forbidden` (access denied).
265
+ # @option options [Time,DateTime,Date,Integer,String] :if_match_initiated_time
266
+ # If present, this header aborts an in progress multipart upload only if
267
+ # it was initiated on the provided timestamp. If the initiated timestamp
268
+ # of the multipart upload does not match the provided value, the
269
+ # operation returns a `412 Precondition Failed` error. If the initiated
270
+ # timestamp matches or if the multipart upload doesn’t exist, the
271
+ # operation returns a `204 Success (No Content)` response.
272
+ #
273
+ # <note markdown="1"> This functionality is only supported for directory buckets.
274
+ #
275
+ # </note>
250
276
  # @return [Types::AbortMultipartUploadOutput]
251
277
  def abort(options = {})
252
278
  options = options.merge(
@@ -254,7 +280,7 @@ module Aws::S3
254
280
  key: @object_key,
255
281
  upload_id: @id
256
282
  )
257
- resp = Aws::Plugins::UserAgent.feature('resource') do
283
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
258
284
  @client.abort_multipart_upload(options)
259
285
  end
260
286
  resp.data
@@ -281,6 +307,8 @@ module Aws::S3
281
307
  # checksum_sha256: "ChecksumSHA256",
282
308
  # request_payer: "requester", # accepts requester
283
309
  # expected_bucket_owner: "AccountId",
310
+ # if_match: "IfMatch",
311
+ # if_none_match: "IfNoneMatch",
284
312
  # sse_customer_algorithm: "SSECustomerAlgorithm",
285
313
  # sse_customer_key: "SSECustomerKey",
286
314
  # sse_customer_key_md5: "SSECustomerKeyMD5",
@@ -291,9 +319,9 @@ module Aws::S3
291
319
  # @option options [String] :checksum_crc32
292
320
  # This header can be used as a data integrity check to verify that the
293
321
  # data received is the same data that was originally sent. This header
294
- # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
295
- # more information, see [Checking object integrity][1] in the *Amazon S3
296
- # User Guide*.
322
+ # specifies the base64-encoded, 32-bit CRC-32 checksum of the object.
323
+ # For more information, see [Checking object integrity][1] in the
324
+ # *Amazon S3 User Guide*.
297
325
  #
298
326
  #
299
327
  #
@@ -301,7 +329,7 @@ module Aws::S3
301
329
  # @option options [String] :checksum_crc32c
302
330
  # This header can be used as a data integrity check to verify that the
303
331
  # data received is the same data that was originally sent. This header
304
- # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
332
+ # specifies the base64-encoded, 32-bit CRC-32C checksum of the object.
305
333
  # For more information, see [Checking object integrity][1] in the
306
334
  # *Amazon S3 User Guide*.
307
335
  #
@@ -331,34 +359,86 @@ module Aws::S3
331
359
  # @option options [String] :request_payer
332
360
  # Confirms that the requester knows that they will be charged for the
333
361
  # request. Bucket owners need not specify this parameter in their
334
- # requests. If either the source or destination Amazon S3 bucket has
335
- # Requester Pays enabled, the requester will pay for corresponding
336
- # charges to copy the object. For information about downloading objects
337
- # from Requester Pays buckets, see [Downloading Objects in Requester
338
- # Pays Buckets][1] in the *Amazon S3 User Guide*.
362
+ # requests. If either the source or destination S3 bucket has Requester
363
+ # Pays enabled, the requester will pay for corresponding charges to copy
364
+ # the object. For information about downloading objects from Requester
365
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
366
+ # in the *Amazon S3 User Guide*.
367
+ #
368
+ # <note markdown="1"> This functionality is not supported for directory buckets.
369
+ #
370
+ # </note>
339
371
  #
340
372
  #
341
373
  #
342
374
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
343
375
  # @option options [String] :expected_bucket_owner
344
- # The account ID of the expected bucket owner. If the bucket is owned by
345
- # a different account, the request fails with the HTTP status code `403
346
- # Forbidden` (access denied).
376
+ # The account ID of the expected bucket owner. If the account ID that
377
+ # you provide does not match the actual owner of the bucket, the request
378
+ # fails with the HTTP status code `403 Forbidden` (access denied).
379
+ # @option options [String] :if_match
380
+ # Uploads the object only if the ETag (entity tag) value provided during
381
+ # the WRITE operation matches the ETag of the object in S3. If the ETag
382
+ # values do not match, the operation returns a `412 Precondition Failed`
383
+ # error.
384
+ #
385
+ # If a conflicting operation occurs during the upload S3 returns a `409
386
+ # ConditionalRequestConflict` response. On a 409 failure you should
387
+ # fetch the object's ETag, re-initiate the multipart upload with
388
+ # `CreateMultipartUpload`, and re-upload each part.
389
+ #
390
+ # Expects the ETag value as a string.
391
+ #
392
+ # For more information about conditional requests, see [RFC 7232][1], or
393
+ # [Conditional requests][2] in the *Amazon S3 User Guide*.
394
+ #
395
+ #
396
+ #
397
+ # [1]: https://tools.ietf.org/html/rfc7232
398
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
399
+ # @option options [String] :if_none_match
400
+ # Uploads the object only if the object key name does not already exist
401
+ # in the bucket specified. Otherwise, Amazon S3 returns a `412
402
+ # Precondition Failed` error.
403
+ #
404
+ # If a conflicting operation occurs during the upload S3 returns a `409
405
+ # ConditionalRequestConflict` response. On a 409 failure you should
406
+ # re-initiate the multipart upload with `CreateMultipartUpload` and
407
+ # re-upload each part.
408
+ #
409
+ # Expects the '*' (asterisk) character.
410
+ #
411
+ # For more information about conditional requests, see [RFC 7232][1], or
412
+ # [Conditional requests][2] in the *Amazon S3 User Guide*.
413
+ #
414
+ #
415
+ #
416
+ # [1]: https://tools.ietf.org/html/rfc7232
417
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
347
418
  # @option options [String] :sse_customer_algorithm
348
419
  # The server-side encryption (SSE) algorithm used to encrypt the object.
349
- # This parameter is needed only when the object was created using a
350
- # checksum algorithm. For more information, see [Protecting data using
351
- # SSE-C keys][1] in the *Amazon S3 User Guide*.
420
+ # This parameter is required only when the object was created using a
421
+ # checksum algorithm or if your bucket policy requires the use of SSE-C.
422
+ # For more information, see [Protecting data using SSE-C keys][1] in the
423
+ # *Amazon S3 User Guide*.
352
424
  #
425
+ # <note markdown="1"> This functionality is not supported for directory buckets.
353
426
  #
427
+ # </note>
354
428
  #
355
- # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
429
+ #
430
+ #
431
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key
356
432
  # @option options [String] :sse_customer_key
357
433
  # The server-side encryption (SSE) customer managed key. This parameter
358
434
  # is needed only when the object was created using a checksum algorithm.
359
435
  # For more information, see [Protecting data using SSE-C keys][1] in the
360
436
  # *Amazon S3 User Guide*.
361
437
  #
438
+ # <note markdown="1"> This functionality is not supported for directory buckets.
439
+ #
440
+ # </note>
441
+ #
362
442
  #
363
443
  #
364
444
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
@@ -368,6 +448,10 @@ module Aws::S3
368
448
  # algorithm. For more information, see [Protecting data using SSE-C
369
449
  # keys][1] in the *Amazon S3 User Guide*.
370
450
  #
451
+ # <note markdown="1"> This functionality is not supported for directory buckets.
452
+ #
453
+ # </note>
454
+ #
371
455
  #
372
456
  #
373
457
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
@@ -378,7 +462,7 @@ module Aws::S3
378
462
  key: @object_key,
379
463
  upload_id: @id
380
464
  )
381
- Aws::Plugins::UserAgent.feature('resource') do
465
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
382
466
  @client.complete_multipart_upload(options)
383
467
  end
384
468
  Object.new(
@@ -424,25 +508,33 @@ module Aws::S3
424
508
  # @option options [String] :request_payer
425
509
  # Confirms that the requester knows that they will be charged for the
426
510
  # request. Bucket owners need not specify this parameter in their
427
- # requests. If either the source or destination Amazon S3 bucket has
428
- # Requester Pays enabled, the requester will pay for corresponding
429
- # charges to copy the object. For information about downloading objects
430
- # from Requester Pays buckets, see [Downloading Objects in Requester
431
- # Pays Buckets][1] in the *Amazon S3 User Guide*.
511
+ # requests. If either the source or destination S3 bucket has Requester
512
+ # Pays enabled, the requester will pay for corresponding charges to copy
513
+ # the object. For information about downloading objects from Requester
514
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
515
+ # in the *Amazon S3 User Guide*.
516
+ #
517
+ # <note markdown="1"> This functionality is not supported for directory buckets.
518
+ #
519
+ # </note>
432
520
  #
433
521
  #
434
522
  #
435
523
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
436
524
  # @option options [String] :expected_bucket_owner
437
- # The account ID of the expected bucket owner. If the bucket is owned by
438
- # a different account, the request fails with the HTTP status code `403
439
- # Forbidden` (access denied).
525
+ # The account ID of the expected bucket owner. If the account ID that
526
+ # you provide does not match the actual owner of the bucket, the request
527
+ # fails with the HTTP status code `403 Forbidden` (access denied).
440
528
  # @option options [String] :sse_customer_algorithm
441
529
  # The server-side encryption (SSE) algorithm used to encrypt the object.
442
530
  # This parameter is needed only when the object was created using a
443
531
  # checksum algorithm. For more information, see [Protecting data using
444
532
  # SSE-C keys][1] in the *Amazon S3 User Guide*.
445
533
  #
534
+ # <note markdown="1"> This functionality is not supported for directory buckets.
535
+ #
536
+ # </note>
537
+ #
446
538
  #
447
539
  #
448
540
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
@@ -452,6 +544,10 @@ module Aws::S3
452
544
  # For more information, see [Protecting data using SSE-C keys][1] in the
453
545
  # *Amazon S3 User Guide*.
454
546
  #
547
+ # <note markdown="1"> This functionality is not supported for directory buckets.
548
+ #
549
+ # </note>
550
+ #
455
551
  #
456
552
  #
457
553
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
@@ -461,6 +557,10 @@ module Aws::S3
461
557
  # algorithm. For more information, see [Protecting data using SSE-C
462
558
  # keys][1] in the *Amazon S3 User Guide*.
463
559
  #
560
+ # <note markdown="1"> This functionality is not supported for directory buckets.
561
+ #
562
+ # </note>
563
+ #
464
564
  #
465
565
  #
466
566
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
@@ -472,7 +572,7 @@ module Aws::S3
472
572
  key: @object_key,
473
573
  upload_id: @id
474
574
  )
475
- resp = Aws::Plugins::UserAgent.feature('resource') do
575
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
476
576
  @client.list_parts(options)
477
577
  end
478
578
  resp.each_page do |page|
@@ -542,3 +642,6 @@ module Aws::S3
542
642
  class Collection < Aws::Resources::Collection; end
543
643
  end
544
644
  end
645
+
646
+ # Load customizations if they exist
647
+ require 'aws-sdk-s3/customizations/multipart_upload'