aws-sdk-s3 1.10.0 → 1.208.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1517 -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 +1062 -99
  8. data/lib/aws-sdk-s3/bucket_acl.rb +67 -17
  9. data/lib/aws-sdk-s3/bucket_cors.rb +80 -17
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -19
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -20
  12. data/lib/aws-sdk-s3/bucket_logging.rb +68 -18
  13. data/lib/aws-sdk-s3/bucket_notification.rb +56 -20
  14. data/lib/aws-sdk-s3/bucket_policy.rb +108 -17
  15. data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
  16. data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
  17. data/lib/aws-sdk-s3/bucket_tagging.rb +71 -17
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +166 -17
  19. data/lib/aws-sdk-s3/bucket_website.rb +78 -17
  20. data/lib/aws-sdk-s3/client.rb +20068 -3879
  21. data/lib/aws-sdk-s3/client_api.rb +1957 -209
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +57 -38
  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 +338 -68
  26. data/lib/aws-sdk-s3/customizations/object_summary.rb +17 -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 +30 -27
  31. data/lib/aws-sdk-s3/default_executor.rb +103 -0
  32. data/lib/aws-sdk-s3/encryption/client.rb +29 -8
  33. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  34. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +45 -5
  35. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  36. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +15 -2
  37. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +11 -3
  39. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  40. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  41. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  42. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +48 -11
  43. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  44. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  45. data/lib/aws-sdk-s3/encryption.rb +4 -0
  46. data/lib/aws-sdk-s3/encryptionV2/client.rb +645 -0
  47. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +68 -0
  48. data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
  49. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +187 -0
  50. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  51. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +67 -0
  52. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  53. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  54. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  55. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +75 -0
  56. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  57. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +181 -0
  58. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  59. data/lib/aws-sdk-s3/encryptionV2/utils.rb +108 -0
  60. data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
  61. data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
  62. data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
  63. data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
  64. data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
  65. data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
  66. data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
  67. data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
  68. data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
  69. data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
  70. data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
  71. data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
  72. data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
  73. data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
  74. data/lib/aws-sdk-s3/encryption_v2.rb +24 -0
  75. data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
  76. data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
  77. data/lib/aws-sdk-s3/endpoint_provider.rb +886 -0
  78. data/lib/aws-sdk-s3/endpoints.rb +1544 -0
  79. data/lib/aws-sdk-s3/errors.rb +181 -1
  80. data/lib/aws-sdk-s3/event_streams.rb +69 -0
  81. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  82. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  83. data/lib/aws-sdk-s3/file_downloader.rb +261 -82
  84. data/lib/aws-sdk-s3/file_part.rb +16 -13
  85. data/lib/aws-sdk-s3/file_uploader.rb +37 -22
  86. data/lib/aws-sdk-s3/legacy_signer.rb +19 -26
  87. data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
  88. data/lib/aws-sdk-s3/multipart_file_uploader.rb +142 -80
  89. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +191 -0
  90. data/lib/aws-sdk-s3/multipart_upload.rb +342 -31
  91. data/lib/aws-sdk-s3/multipart_upload_error.rb +5 -4
  92. data/lib/aws-sdk-s3/multipart_upload_part.rb +387 -47
  93. data/lib/aws-sdk-s3/object.rb +2733 -204
  94. data/lib/aws-sdk-s3/object_acl.rb +112 -25
  95. data/lib/aws-sdk-s3/object_copier.rb +9 -5
  96. data/lib/aws-sdk-s3/object_multipart_copier.rb +50 -23
  97. data/lib/aws-sdk-s3/object_summary.rb +2265 -181
  98. data/lib/aws-sdk-s3/object_version.rb +542 -74
  99. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  100. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  101. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  102. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
  103. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  104. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
  105. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  106. data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
  107. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  108. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
  109. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  110. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
  111. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  112. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  113. data/lib/aws-sdk-s3/plugins/md5s.rb +14 -67
  114. data/lib/aws-sdk-s3/plugins/redirects.rb +5 -1
  115. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  116. data/lib/aws-sdk-s3/plugins/s3_signer.rb +67 -93
  117. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  118. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +137 -0
  119. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +4 -1
  120. data/lib/aws-sdk-s3/presigned_post.rb +160 -99
  121. data/lib/aws-sdk-s3/presigner.rb +178 -81
  122. data/lib/aws-sdk-s3/resource.rb +164 -15
  123. data/lib/aws-sdk-s3/transfer_manager.rb +303 -0
  124. data/lib/aws-sdk-s3/types.rb +15981 -4168
  125. data/lib/aws-sdk-s3/waiters.rb +67 -1
  126. data/lib/aws-sdk-s3.rb +46 -31
  127. data/sig/bucket.rbs +231 -0
  128. data/sig/bucket_acl.rbs +78 -0
  129. data/sig/bucket_cors.rbs +69 -0
  130. data/sig/bucket_lifecycle.rbs +88 -0
  131. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  132. data/sig/bucket_logging.rbs +76 -0
  133. data/sig/bucket_notification.rbs +114 -0
  134. data/sig/bucket_policy.rbs +59 -0
  135. data/sig/bucket_request_payment.rbs +54 -0
  136. data/sig/bucket_tagging.rbs +65 -0
  137. data/sig/bucket_versioning.rbs +77 -0
  138. data/sig/bucket_website.rbs +93 -0
  139. data/sig/client.rbs +2612 -0
  140. data/sig/customizations/bucket.rbs +19 -0
  141. data/sig/customizations/object.rbs +38 -0
  142. data/sig/customizations/object_summary.rbs +35 -0
  143. data/sig/errors.rbs +44 -0
  144. data/sig/multipart_upload.rbs +120 -0
  145. data/sig/multipart_upload_part.rbs +109 -0
  146. data/sig/object.rbs +464 -0
  147. data/sig/object_acl.rbs +86 -0
  148. data/sig/object_summary.rbs +347 -0
  149. data/sig/object_version.rbs +143 -0
  150. data/sig/resource.rbs +141 -0
  151. data/sig/types.rbs +2899 -0
  152. data/sig/waiters.rbs +95 -0
  153. metadata +97 -14
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/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 BucketLifecycleConfiguration
10
13
 
11
14
  extend Aws::Deprecations
@@ -21,6 +24,7 @@ module Aws::S3
21
24
  @bucket_name = extract_bucket_name(args, options)
22
25
  @data = options.delete(:data)
23
26
  @client = options.delete(:client) || Client.new(options)
27
+ @waiter_block_warned = false
24
28
  end
25
29
 
26
30
  # @!group Read-Only Attributes
@@ -30,11 +34,37 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
37
+ # Container for a lifecycle rule.
33
38
  # @return [Array<Types::LifecycleRule>]
34
39
  def rules
35
40
  data[:rules]
36
41
  end
37
42
 
43
+ # Indicates which default minimum object size behavior is applied to the
44
+ # lifecycle configuration.
45
+ #
46
+ # <note markdown="1"> This parameter applies to general purpose buckets only. It isn't
47
+ # supported for directory bucket lifecycle configurations.
48
+ #
49
+ # </note>
50
+ #
51
+ # * `all_storage_classes_128K` - Objects smaller than 128 KB will not
52
+ # transition to any storage class by default.
53
+ #
54
+ # * `varies_by_storage_class` - Objects smaller than 128 KB will
55
+ # transition to Glacier Flexible Retrieval or Glacier Deep Archive
56
+ # storage classes. By default, all other storage classes will prevent
57
+ # transitions smaller than 128 KB.
58
+ #
59
+ # To customize the minimum object size for any transition you can add a
60
+ # filter that specifies a custom `ObjectSizeGreaterThan` or
61
+ # `ObjectSizeLessThan` in the body of your transition rule. Custom
62
+ # filters always take precedence over the default transition behavior.
63
+ # @return [String]
64
+ def transition_default_minimum_object_size
65
+ data[:transition_default_minimum_object_size]
66
+ end
67
+
38
68
  # @!endgroup
39
69
 
40
70
  # @return [Client]
@@ -49,7 +79,9 @@ module Aws::S3
49
79
  #
50
80
  # @return [self]
51
81
  def load
52
- resp = @client.get_bucket_lifecycle_configuration(bucket: @bucket_name)
82
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
83
+ @client.get_bucket_lifecycle_configuration(bucket: @bucket_name)
84
+ end
53
85
  @data = resp.data
54
86
  self
55
87
  end
@@ -75,7 +107,8 @@ module Aws::S3
75
107
  # Waiter polls an API operation until a resource enters a desired
76
108
  # state.
77
109
  #
78
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
110
+ # @note The waiting operation is performed on a copy. The original resource
111
+ # remains unchanged.
79
112
  #
80
113
  # ## Basic Usage
81
114
  #
@@ -88,13 +121,15 @@ module Aws::S3
88
121
  #
89
122
  # ## Example
90
123
  #
91
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
124
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
125
+ # instance.state.name == 'running'
126
+ # end
92
127
  #
93
128
  # ## Configuration
94
129
  #
95
130
  # You can configure the maximum number of polling attempts, and the
96
- # delay (in seconds) between each polling attempt. The waiting condition is set
97
- # by passing a block to {#wait_until}:
131
+ # delay (in seconds) between each polling attempt. The waiting condition is
132
+ # set by passing a block to {#wait_until}:
98
133
  #
99
134
  # # poll for ~25 seconds
100
135
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -125,17 +160,16 @@ module Aws::S3
125
160
  # # resource did not enter the desired state in time
126
161
  # end
127
162
  #
163
+ # @yieldparam [Resource] resource to be used in the waiting condition.
128
164
  #
129
- # @yield param [Resource] resource to be used in the waiting condition
130
- #
131
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
132
- # because the waiter has entered a state that it will not transition
133
- # out of, preventing success.
165
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
166
+ # terminates because the waiter has entered a state that it will not
167
+ # transition out of, preventing success.
134
168
  #
135
169
  # yet successful.
136
170
  #
137
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
- # while polling for a resource that is not expected.
171
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
172
+ # encountered while polling for a resource that is not expected.
139
173
  #
140
174
  # @raise [NotImplementedError] Raised when the resource does not
141
175
  #
@@ -162,25 +196,41 @@ module Aws::S3
162
196
  :retry
163
197
  end
164
198
  end
165
- Aws::Waiters::Waiter.new(options).wait({})
199
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
200
+ Aws::Waiters::Waiter.new(options).wait({})
201
+ end
166
202
  end
167
203
 
168
204
  # @!group Actions
169
205
 
170
206
  # @example Request syntax with placeholder values
171
207
  #
172
- # bucket_lifecycle_configuration.delete()
208
+ # bucket_lifecycle_configuration.delete({
209
+ # expected_bucket_owner: "AccountId",
210
+ # })
173
211
  # @param [Hash] options ({})
212
+ # @option options [String] :expected_bucket_owner
213
+ # The account ID of the expected bucket owner. If the account ID that
214
+ # you provide does not match the actual owner of the bucket, the request
215
+ # fails with the HTTP status code `403 Forbidden` (access denied).
216
+ #
217
+ # <note markdown="1"> This parameter applies to general purpose buckets only. It is not
218
+ # supported for directory bucket lifecycle configurations.
219
+ #
220
+ # </note>
174
221
  # @return [EmptyStructure]
175
222
  def delete(options = {})
176
223
  options = options.merge(bucket: @bucket_name)
177
- resp = @client.delete_bucket_lifecycle(options)
224
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
225
+ @client.delete_bucket_lifecycle(options)
226
+ end
178
227
  resp.data
179
228
  end
180
229
 
181
230
  # @example Request syntax with placeholder values
182
231
  #
183
232
  # bucket_lifecycle_configuration.put({
233
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
184
234
  # lifecycle_configuration: {
185
235
  # rules: [ # required
186
236
  # {
@@ -197,6 +247,8 @@ module Aws::S3
197
247
  # key: "ObjectKey", # required
198
248
  # value: "Value", # required
199
249
  # },
250
+ # object_size_greater_than: 1,
251
+ # object_size_less_than: 1,
200
252
  # and: {
201
253
  # prefix: "Prefix",
202
254
  # tags: [
@@ -205,6 +257,8 @@ module Aws::S3
205
257
  # value: "Value", # required
206
258
  # },
207
259
  # ],
260
+ # object_size_greater_than: 1,
261
+ # object_size_less_than: 1,
208
262
  # },
209
263
  # },
210
264
  # status: "Enabled", # required, accepts Enabled, Disabled
@@ -212,17 +266,19 @@ module Aws::S3
212
266
  # {
213
267
  # date: Time.now,
214
268
  # days: 1,
215
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
269
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
216
270
  # },
217
271
  # ],
218
272
  # noncurrent_version_transitions: [
219
273
  # {
220
274
  # noncurrent_days: 1,
221
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
275
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
276
+ # newer_noncurrent_versions: 1,
222
277
  # },
223
278
  # ],
224
279
  # noncurrent_version_expiration: {
225
280
  # noncurrent_days: 1,
281
+ # newer_noncurrent_versions: 1,
226
282
  # },
227
283
  # abort_incomplete_multipart_upload: {
228
284
  # days_after_initiation: 1,
@@ -230,13 +286,63 @@ module Aws::S3
230
286
  # },
231
287
  # ],
232
288
  # },
289
+ # expected_bucket_owner: "AccountId",
290
+ # transition_default_minimum_object_size: "varies_by_storage_class", # accepts varies_by_storage_class, all_storage_classes_128K
233
291
  # })
234
292
  # @param [Hash] options ({})
293
+ # @option options [String] :checksum_algorithm
294
+ # Indicates the algorithm used to create the checksum for the request
295
+ # when you use the SDK. This header will not provide any additional
296
+ # functionality if you don't use the SDK. When you send this header,
297
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
298
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
299
+ # status code `400 Bad Request`. For more information, see [Checking
300
+ # object integrity][1] in the *Amazon S3 User Guide*.
301
+ #
302
+ # If you provide an individual checksum, Amazon S3 ignores any provided
303
+ # `ChecksumAlgorithm` parameter.
304
+ #
305
+ #
306
+ #
307
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
235
308
  # @option options [Types::BucketLifecycleConfiguration] :lifecycle_configuration
236
- # @return [EmptyStructure]
309
+ # Container for lifecycle rules. You can add as many as 1,000 rules.
310
+ # @option options [String] :expected_bucket_owner
311
+ # The account ID of the expected bucket owner. If the account ID that
312
+ # you provide does not match the actual owner of the bucket, the request
313
+ # fails with the HTTP status code `403 Forbidden` (access denied).
314
+ #
315
+ # <note markdown="1"> This parameter applies to general purpose buckets only. It is not
316
+ # supported for directory bucket lifecycle configurations.
317
+ #
318
+ # </note>
319
+ # @option options [String] :transition_default_minimum_object_size
320
+ # Indicates which default minimum object size behavior is applied to the
321
+ # lifecycle configuration.
322
+ #
323
+ # <note markdown="1"> This parameter applies to general purpose buckets only. It is not
324
+ # supported for directory bucket lifecycle configurations.
325
+ #
326
+ # </note>
327
+ #
328
+ # * `all_storage_classes_128K` - Objects smaller than 128 KB will not
329
+ # transition to any storage class by default.
330
+ #
331
+ # * `varies_by_storage_class` - Objects smaller than 128 KB will
332
+ # transition to Glacier Flexible Retrieval or Glacier Deep Archive
333
+ # storage classes. By default, all other storage classes will prevent
334
+ # transitions smaller than 128 KB.
335
+ #
336
+ # To customize the minimum object size for any transition you can add a
337
+ # filter that specifies a custom `ObjectSizeGreaterThan` or
338
+ # `ObjectSizeLessThan` in the body of your transition rule. Custom
339
+ # filters always take precedence over the default transition behavior.
340
+ # @return [Types::PutBucketLifecycleConfigurationOutput]
237
341
  def put(options = {})
238
342
  options = options.merge(bucket: @bucket_name)
239
- resp = @client.put_bucket_lifecycle_configuration(options)
343
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
344
+ @client.put_bucket_lifecycle_configuration(options)
345
+ end
240
346
  resp.data
241
347
  end
242
348
 
@@ -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 BucketLogging
10
13
 
11
14
  extend Aws::Deprecations
@@ -21,6 +24,7 @@ module Aws::S3
21
24
  @bucket_name = extract_bucket_name(args, options)
22
25
  @data = options.delete(:data)
23
26
  @client = options.delete(:client) || Client.new(options)
27
+ @waiter_block_warned = false
24
28
  end
25
29
 
26
30
  # @!group Read-Only Attributes
@@ -30,9 +34,13 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
33
- # Container for logging information. Presence of this element indicates
34
- # that logging is enabled. Parameters TargetBucket and TargetPrefix are
35
- # required in this case.
37
+ # Describes where logs are stored and the prefix that Amazon S3 assigns
38
+ # to all log object keys for a bucket. For more information, see [PUT
39
+ # Bucket logging][1] in the *Amazon S3 API Reference*.
40
+ #
41
+ #
42
+ #
43
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html
36
44
  # @return [Types::LoggingEnabled]
37
45
  def logging_enabled
38
46
  data[:logging_enabled]
@@ -52,7 +60,9 @@ module Aws::S3
52
60
  #
53
61
  # @return [self]
54
62
  def load
55
- resp = @client.get_bucket_logging(bucket: @bucket_name)
63
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
64
+ @client.get_bucket_logging(bucket: @bucket_name)
65
+ end
56
66
  @data = resp.data
57
67
  self
58
68
  end
@@ -78,7 +88,8 @@ module Aws::S3
78
88
  # Waiter polls an API operation until a resource enters a desired
79
89
  # state.
80
90
  #
81
- # @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.
82
93
  #
83
94
  # ## Basic Usage
84
95
  #
@@ -91,13 +102,15 @@ module Aws::S3
91
102
  #
92
103
  # ## Example
93
104
  #
94
- # 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
95
108
  #
96
109
  # ## Configuration
97
110
  #
98
111
  # 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}:
112
+ # delay (in seconds) between each polling attempt. The waiting condition is
113
+ # set by passing a block to {#wait_until}:
101
114
  #
102
115
  # # poll for ~25 seconds
103
116
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -128,17 +141,16 @@ module Aws::S3
128
141
  # # resource did not enter the desired state in time
129
142
  # end
130
143
  #
144
+ # @yieldparam [Resource] resource to be used in the waiting condition.
131
145
  #
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.
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.
137
149
  #
138
150
  # yet successful.
139
151
  #
140
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
141
- # 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.
142
154
  #
143
155
  # @raise [NotImplementedError] Raised when the resource does not
144
156
  #
@@ -165,7 +177,9 @@ module Aws::S3
165
177
  :retry
166
178
  end
167
179
  end
168
- Aws::Waiters::Waiter.new(options).wait({})
180
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
181
+ Aws::Waiters::Waiter.new(options).wait({})
182
+ end
169
183
  end
170
184
 
171
185
  # @!group Actions
@@ -189,17 +203,53 @@ module Aws::S3
189
203
  # },
190
204
  # ],
191
205
  # target_prefix: "TargetPrefix", # required
206
+ # target_object_key_format: {
207
+ # simple_prefix: {
208
+ # },
209
+ # partitioned_prefix: {
210
+ # partition_date_source: "EventTime", # accepts EventTime, DeliveryTime
211
+ # },
212
+ # },
192
213
  # },
193
214
  # },
194
215
  # content_md5: "ContentMD5",
216
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
217
+ # expected_bucket_owner: "AccountId",
195
218
  # })
196
219
  # @param [Hash] options ({})
197
220
  # @option options [required, Types::BucketLoggingStatus] :bucket_logging_status
221
+ # Container for logging status information.
198
222
  # @option options [String] :content_md5
223
+ # The MD5 hash of the `PutBucketLogging` request body.
224
+ #
225
+ # For requests made using the Amazon Web Services Command Line Interface
226
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
227
+ # automatically.
228
+ # @option options [String] :checksum_algorithm
229
+ # Indicates the algorithm used to create the checksum for the request
230
+ # when you use the SDK. This header will not provide any additional
231
+ # functionality if you don't use the SDK. When you send this header,
232
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
233
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
234
+ # status code `400 Bad Request`. For more information, see [Checking
235
+ # object integrity][1] in the *Amazon S3 User Guide*.
236
+ #
237
+ # If you provide an individual checksum, Amazon S3 ignores any provided
238
+ # `ChecksumAlgorithm` parameter.
239
+ #
240
+ #
241
+ #
242
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
243
+ # @option options [String] :expected_bucket_owner
244
+ # The account ID of the expected bucket owner. If the account ID that
245
+ # you provide does not match the actual owner of the bucket, the request
246
+ # fails with the HTTP status code `403 Forbidden` (access denied).
199
247
  # @return [EmptyStructure]
200
248
  def put(options = {})
201
249
  options = options.merge(bucket: @bucket_name)
202
- resp = @client.put_bucket_logging(options)
250
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
251
+ @client.put_bucket_logging(options)
252
+ end
203
253
  resp.data
204
254
  end
205
255
 
@@ -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 BucketNotification
10
13
 
11
14
  extend Aws::Deprecations
@@ -21,6 +24,7 @@ module Aws::S3
21
24
  @bucket_name = extract_bucket_name(args, options)
22
25
  @data = options.delete(:data)
23
26
  @client = options.delete(:client) || Client.new(options)
27
+ @waiter_block_warned = false
24
28
  end
25
29
 
26
30
  # @!group Read-Only Attributes
@@ -30,21 +34,33 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
37
+ # The topic to which notifications are sent and the events for which
38
+ # notifications are generated.
33
39
  # @return [Array<Types::TopicConfiguration>]
34
40
  def topic_configurations
35
41
  data[:topic_configurations]
36
42
  end
37
43
 
44
+ # The Amazon Simple Queue Service queues to publish messages to and the
45
+ # events for which to publish messages.
38
46
  # @return [Array<Types::QueueConfiguration>]
39
47
  def queue_configurations
40
48
  data[:queue_configurations]
41
49
  end
42
50
 
51
+ # Describes the Lambda functions to invoke and the events for which to
52
+ # invoke them.
43
53
  # @return [Array<Types::LambdaFunctionConfiguration>]
44
54
  def lambda_function_configurations
45
55
  data[:lambda_function_configurations]
46
56
  end
47
57
 
58
+ # Enables delivery of events to Amazon EventBridge.
59
+ # @return [Types::EventBridgeConfiguration]
60
+ def event_bridge_configuration
61
+ data[:event_bridge_configuration]
62
+ end
63
+
48
64
  # @!endgroup
49
65
 
50
66
  # @return [Client]
@@ -59,7 +75,9 @@ module Aws::S3
59
75
  #
60
76
  # @return [self]
61
77
  def load
62
- resp = @client.get_bucket_notification_configuration(bucket: @bucket_name)
78
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
79
+ @client.get_bucket_notification_configuration(bucket: @bucket_name)
80
+ end
63
81
  @data = resp.data
64
82
  self
65
83
  end
@@ -85,7 +103,8 @@ module Aws::S3
85
103
  # Waiter polls an API operation until a resource enters a desired
86
104
  # state.
87
105
  #
88
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
106
+ # @note The waiting operation is performed on a copy. The original resource
107
+ # remains unchanged.
89
108
  #
90
109
  # ## Basic Usage
91
110
  #
@@ -98,13 +117,15 @@ module Aws::S3
98
117
  #
99
118
  # ## Example
100
119
  #
101
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
120
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
121
+ # instance.state.name == 'running'
122
+ # end
102
123
  #
103
124
  # ## Configuration
104
125
  #
105
126
  # You can configure the maximum number of polling attempts, and the
106
- # delay (in seconds) between each polling attempt. The waiting condition is set
107
- # by passing a block to {#wait_until}:
127
+ # delay (in seconds) between each polling attempt. The waiting condition is
128
+ # set by passing a block to {#wait_until}:
108
129
  #
109
130
  # # poll for ~25 seconds
110
131
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -135,17 +156,16 @@ module Aws::S3
135
156
  # # resource did not enter the desired state in time
136
157
  # end
137
158
  #
159
+ # @yieldparam [Resource] resource to be used in the waiting condition.
138
160
  #
139
- # @yield param [Resource] resource to be used in the waiting condition
140
- #
141
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
142
- # because the waiter has entered a state that it will not transition
143
- # out of, preventing success.
161
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
162
+ # terminates because the waiter has entered a state that it will not
163
+ # transition out of, preventing success.
144
164
  #
145
165
  # yet successful.
146
166
  #
147
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
148
- # while polling for a resource that is not expected.
167
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
168
+ # encountered while polling for a resource that is not expected.
149
169
  #
150
170
  # @raise [NotImplementedError] Raised when the resource does not
151
171
  #
@@ -172,7 +192,9 @@ module Aws::S3
172
192
  :retry
173
193
  end
174
194
  end
175
- Aws::Waiters::Waiter.new(options).wait({})
195
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
196
+ Aws::Waiters::Waiter.new(options).wait({})
197
+ end
176
198
  end
177
199
 
178
200
  # @!group Actions
@@ -185,7 +207,7 @@ module Aws::S3
185
207
  # {
186
208
  # id: "NotificationId",
187
209
  # topic_arn: "TopicArn", # required
188
- # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
210
+ # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:*, s3:ObjectRestore:Post, s3:ObjectRestore:Completed, s3:Replication:*, s3:Replication:OperationFailedReplication, s3:Replication:OperationNotTracked, s3:Replication:OperationMissedThreshold, s3:Replication:OperationReplicatedAfterThreshold, s3:ObjectRestore:Delete, s3:LifecycleTransition, s3:IntelligentTiering, s3:ObjectAcl:Put, s3:LifecycleExpiration:*, s3:LifecycleExpiration:Delete, s3:LifecycleExpiration:DeleteMarkerCreated, s3:ObjectTagging:*, s3:ObjectTagging:Put, s3:ObjectTagging:Delete
189
211
  # filter: {
190
212
  # key: {
191
213
  # filter_rules: [
@@ -202,7 +224,7 @@ module Aws::S3
202
224
  # {
203
225
  # id: "NotificationId",
204
226
  # queue_arn: "QueueArn", # required
205
- # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
227
+ # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:*, s3:ObjectRestore:Post, s3:ObjectRestore:Completed, s3:Replication:*, s3:Replication:OperationFailedReplication, s3:Replication:OperationNotTracked, s3:Replication:OperationMissedThreshold, s3:Replication:OperationReplicatedAfterThreshold, s3:ObjectRestore:Delete, s3:LifecycleTransition, s3:IntelligentTiering, s3:ObjectAcl:Put, s3:LifecycleExpiration:*, s3:LifecycleExpiration:Delete, s3:LifecycleExpiration:DeleteMarkerCreated, s3:ObjectTagging:*, s3:ObjectTagging:Put, s3:ObjectTagging:Delete
206
228
  # filter: {
207
229
  # key: {
208
230
  # filter_rules: [
@@ -219,7 +241,7 @@ module Aws::S3
219
241
  # {
220
242
  # id: "NotificationId",
221
243
  # lambda_function_arn: "LambdaFunctionArn", # required
222
- # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated
244
+ # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:*, s3:ObjectRestore:Post, s3:ObjectRestore:Completed, s3:Replication:*, s3:Replication:OperationFailedReplication, s3:Replication:OperationNotTracked, s3:Replication:OperationMissedThreshold, s3:Replication:OperationReplicatedAfterThreshold, s3:ObjectRestore:Delete, s3:LifecycleTransition, s3:IntelligentTiering, s3:ObjectAcl:Put, s3:LifecycleExpiration:*, s3:LifecycleExpiration:Delete, s3:LifecycleExpiration:DeleteMarkerCreated, s3:ObjectTagging:*, s3:ObjectTagging:Put, s3:ObjectTagging:Delete
223
245
  # filter: {
224
246
  # key: {
225
247
  # filter_rules: [
@@ -232,16 +254,30 @@ module Aws::S3
232
254
  # },
233
255
  # },
234
256
  # ],
257
+ # event_bridge_configuration: {
258
+ # },
235
259
  # },
260
+ # expected_bucket_owner: "AccountId",
261
+ # skip_destination_validation: false,
236
262
  # })
237
263
  # @param [Hash] options ({})
238
264
  # @option options [required, Types::NotificationConfiguration] :notification_configuration
239
- # Container for specifying the notification configuration of the bucket.
240
- # If this element is empty, notifications are turned off on the bucket.
265
+ # A container for specifying the notification configuration of the
266
+ # bucket. If this element is empty, notifications are turned off for the
267
+ # bucket.
268
+ # @option options [String] :expected_bucket_owner
269
+ # The account ID of the expected bucket owner. If the account ID that
270
+ # you provide does not match the actual owner of the bucket, the request
271
+ # fails with the HTTP status code `403 Forbidden` (access denied).
272
+ # @option options [Boolean] :skip_destination_validation
273
+ # Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations.
274
+ # True or false value.
241
275
  # @return [EmptyStructure]
242
276
  def put(options = {})
243
277
  options = options.merge(bucket: @bucket_name)
244
- resp = @client.put_bucket_notification_configuration(options)
278
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
279
+ @client.put_bucket_notification_configuration(options)
280
+ end
245
281
  resp.data
246
282
  end
247
283