aws-sdk-s3 1.61.1 → 1.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1255 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
  6. data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
  7. data/lib/aws-sdk-s3/bucket.rb +814 -112
  8. data/lib/aws-sdk-s3/bucket_acl.rb +54 -17
  9. data/lib/aws-sdk-s3/bucket_cors.rb +63 -20
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +63 -19
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +64 -19
  12. data/lib/aws-sdk-s3/bucket_logging.rb +58 -17
  13. data/lib/aws-sdk-s3/bucket_notification.rb +47 -20
  14. data/lib/aws-sdk-s3/bucket_policy.rb +104 -17
  15. data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
  16. data/lib/aws-sdk-s3/bucket_request_payment.rb +53 -19
  17. data/lib/aws-sdk-s3/bucket_tagging.rb +60 -17
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +106 -17
  19. data/lib/aws-sdk-s3/bucket_website.rb +64 -19
  20. data/lib/aws-sdk-s3/client.rb +11280 -3232
  21. data/lib/aws-sdk-s3/client_api.rb +1078 -197
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +33 -45
  23. data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
  24. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  25. data/lib/aws-sdk-s3/customizations/object.rb +237 -39
  26. data/lib/aws-sdk-s3/customizations/object_summary.rb +10 -0
  27. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  28. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  29. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  30. data/lib/aws-sdk-s3/customizations.rb +27 -28
  31. data/lib/aws-sdk-s3/encryption/client.rb +25 -8
  32. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  33. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  34. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  35. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  36. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  37. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  39. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  40. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  41. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
  42. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  43. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  44. data/lib/aws-sdk-s3/encryption.rb +4 -0
  45. data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
  46. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
  47. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  48. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  49. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  50. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  51. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  52. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  53. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  54. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  55. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
  56. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  57. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  58. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  59. data/lib/aws-sdk-s3/endpoint_parameters.rb +186 -0
  60. data/lib/aws-sdk-s3/endpoint_provider.rb +592 -0
  61. data/lib/aws-sdk-s3/endpoints.rb +2392 -0
  62. data/lib/aws-sdk-s3/errors.rb +27 -1
  63. data/lib/aws-sdk-s3/event_streams.rb +8 -1
  64. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  65. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  66. data/lib/aws-sdk-s3/file_downloader.rb +176 -44
  67. data/lib/aws-sdk-s3/file_part.rb +2 -0
  68. data/lib/aws-sdk-s3/file_uploader.rb +28 -8
  69. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  70. data/lib/aws-sdk-s3/multipart_file_uploader.rb +69 -13
  71. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +49 -18
  72. data/lib/aws-sdk-s3/multipart_upload.rb +242 -25
  73. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  74. data/lib/aws-sdk-s3/multipart_upload_part.rb +343 -31
  75. data/lib/aws-sdk-s3/object.rb +2240 -218
  76. data/lib/aws-sdk-s3/object_acl.rb +80 -21
  77. data/lib/aws-sdk-s3/object_copier.rb +9 -5
  78. data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -22
  79. data/lib/aws-sdk-s3/object_summary.rb +1900 -178
  80. data/lib/aws-sdk-s3/object_version.rb +449 -59
  81. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  82. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  83. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  84. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +5 -41
  85. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +3 -6
  86. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  87. data/lib/aws-sdk-s3/plugins/endpoints.rb +289 -0
  88. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  89. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
  90. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  91. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +60 -15
  92. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +11 -27
  93. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  94. data/lib/aws-sdk-s3/plugins/md5s.rb +32 -26
  95. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  96. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  97. data/lib/aws-sdk-s3/plugins/s3_signer.rb +50 -88
  98. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  99. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  100. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
  101. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  102. data/lib/aws-sdk-s3/presigned_post.rb +160 -103
  103. data/lib/aws-sdk-s3/presigner.rb +136 -61
  104. data/lib/aws-sdk-s3/resource.rb +120 -15
  105. data/lib/aws-sdk-s3/types.rb +9683 -4358
  106. data/lib/aws-sdk-s3/waiters.rb +67 -1
  107. data/lib/aws-sdk-s3.rb +40 -29
  108. data/sig/bucket.rbs +213 -0
  109. data/sig/bucket_acl.rbs +78 -0
  110. data/sig/bucket_cors.rbs +69 -0
  111. data/sig/bucket_lifecycle.rbs +88 -0
  112. data/sig/bucket_lifecycle_configuration.rbs +111 -0
  113. data/sig/bucket_logging.rbs +76 -0
  114. data/sig/bucket_notification.rbs +114 -0
  115. data/sig/bucket_policy.rbs +59 -0
  116. data/sig/bucket_request_payment.rbs +54 -0
  117. data/sig/bucket_tagging.rbs +65 -0
  118. data/sig/bucket_versioning.rbs +77 -0
  119. data/sig/bucket_website.rbs +93 -0
  120. data/sig/client.rbs +2397 -0
  121. data/sig/customizations/bucket.rbs +19 -0
  122. data/sig/customizations/object.rbs +38 -0
  123. data/sig/customizations/object_summary.rbs +35 -0
  124. data/sig/errors.rbs +34 -0
  125. data/sig/multipart_upload.rbs +111 -0
  126. data/sig/multipart_upload_part.rbs +105 -0
  127. data/sig/object.rbs +443 -0
  128. data/sig/object_acl.rbs +86 -0
  129. data/sig/object_summary.rbs +335 -0
  130. data/sig/object_version.rbs +137 -0
  131. data/sig/resource.rbs +130 -0
  132. data/sig/types.rbs +2585 -0
  133. data/sig/waiters.rbs +95 -0
  134. metadata +73 -15
  135. data/lib/aws-sdk-s3/plugins/bucket_arn.rb +0 -211
@@ -1,7 +1,9 @@
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
 
@@ -58,7 +60,9 @@ module Aws::S3
58
60
  #
59
61
  # @return [self]
60
62
  def load
61
- resp = @client.get_bucket_acl(bucket: @bucket_name)
63
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
64
+ @client.get_bucket_acl(bucket: @bucket_name)
65
+ end
62
66
  @data = resp.data
63
67
  self
64
68
  end
@@ -84,7 +88,8 @@ module Aws::S3
84
88
  # Waiter polls an API operation until a resource enters a desired
85
89
  # state.
86
90
  #
87
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
91
+ # @note The waiting operation is performed on a copy. The original resource
92
+ # remains unchanged.
88
93
  #
89
94
  # ## Basic Usage
90
95
  #
@@ -97,13 +102,15 @@ module Aws::S3
97
102
  #
98
103
  # ## Example
99
104
  #
100
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
105
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
106
+ # instance.state.name == 'running'
107
+ # end
101
108
  #
102
109
  # ## Configuration
103
110
  #
104
111
  # You can configure the maximum number of polling attempts, and the
105
- # delay (in seconds) between each polling attempt. The waiting condition is set
106
- # by passing a block to {#wait_until}:
112
+ # delay (in seconds) between each polling attempt. The waiting condition is
113
+ # set by passing a block to {#wait_until}:
107
114
  #
108
115
  # # poll for ~25 seconds
109
116
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -134,17 +141,16 @@ module Aws::S3
134
141
  # # resource did not enter the desired state in time
135
142
  # end
136
143
  #
144
+ # @yieldparam [Resource] resource to be used in the waiting condition.
137
145
  #
138
- # @yield param [Resource] resource to be used in the waiting condition
139
- #
140
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
141
- # because the waiter has entered a state that it will not transition
142
- # out of, preventing success.
146
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
147
+ # terminates because the waiter has entered a state that it will not
148
+ # transition out of, preventing success.
143
149
  #
144
150
  # yet successful.
145
151
  #
146
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
147
- # while polling for a resource that is not expected.
152
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
153
+ # encountered while polling for a resource that is not expected.
148
154
  #
149
155
  # @raise [NotImplementedError] Raised when the resource does not
150
156
  #
@@ -171,7 +177,9 @@ module Aws::S3
171
177
  :retry
172
178
  end
173
179
  end
174
- Aws::Waiters::Waiter.new(options).wait({})
180
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
181
+ Aws::Waiters::Waiter.new(options).wait({})
182
+ end
175
183
  end
176
184
 
177
185
  # @!group Actions
@@ -199,11 +207,13 @@ module Aws::S3
199
207
  # },
200
208
  # },
201
209
  # content_md5: "ContentMD5",
210
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
202
211
  # grant_full_control: "GrantFullControl",
203
212
  # grant_read: "GrantRead",
204
213
  # grant_read_acp: "GrantReadACP",
205
214
  # grant_write: "GrantWrite",
206
215
  # grant_write_acp: "GrantWriteACP",
216
+ # expected_bucket_owner: "AccountId",
207
217
  # })
208
218
  # @param [Hash] options ({})
209
219
  # @option options [String] :acl
@@ -216,9 +226,28 @@ module Aws::S3
216
226
  # used as a message integrity check to verify that the request body was
217
227
  # not corrupted in transit. For more information, go to [RFC 1864.][1]
218
228
  #
229
+ # For requests made using the Amazon Web Services Command Line Interface
230
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
231
+ # automatically.
232
+ #
219
233
  #
220
234
  #
221
235
  # [1]: http://www.ietf.org/rfc/rfc1864.txt
236
+ # @option options [String] :checksum_algorithm
237
+ # Indicates the algorithm used to create the checksum for the object
238
+ # when you use the SDK. This header will not provide any additional
239
+ # functionality if you don't use the SDK. When you send this header,
240
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
241
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
242
+ # status code `400 Bad Request`. For more information, see [Checking
243
+ # object integrity][1] in the *Amazon S3 User Guide*.
244
+ #
245
+ # If you provide an individual checksum, Amazon S3 ignores any provided
246
+ # `ChecksumAlgorithm` parameter.
247
+ #
248
+ #
249
+ #
250
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
222
251
  # @option options [String] :grant_full_control
223
252
  # Allows grantee the read, write, read ACP, and write ACP permissions on
224
253
  # the bucket.
@@ -227,14 +256,22 @@ module Aws::S3
227
256
  # @option options [String] :grant_read_acp
228
257
  # Allows grantee to read the bucket ACL.
229
258
  # @option options [String] :grant_write
230
- # Allows grantee to create, overwrite, and delete any object in the
231
- # bucket.
259
+ # Allows grantee to create new objects in the bucket.
260
+ #
261
+ # For the bucket and object owners of existing objects, also allows
262
+ # deletions and overwrites of those objects.
232
263
  # @option options [String] :grant_write_acp
233
264
  # Allows grantee to write the ACL for the applicable bucket.
265
+ # @option options [String] :expected_bucket_owner
266
+ # The account ID of the expected bucket owner. If the account ID that
267
+ # you provide does not match the actual owner of the bucket, the request
268
+ # fails with the HTTP status code `403 Forbidden` (access denied).
234
269
  # @return [EmptyStructure]
235
270
  def put(options = {})
236
271
  options = options.merge(bucket: @bucket_name)
237
- resp = @client.put_bucket_acl(options)
272
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
273
+ @client.put_bucket_acl(options)
274
+ end
238
275
  resp.data
239
276
  end
240
277
 
@@ -1,7 +1,9 @@
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
 
@@ -53,7 +55,9 @@ module Aws::S3
53
55
  #
54
56
  # @return [self]
55
57
  def load
56
- resp = @client.get_bucket_cors(bucket: @bucket_name)
58
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
59
+ @client.get_bucket_cors(bucket: @bucket_name)
60
+ end
57
61
  @data = resp.data
58
62
  self
59
63
  end
@@ -79,7 +83,8 @@ module Aws::S3
79
83
  # Waiter polls an API operation until a resource enters a desired
80
84
  # state.
81
85
  #
82
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
86
+ # @note The waiting operation is performed on a copy. The original resource
87
+ # remains unchanged.
83
88
  #
84
89
  # ## Basic Usage
85
90
  #
@@ -92,13 +97,15 @@ module Aws::S3
92
97
  #
93
98
  # ## Example
94
99
  #
95
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
100
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
101
+ # instance.state.name == 'running'
102
+ # end
96
103
  #
97
104
  # ## Configuration
98
105
  #
99
106
  # You can configure the maximum number of polling attempts, and the
100
- # delay (in seconds) between each polling attempt. The waiting condition is set
101
- # by passing a block to {#wait_until}:
107
+ # delay (in seconds) between each polling attempt. The waiting condition is
108
+ # set by passing a block to {#wait_until}:
102
109
  #
103
110
  # # poll for ~25 seconds
104
111
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -129,17 +136,16 @@ module Aws::S3
129
136
  # # resource did not enter the desired state in time
130
137
  # end
131
138
  #
139
+ # @yieldparam [Resource] resource to be used in the waiting condition.
132
140
  #
133
- # @yield param [Resource] resource to be used in the waiting condition
134
- #
135
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
136
- # because the waiter has entered a state that it will not transition
137
- # out of, preventing success.
141
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
142
+ # terminates because the waiter has entered a state that it will not
143
+ # transition out of, preventing success.
138
144
  #
139
145
  # yet successful.
140
146
  #
141
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
142
- # while polling for a resource that is not expected.
147
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
148
+ # encountered while polling for a resource that is not expected.
143
149
  #
144
150
  # @raise [NotImplementedError] Raised when the resource does not
145
151
  #
@@ -166,19 +172,29 @@ module Aws::S3
166
172
  :retry
167
173
  end
168
174
  end
169
- Aws::Waiters::Waiter.new(options).wait({})
175
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
176
+ Aws::Waiters::Waiter.new(options).wait({})
177
+ end
170
178
  end
171
179
 
172
180
  # @!group Actions
173
181
 
174
182
  # @example Request syntax with placeholder values
175
183
  #
176
- # bucket_cors.delete()
184
+ # bucket_cors.delete({
185
+ # expected_bucket_owner: "AccountId",
186
+ # })
177
187
  # @param [Hash] options ({})
188
+ # @option options [String] :expected_bucket_owner
189
+ # The account ID of the expected bucket owner. If the account ID that
190
+ # you provide does not match the actual owner of the bucket, the request
191
+ # fails with the HTTP status code `403 Forbidden` (access denied).
178
192
  # @return [EmptyStructure]
179
193
  def delete(options = {})
180
194
  options = options.merge(bucket: @bucket_name)
181
- resp = @client.delete_bucket_cors(options)
195
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
196
+ @client.delete_bucket_cors(options)
197
+ end
182
198
  resp.data
183
199
  end
184
200
 
@@ -188,6 +204,7 @@ module Aws::S3
188
204
  # cors_configuration: { # required
189
205
  # cors_rules: [ # required
190
206
  # {
207
+ # id: "ID",
191
208
  # allowed_headers: ["AllowedHeader"],
192
209
  # allowed_methods: ["AllowedMethod"], # required
193
210
  # allowed_origins: ["AllowedOrigin"], # required
@@ -197,29 +214,55 @@ module Aws::S3
197
214
  # ],
198
215
  # },
199
216
  # content_md5: "ContentMD5",
217
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
218
+ # expected_bucket_owner: "AccountId",
200
219
  # })
201
220
  # @param [Hash] options ({})
202
221
  # @option options [required, Types::CORSConfiguration] :cors_configuration
203
222
  # Describes the cross-origin access configuration for objects in an
204
223
  # Amazon S3 bucket. For more information, see [Enabling Cross-Origin
205
- # Resource Sharing][1] in the *Amazon Simple Storage Service Developer
206
- # Guide*.
224
+ # Resource Sharing][1] in the *Amazon S3 User Guide*.
207
225
  #
208
226
  #
209
227
  #
210
- # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html
228
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html
211
229
  # @option options [String] :content_md5
212
230
  # The base64-encoded 128-bit MD5 digest of the data. This header must be
213
231
  # used as a message integrity check to verify that the request body was
214
232
  # not corrupted in transit. For more information, go to [RFC 1864.][1]
215
233
  #
234
+ # For requests made using the Amazon Web Services Command Line Interface
235
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
236
+ # automatically.
237
+ #
216
238
  #
217
239
  #
218
240
  # [1]: http://www.ietf.org/rfc/rfc1864.txt
241
+ # @option options [String] :checksum_algorithm
242
+ # Indicates the algorithm used to create the checksum for the object
243
+ # when you use the SDK. This header will not provide any additional
244
+ # functionality if you don't use the SDK. When you send this header,
245
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
246
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
247
+ # status code `400 Bad Request`. For more information, see [Checking
248
+ # object integrity][1] in the *Amazon S3 User Guide*.
249
+ #
250
+ # If you provide an individual checksum, Amazon S3 ignores any provided
251
+ # `ChecksumAlgorithm` parameter.
252
+ #
253
+ #
254
+ #
255
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
256
+ # @option options [String] :expected_bucket_owner
257
+ # The account ID of the expected bucket owner. If the account ID that
258
+ # you provide does not match the actual owner of the bucket, the request
259
+ # fails with the HTTP status code `403 Forbidden` (access denied).
219
260
  # @return [EmptyStructure]
220
261
  def put(options = {})
221
262
  options = options.merge(bucket: @bucket_name)
222
- resp = @client.put_bucket_cors(options)
263
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
264
+ @client.put_bucket_cors(options)
265
+ end
223
266
  resp.data
224
267
  end
225
268
 
@@ -1,7 +1,9 @@
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
 
@@ -52,7 +54,9 @@ module Aws::S3
52
54
  #
53
55
  # @return [self]
54
56
  def load
55
- resp = @client.get_bucket_lifecycle(bucket: @bucket_name)
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
+ @client.get_bucket_lifecycle(bucket: @bucket_name)
59
+ end
56
60
  @data = resp.data
57
61
  self
58
62
  end
@@ -78,7 +82,8 @@ module Aws::S3
78
82
  # Waiter polls an API operation until a resource enters a desired
79
83
  # state.
80
84
  #
81
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
85
+ # @note The waiting operation is performed on a copy. The original resource
86
+ # remains unchanged.
82
87
  #
83
88
  # ## Basic Usage
84
89
  #
@@ -91,13 +96,15 @@ module Aws::S3
91
96
  #
92
97
  # ## Example
93
98
  #
94
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
99
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
100
+ # instance.state.name == 'running'
101
+ # end
95
102
  #
96
103
  # ## Configuration
97
104
  #
98
105
  # You can configure the maximum number of polling attempts, and the
99
- # delay (in seconds) between each polling attempt. The waiting condition is set
100
- # by passing a block to {#wait_until}:
106
+ # delay (in seconds) between each polling attempt. The waiting condition is
107
+ # set by passing a block to {#wait_until}:
101
108
  #
102
109
  # # poll for ~25 seconds
103
110
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -128,17 +135,16 @@ module Aws::S3
128
135
  # # resource did not enter the desired state in time
129
136
  # end
130
137
  #
138
+ # @yieldparam [Resource] resource to be used in the waiting condition.
131
139
  #
132
- # @yield param [Resource] resource to be used in the waiting condition
133
- #
134
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
135
- # because the waiter has entered a state that it will not transition
136
- # out of, preventing success.
140
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
141
+ # terminates because the waiter has entered a state that it will not
142
+ # transition out of, preventing success.
137
143
  #
138
144
  # yet successful.
139
145
  #
140
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
141
- # while polling for a resource that is not expected.
146
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
147
+ # encountered while polling for a resource that is not expected.
142
148
  #
143
149
  # @raise [NotImplementedError] Raised when the resource does not
144
150
  #
@@ -165,19 +171,29 @@ module Aws::S3
165
171
  :retry
166
172
  end
167
173
  end
168
- Aws::Waiters::Waiter.new(options).wait({})
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
175
+ Aws::Waiters::Waiter.new(options).wait({})
176
+ end
169
177
  end
170
178
 
171
179
  # @!group Actions
172
180
 
173
181
  # @example Request syntax with placeholder values
174
182
  #
175
- # bucket_lifecycle.delete()
183
+ # bucket_lifecycle.delete({
184
+ # expected_bucket_owner: "AccountId",
185
+ # })
176
186
  # @param [Hash] options ({})
187
+ # @option options [String] :expected_bucket_owner
188
+ # The account ID of the expected bucket owner. If the account ID that
189
+ # you provide does not match the actual owner of the bucket, the request
190
+ # fails with the HTTP status code `403 Forbidden` (access denied).
177
191
  # @return [EmptyStructure]
178
192
  def delete(options = {})
179
193
  options = options.merge(bucket: @bucket_name)
180
- resp = @client.delete_bucket_lifecycle(options)
194
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
195
+ @client.delete_bucket_lifecycle(options)
196
+ end
181
197
  resp.data
182
198
  end
183
199
 
@@ -185,6 +201,7 @@ module Aws::S3
185
201
  #
186
202
  # bucket_lifecycle.put({
187
203
  # content_md5: "ContentMD5",
204
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
188
205
  # lifecycle_configuration: {
189
206
  # rules: [ # required
190
207
  # {
@@ -199,14 +216,16 @@ module Aws::S3
199
216
  # transition: {
200
217
  # date: Time.now,
201
218
  # days: 1,
202
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
219
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
203
220
  # },
204
221
  # noncurrent_version_transition: {
205
222
  # noncurrent_days: 1,
206
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
223
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
224
+ # newer_noncurrent_versions: 1,
207
225
  # },
208
226
  # noncurrent_version_expiration: {
209
227
  # noncurrent_days: 1,
228
+ # newer_noncurrent_versions: 1,
210
229
  # },
211
230
  # abort_incomplete_multipart_upload: {
212
231
  # days_after_initiation: 1,
@@ -214,14 +233,39 @@ module Aws::S3
214
233
  # },
215
234
  # ],
216
235
  # },
236
+ # expected_bucket_owner: "AccountId",
217
237
  # })
218
238
  # @param [Hash] options ({})
219
239
  # @option options [String] :content_md5
240
+ # For requests made using the Amazon Web Services Command Line Interface
241
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
242
+ # automatically.
243
+ # @option options [String] :checksum_algorithm
244
+ # Indicates the algorithm used to create the checksum for the object
245
+ # when you use the SDK. This header will not provide any additional
246
+ # functionality if you don't use the SDK. When you send this header,
247
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
248
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
249
+ # status code `400 Bad Request`. For more information, see [Checking
250
+ # object integrity][1] in the *Amazon S3 User Guide*.
251
+ #
252
+ # If you provide an individual checksum, Amazon S3 ignores any provided
253
+ # `ChecksumAlgorithm` parameter.
254
+ #
255
+ #
256
+ #
257
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
220
258
  # @option options [Types::LifecycleConfiguration] :lifecycle_configuration
259
+ # @option options [String] :expected_bucket_owner
260
+ # The account ID of the expected bucket owner. If the account ID that
261
+ # you provide does not match the actual owner of the bucket, the request
262
+ # fails with the HTTP status code `403 Forbidden` (access denied).
221
263
  # @return [EmptyStructure]
222
264
  def put(options = {})
223
265
  options = options.merge(bucket: @bucket_name)
224
- resp = @client.put_bucket_lifecycle(options)
266
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
267
+ @client.put_bucket_lifecycle(options)
268
+ end
225
269
  resp.data
226
270
  end
227
271