aws-sdk-s3 1.96.2 → 1.132.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +256 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/bucket.rb +226 -76
  5. data/lib/aws-sdk-s3/bucket_acl.rb +30 -7
  6. data/lib/aws-sdk-s3/bucket_cors.rb +35 -10
  7. data/lib/aws-sdk-s3/bucket_lifecycle.rb +39 -12
  8. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +40 -10
  9. data/lib/aws-sdk-s3/bucket_logging.rb +30 -7
  10. data/lib/aws-sdk-s3/bucket_notification.rb +28 -10
  11. data/lib/aws-sdk-s3/bucket_policy.rb +35 -10
  12. data/lib/aws-sdk-s3/bucket_request_payment.rb +30 -7
  13. data/lib/aws-sdk-s3/bucket_tagging.rb +35 -10
  14. data/lib/aws-sdk-s3/bucket_versioning.rb +78 -17
  15. data/lib/aws-sdk-s3/bucket_website.rb +35 -10
  16. data/lib/aws-sdk-s3/client.rb +3854 -2120
  17. data/lib/aws-sdk-s3/client_api.rb +601 -208
  18. data/lib/aws-sdk-s3/customizations/bucket.rb +23 -47
  19. data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
  20. data/lib/aws-sdk-s3/customizations/object.rb +130 -24
  21. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  22. data/lib/aws-sdk-s3/customizations.rb +2 -0
  23. data/lib/aws-sdk-s3/encryption/client.rb +7 -3
  24. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
  25. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +13 -9
  26. data/lib/aws-sdk-s3/encryptionV2/client.rb +7 -3
  27. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +1 -4
  28. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +0 -4
  29. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -6
  30. data/lib/aws-sdk-s3/endpoint_parameters.rb +146 -0
  31. data/lib/aws-sdk-s3/endpoint_provider.rb +509 -0
  32. data/lib/aws-sdk-s3/endpoints.rb +2150 -0
  33. data/lib/aws-sdk-s3/file_downloader.rb +57 -27
  34. data/lib/aws-sdk-s3/file_uploader.rb +12 -5
  35. data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
  36. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +41 -13
  37. data/lib/aws-sdk-s3/multipart_upload.rb +138 -16
  38. data/lib/aws-sdk-s3/multipart_upload_part.rb +144 -18
  39. data/lib/aws-sdk-s3/object.rb +364 -160
  40. data/lib/aws-sdk-s3/object_acl.rb +32 -9
  41. data/lib/aws-sdk-s3/object_copier.rb +7 -5
  42. data/lib/aws-sdk-s3/object_multipart_copier.rb +41 -19
  43. data/lib/aws-sdk-s3/object_summary.rb +291 -123
  44. data/lib/aws-sdk-s3/object_version.rb +99 -46
  45. data/lib/aws-sdk-s3/plugins/accelerate.rb +3 -44
  46. data/lib/aws-sdk-s3/plugins/arn.rb +22 -180
  47. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
  48. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
  49. data/lib/aws-sdk-s3/plugins/dualstack.rb +1 -55
  50. data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
  51. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
  52. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +6 -29
  53. data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
  54. data/lib/aws-sdk-s3/plugins/s3_signer.rb +35 -100
  55. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  56. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
  57. data/lib/aws-sdk-s3/presigned_post.rb +99 -78
  58. data/lib/aws-sdk-s3/presigner.rb +24 -29
  59. data/lib/aws-sdk-s3/resource.rb +25 -3
  60. data/lib/aws-sdk-s3/types.rb +3307 -4625
  61. data/lib/aws-sdk-s3.rb +5 -1
  62. metadata +14 -11
  63. data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -69
  64. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +0 -69
  65. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -73
  66. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +0 -25
@@ -31,40 +31,61 @@ module Aws
31
31
  key: options[:key],
32
32
  }
33
33
  @params[:version_id] = options[:version_id] if options[:version_id]
34
-
35
- case @mode
36
- when 'auto' then multipart_download
37
- when 'single_request' then single_request
38
- when 'get_range'
39
- if @chunk_size
40
- resp = @client.head_object(@params)
41
- multithreaded_get_by_ranges(construct_chunks(resp.content_length))
34
+ @params[:checksum_mode] = options[:checksum_mode] || 'ENABLED'
35
+ @on_checksum_validated = options[:on_checksum_validated]
36
+
37
+ validate!
38
+
39
+ Aws::Plugins::UserAgent.feature('s3-transfer') do
40
+ case @mode
41
+ when 'auto' then multipart_download
42
+ when 'single_request' then single_request
43
+ when 'get_range'
44
+ if @chunk_size
45
+ resp = @client.head_object(@params)
46
+ multithreaded_get_by_ranges(construct_chunks(resp.content_length))
47
+ else
48
+ msg = 'In :get_range mode, :chunk_size must be provided'
49
+ raise ArgumentError, msg
50
+ end
42
51
  else
43
- msg = 'In :get_range mode, :chunk_size must be provided'
52
+ msg = "Invalid mode #{@mode} provided, "\
53
+ 'mode should be :single_request, :get_range or :auto'
44
54
  raise ArgumentError, msg
45
55
  end
46
- else
47
- msg = "Invalid mode #{@mode} provided, "\
48
- 'mode should be :single_request, :get_range or :auto'
49
- raise ArgumentError, msg
50
56
  end
51
57
  end
52
58
 
53
59
  private
54
60
 
61
+ def validate!
62
+ if @on_checksum_validated && @params[:checksum_mode] != 'ENABLED'
63
+ raise ArgumentError, "You must set checksum_mode: 'ENABLED' " +
64
+ "when providing a on_checksum_validated callback"
65
+ end
66
+
67
+ if @on_checksum_validated && !@on_checksum_validated.respond_to?(:call)
68
+ raise ArgumentError, 'on_checksum_validated must be callable'
69
+ end
70
+ end
71
+
55
72
  def multipart_download
56
73
  resp = @client.head_object(@params.merge(part_number: 1))
57
74
  count = resp.parts_count
58
75
  if count.nil? || count <= 1
59
- resp.content_length < MIN_CHUNK_SIZE ?
60
- single_request :
76
+ if resp.content_length <= MIN_CHUNK_SIZE
77
+ single_request
78
+ else
61
79
  multithreaded_get_by_ranges(construct_chunks(resp.content_length))
80
+ end
62
81
  else
63
82
  # partNumber is an option
64
83
  resp = @client.head_object(@params)
65
- resp.content_length < MIN_CHUNK_SIZE ?
66
- single_request :
84
+ if resp.content_length <= MIN_CHUNK_SIZE
85
+ single_request
86
+ else
67
87
  compute_mode(resp.content_length, count)
88
+ end
68
89
  end
69
90
  end
70
91
 
@@ -82,10 +103,11 @@ module Aws
82
103
  offset = 0
83
104
  default_chunk_size = compute_chunk(file_size)
84
105
  chunks = []
85
- while offset <= file_size
106
+ while offset < file_size
86
107
  progress = offset + default_chunk_size
87
- chunks << "bytes=#{offset}-#{progress < file_size ? progress : file_size}"
88
- offset = progress + 1
108
+ progress = file_size if progress > file_size
109
+ chunks << "bytes=#{offset}-#{progress - 1}"
110
+ offset = progress
89
111
  end
90
112
  chunks
91
113
  end
@@ -94,12 +116,9 @@ module Aws
94
116
  if @chunk_size && @chunk_size > file_size
95
117
  raise ArgumentError, ":chunk_size shouldn't exceed total file size."
96
118
  else
97
- chunk_size = @chunk_size || [
98
- (file_size.to_f / MAX_PARTS).ceil,
99
- MIN_CHUNK_SIZE
119
+ @chunk_size || [
120
+ (file_size.to_f / MAX_PARTS).ceil, MIN_CHUNK_SIZE
100
121
  ].max.to_i
101
- chunk_size -= 1 if file_size % chunk_size == 1
102
- chunk_size
103
122
  end
104
123
  end
105
124
 
@@ -125,6 +144,9 @@ module Aws
125
144
  @params.merge(param.to_sym => chunk)
126
145
  )
127
146
  write(resp)
147
+ if @on_checksum_validated && resp.checksum_validated
148
+ @on_checksum_validated.call(resp.checksum_validated, resp)
149
+ end
128
150
  end
129
151
  end
130
152
  threads.each(&:join)
@@ -134,13 +156,21 @@ module Aws
134
156
  def write(resp)
135
157
  range, _ = resp.content_range.split(' ').last.split('/')
136
158
  head, _ = range.split('-').map {|s| s.to_i}
137
- IO.write(@path, resp.body.read, head)
159
+ File.write(@path, resp.body.read, head)
138
160
  end
139
161
 
140
162
  def single_request
141
- @client.get_object(
163
+ resp = @client.get_object(
142
164
  @params.merge(response_target: @path)
143
165
  )
166
+
167
+ return resp unless @on_checksum_validated
168
+
169
+ if resp.checksum_validated
170
+ @on_checksum_validated.call(resp.checksum_validated, resp)
171
+ end
172
+
173
+ resp
144
174
  end
145
175
  end
146
176
  end
@@ -11,7 +11,7 @@ module Aws
11
11
 
12
12
  # @param [Hash] options
13
13
  # @option options [Client] :client
14
- # @option options [Integer] :multipart_threshold (15728640)
14
+ # @option options [Integer] :multipart_threshold (104857600)
15
15
  def initialize(options = {})
16
16
  @options = options
17
17
  @client = options[:client] || Client.new
@@ -32,12 +32,19 @@ module Aws
32
32
  # @option options [Proc] :progress_callback
33
33
  # A Proc that will be called when each chunk of the upload is sent.
34
34
  # It will be invoked with [bytes_read], [total_sizes]
35
+ # @option options [Integer] :thread_count
36
+ # The thread count to use for multipart uploads. Ignored for
37
+ # objects smaller than the multipart threshold.
35
38
  # @return [void]
36
39
  def upload(source, options = {})
37
- if File.size(source) >= multipart_threshold
38
- MultipartFileUploader.new(@options).upload(source, options)
39
- else
40
- put_object(source, options)
40
+ Aws::Plugins::UserAgent.feature('s3-transfer') do
41
+ if File.size(source) >= multipart_threshold
42
+ MultipartFileUploader.new(@options).upload(source, options)
43
+ else
44
+ # remove multipart parameters not supported by put_object
45
+ options.delete(:thread_count)
46
+ put_object(source, options)
47
+ end
41
48
  end
42
49
  end
43
50
 
@@ -21,6 +21,10 @@ module Aws
21
21
  Client.api.operation(:create_multipart_upload).input.shape.member_names
22
22
  )
23
23
 
24
+ COMPLETE_OPTIONS = Set.new(
25
+ Client.api.operation(:complete_multipart_upload).input.shape.member_names
26
+ )
27
+
24
28
  # @api private
25
29
  UPLOAD_PART_OPTIONS = Set.new(
26
30
  Client.api.operation(:upload_part).input.shape.member_names
@@ -42,7 +46,7 @@ module Aws
42
46
  # @option options [Proc] :progress_callback
43
47
  # A Proc that will be called when each chunk of the upload is sent.
44
48
  # It will be invoked with [bytes_read], [total_sizes]
45
- # @return [void]
49
+ # @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
46
50
  def upload(source, options = {})
47
51
  if File.size(source) < MIN_PART_SIZE
48
52
  raise ArgumentError, FILE_TOO_SMALL
@@ -61,10 +65,10 @@ module Aws
61
65
 
62
66
  def complete_upload(upload_id, parts, options)
63
67
  @client.complete_multipart_upload(
64
- bucket: options[:bucket],
65
- key: options[:key],
66
- upload_id: upload_id,
67
- multipart_upload: { parts: parts }
68
+ **complete_opts(options).merge(
69
+ upload_id: upload_id,
70
+ multipart_upload: { parts: parts }
71
+ )
68
72
  )
69
73
  end
70
74
 
@@ -123,6 +127,13 @@ module Aws
123
127
  end
124
128
  end
125
129
 
130
+ def complete_opts(options)
131
+ COMPLETE_OPTIONS.inject({}) do |hash, key|
132
+ hash[key] = options[key] if options.key?(key)
133
+ hash
134
+ end
135
+ end
136
+
126
137
  def upload_part_opts(options)
127
138
  UPLOAD_PART_OPTIONS.inject({}) do |hash, key|
128
139
  hash[key] = options[key] if options.key?(key)
@@ -147,7 +158,15 @@ module Aws
147
158
  end
148
159
  resp = @client.upload_part(part)
149
160
  part[:body].close
150
- completed.push(etag: resp.etag, part_number: part[:part_number])
161
+ completed_part = {etag: resp.etag, part_number: part[:part_number]}
162
+
163
+ # get the requested checksum from the response
164
+ if part[:checksum_algorithm]
165
+ k = "checksum_#{part[:checksum_algorithm].downcase}".to_sym
166
+ completed_part[k] = resp[k]
167
+ end
168
+
169
+ completed.push(completed_part)
151
170
  end
152
171
  nil
153
172
  rescue => error
@@ -224,4 +243,4 @@ module Aws
224
243
  end
225
244
  end
226
245
  end
227
- end
246
+ end
@@ -26,6 +26,10 @@ module Aws
26
26
  UPLOAD_PART_OPTIONS =
27
27
  Set.new(Client.api.operation(:upload_part).input.shape.member_names)
28
28
 
29
+ # @api private
30
+ COMPLETE_UPLOAD_OPTIONS =
31
+ Set.new(Client.api.operation(:complete_multipart_upload).input.shape.member_names)
32
+
29
33
  # @option options [Client] :client
30
34
  def initialize(options = {})
31
35
  @client = options[:client] || Client.new
@@ -39,11 +43,13 @@ module Aws
39
43
 
40
44
  # @option options [required,String] :bucket
41
45
  # @option options [required,String] :key
42
- # @return [void]
46
+ # @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
43
47
  def upload(options = {}, &block)
44
- upload_id = initiate_upload(options)
45
- parts = upload_parts(upload_id, options, &block)
46
- complete_upload(upload_id, parts, options)
48
+ Aws::Plugins::UserAgent.feature('s3-transfer') do
49
+ upload_id = initiate_upload(options)
50
+ parts = upload_parts(upload_id, options, &block)
51
+ complete_upload(upload_id, parts, options)
52
+ end
47
53
  end
48
54
 
49
55
  private
@@ -54,17 +60,22 @@ module Aws
54
60
 
55
61
  def complete_upload(upload_id, parts, options)
56
62
  @client.complete_multipart_upload(
57
- bucket: options[:bucket],
58
- key: options[:key],
59
- upload_id: upload_id,
60
- multipart_upload: { parts: parts })
63
+ **complete_opts(options).merge(
64
+ upload_id: upload_id,
65
+ multipart_upload: { parts: parts }
66
+ )
67
+ )
61
68
  end
62
69
 
63
70
  def upload_parts(upload_id, options, &block)
64
71
  completed = Queue.new
72
+ thread_errors = []
65
73
  errors = begin
66
74
  IO.pipe do |read_pipe, write_pipe|
67
- threads = upload_in_threads(read_pipe, completed, upload_part_opts(options).merge(upload_id: upload_id))
75
+ threads = upload_in_threads(
76
+ read_pipe, completed,
77
+ upload_part_opts(options).merge(upload_id: upload_id),
78
+ thread_errors)
68
79
  begin
69
80
  block.call(write_pipe)
70
81
  ensure
@@ -74,7 +85,7 @@ module Aws
74
85
  threads.map(&:value).compact
75
86
  end
76
87
  rescue => e
77
- [e]
88
+ thread_errors + [e]
78
89
  end
79
90
 
80
91
  if errors.empty?
@@ -113,6 +124,13 @@ module Aws
113
124
  end
114
125
  end
115
126
 
127
+ def complete_opts(options)
128
+ COMPLETE_UPLOAD_OPTIONS.inject({}) do |hash, key|
129
+ hash[key] = options[key] if options.key?(key)
130
+ hash
131
+ end
132
+ end
133
+
116
134
  def read_to_part_body(read_pipe)
117
135
  return if read_pipe.closed?
118
136
  temp_io = @tempfile ? Tempfile.new(TEMPFILE_PREIX) : StringIO.new(String.new)
@@ -130,7 +148,7 @@ module Aws
130
148
  end
131
149
  end
132
150
 
133
- def upload_in_threads(read_pipe, completed, options)
151
+ def upload_in_threads(read_pipe, completed, options, thread_errors)
134
152
  mutex = Mutex.new
135
153
  part_number = 0
136
154
  @thread_count.times.map do
@@ -147,7 +165,14 @@ module Aws
147
165
  part_number: thread_part_number,
148
166
  )
149
167
  resp = @client.upload_part(part)
150
- completed << {etag: resp.etag, part_number: part[:part_number]}
168
+ completed_part = {etag: resp.etag, part_number: part[:part_number]}
169
+
170
+ # get the requested checksum from the response
171
+ if part[:checksum_algorithm]
172
+ k = "checksum_#{part[:checksum_algorithm].downcase}".to_sym
173
+ completed_part[k] = resp[k]
174
+ end
175
+ completed.push(completed_part)
151
176
  ensure
152
177
  if Tempfile === body
153
178
  body.close
@@ -160,7 +185,10 @@ module Aws
160
185
  nil
161
186
  rescue => error
162
187
  # keep other threads from uploading other parts
163
- mutex.synchronize { read_pipe.close_read unless read_pipe.closed? }
188
+ mutex.synchronize do
189
+ thread_errors.push(error)
190
+ read_pipe.close_read unless read_pipe.closed?
191
+ end
164
192
  error
165
193
  end
166
194
  end
@@ -87,6 +87,12 @@ module Aws::S3
87
87
  data[:initiator]
88
88
  end
89
89
 
90
+ # The algorithm that was used to create a checksum of the object.
91
+ # @return [String]
92
+ def checksum_algorithm
93
+ data[:checksum_algorithm]
94
+ end
95
+
90
96
  # @!endgroup
91
97
 
92
98
  # @return [Client]
@@ -211,7 +217,9 @@ module Aws::S3
211
217
  :retry
212
218
  end
213
219
  end
214
- Aws::Waiters::Waiter.new(options).wait({})
220
+ Aws::Plugins::UserAgent.feature('resource') do
221
+ Aws::Waiters::Waiter.new(options).wait({})
222
+ end
215
223
  end
216
224
 
217
225
  # @!group Actions
@@ -226,8 +234,8 @@ module Aws::S3
226
234
  # @option options [String] :request_payer
227
235
  # Confirms that the requester knows that they will be charged for the
228
236
  # request. Bucket owners need not specify this parameter in their
229
- # requests. For information about downloading objects from requester
230
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
237
+ # requests. For information about downloading objects from Requester
238
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
231
239
  # in the *Amazon S3 User Guide*.
232
240
  #
233
241
  #
@@ -235,8 +243,8 @@ module Aws::S3
235
243
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
236
244
  # @option options [String] :expected_bucket_owner
237
245
  # The account ID of the expected bucket owner. If the bucket is owned by
238
- # a different account, the request will fail with an HTTP `403 (Access
239
- # Denied)` error.
246
+ # a different account, the request fails with the HTTP status code `403
247
+ # Forbidden` (access denied).
240
248
  # @return [Types::AbortMultipartUploadOutput]
241
249
  def abort(options = {})
242
250
  options = options.merge(
@@ -244,7 +252,9 @@ module Aws::S3
244
252
  key: @object_key,
245
253
  upload_id: @id
246
254
  )
247
- resp = @client.abort_multipart_upload(options)
255
+ resp = Aws::Plugins::UserAgent.feature('resource') do
256
+ @client.abort_multipart_upload(options)
257
+ end
248
258
  resp.data
249
259
  end
250
260
 
@@ -255,21 +265,72 @@ module Aws::S3
255
265
  # parts: [
256
266
  # {
257
267
  # etag: "ETag",
268
+ # checksum_crc32: "ChecksumCRC32",
269
+ # checksum_crc32c: "ChecksumCRC32C",
270
+ # checksum_sha1: "ChecksumSHA1",
271
+ # checksum_sha256: "ChecksumSHA256",
258
272
  # part_number: 1,
259
273
  # },
260
274
  # ],
261
275
  # },
276
+ # checksum_crc32: "ChecksumCRC32",
277
+ # checksum_crc32c: "ChecksumCRC32C",
278
+ # checksum_sha1: "ChecksumSHA1",
279
+ # checksum_sha256: "ChecksumSHA256",
262
280
  # request_payer: "requester", # accepts requester
263
281
  # expected_bucket_owner: "AccountId",
282
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
283
+ # sse_customer_key: "SSECustomerKey",
284
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
264
285
  # })
265
286
  # @param [Hash] options ({})
266
287
  # @option options [Types::CompletedMultipartUpload] :multipart_upload
267
288
  # The container for the multipart upload request information.
289
+ # @option options [String] :checksum_crc32
290
+ # This header can be used as a data integrity check to verify that the
291
+ # data received is the same data that was originally sent. This header
292
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
293
+ # more information, see [Checking object integrity][1] in the *Amazon S3
294
+ # User Guide*.
295
+ #
296
+ #
297
+ #
298
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
299
+ # @option options [String] :checksum_crc32c
300
+ # This header can be used as a data integrity check to verify that the
301
+ # data received is the same data that was originally sent. This header
302
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
303
+ # For more information, see [Checking object integrity][1] in the
304
+ # *Amazon S3 User Guide*.
305
+ #
306
+ #
307
+ #
308
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
309
+ # @option options [String] :checksum_sha1
310
+ # This header can be used as a data integrity check to verify that the
311
+ # data received is the same data that was originally sent. This header
312
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
313
+ # more information, see [Checking object integrity][1] in the *Amazon S3
314
+ # User Guide*.
315
+ #
316
+ #
317
+ #
318
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
319
+ # @option options [String] :checksum_sha256
320
+ # This header can be used as a data integrity check to verify that the
321
+ # data received is the same data that was originally sent. This header
322
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
323
+ # For more information, see [Checking object integrity][1] in the
324
+ # *Amazon S3 User Guide*.
325
+ #
326
+ #
327
+ #
328
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
268
329
  # @option options [String] :request_payer
269
330
  # Confirms that the requester knows that they will be charged for the
270
331
  # request. Bucket owners need not specify this parameter in their
271
- # requests. For information about downloading objects from requester
272
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
332
+ # requests. For information about downloading objects from Requester
333
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
273
334
  # in the *Amazon S3 User Guide*.
274
335
  #
275
336
  #
@@ -277,8 +338,35 @@ module Aws::S3
277
338
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
278
339
  # @option options [String] :expected_bucket_owner
279
340
  # The account ID of the expected bucket owner. If the bucket is owned by
280
- # a different account, the request will fail with an HTTP `403 (Access
281
- # Denied)` error.
341
+ # a different account, the request fails with the HTTP status code `403
342
+ # Forbidden` (access denied).
343
+ # @option options [String] :sse_customer_algorithm
344
+ # The server-side encryption (SSE) algorithm used to encrypt the object.
345
+ # This parameter is needed only when the object was created using a
346
+ # checksum algorithm. For more information, see [Protecting data using
347
+ # SSE-C keys][1] in the *Amazon S3 User Guide*.
348
+ #
349
+ #
350
+ #
351
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
352
+ # @option options [String] :sse_customer_key
353
+ # The server-side encryption (SSE) customer managed key. This parameter
354
+ # is needed only when the object was created using a checksum algorithm.
355
+ # For more information, see [Protecting data using SSE-C keys][1] in the
356
+ # *Amazon S3 User Guide*.
357
+ #
358
+ #
359
+ #
360
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
361
+ # @option options [String] :sse_customer_key_md5
362
+ # The MD5 server-side encryption (SSE) customer managed key. This
363
+ # parameter is needed only when the object was created using a checksum
364
+ # algorithm. For more information, see [Protecting data using SSE-C
365
+ # keys][1] in the *Amazon S3 User Guide*.
366
+ #
367
+ #
368
+ #
369
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
282
370
  # @return [Object]
283
371
  def complete(options = {})
284
372
  options = options.merge(
@@ -286,7 +374,9 @@ module Aws::S3
286
374
  key: @object_key,
287
375
  upload_id: @id
288
376
  )
289
- @client.complete_multipart_upload(options)
377
+ Aws::Plugins::UserAgent.feature('resource') do
378
+ @client.complete_multipart_upload(options)
379
+ end
290
380
  Object.new(
291
381
  bucket_name: @bucket_name,
292
382
  key: @object_key,
@@ -322,13 +412,16 @@ module Aws::S3
322
412
  # parts = multipart_upload.parts({
323
413
  # request_payer: "requester", # accepts requester
324
414
  # expected_bucket_owner: "AccountId",
415
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
416
+ # sse_customer_key: "SSECustomerKey",
417
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
325
418
  # })
326
419
  # @param [Hash] options ({})
327
420
  # @option options [String] :request_payer
328
421
  # Confirms that the requester knows that they will be charged for the
329
422
  # request. Bucket owners need not specify this parameter in their
330
- # requests. For information about downloading objects from requester
331
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
423
+ # requests. For information about downloading objects from Requester
424
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
332
425
  # in the *Amazon S3 User Guide*.
333
426
  #
334
427
  #
@@ -336,8 +429,35 @@ module Aws::S3
336
429
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
337
430
  # @option options [String] :expected_bucket_owner
338
431
  # The account ID of the expected bucket owner. If the bucket is owned by
339
- # a different account, the request will fail with an HTTP `403 (Access
340
- # Denied)` error.
432
+ # a different account, the request fails with the HTTP status code `403
433
+ # Forbidden` (access denied).
434
+ # @option options [String] :sse_customer_algorithm
435
+ # The server-side encryption (SSE) algorithm used to encrypt the object.
436
+ # This parameter is needed only when the object was created using a
437
+ # checksum algorithm. For more information, see [Protecting data using
438
+ # SSE-C keys][1] in the *Amazon S3 User Guide*.
439
+ #
440
+ #
441
+ #
442
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
443
+ # @option options [String] :sse_customer_key
444
+ # The server-side encryption (SSE) customer managed key. This parameter
445
+ # is needed only when the object was created using a checksum algorithm.
446
+ # For more information, see [Protecting data using SSE-C keys][1] in the
447
+ # *Amazon S3 User Guide*.
448
+ #
449
+ #
450
+ #
451
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
452
+ # @option options [String] :sse_customer_key_md5
453
+ # The MD5 server-side encryption (SSE) customer managed key. This
454
+ # parameter is needed only when the object was created using a checksum
455
+ # algorithm. For more information, see [Protecting data using SSE-C
456
+ # keys][1] in the *Amazon S3 User Guide*.
457
+ #
458
+ #
459
+ #
460
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
341
461
  # @return [MultipartUploadPart::Collection]
342
462
  def parts(options = {})
343
463
  batches = Enumerator.new do |y|
@@ -346,7 +466,9 @@ module Aws::S3
346
466
  key: @object_key,
347
467
  upload_id: @id
348
468
  )
349
- resp = @client.list_parts(options)
469
+ resp = Aws::Plugins::UserAgent.feature('resource') do
470
+ @client.list_parts(options)
471
+ end
350
472
  resp.each_page do |page|
351
473
  batch = []
352
474
  page.data.parts.each do |p|