aws-sdk-s3 1.53.0 → 1.146.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1126 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/bucket.rb +778 -94
  6. data/lib/aws-sdk-s3/bucket_acl.rb +64 -18
  7. data/lib/aws-sdk-s3/bucket_cors.rb +79 -18
  8. data/lib/aws-sdk-s3/bucket_lifecycle.rb +66 -20
  9. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +68 -20
  10. data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
  11. data/lib/aws-sdk-s3/bucket_notification.rb +52 -20
  12. data/lib/aws-sdk-s3/bucket_policy.rb +107 -17
  13. data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
  14. data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
  15. data/lib/aws-sdk-s3/bucket_tagging.rb +71 -18
  16. data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
  17. data/lib/aws-sdk-s3/bucket_website.rb +78 -21
  18. data/lib/aws-sdk-s3/client.rb +12559 -877
  19. data/lib/aws-sdk-s3/client_api.rb +1078 -191
  20. data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
  21. data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
  22. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  23. data/lib/aws-sdk-s3/customizations/object.rb +231 -39
  24. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  25. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  26. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  27. data/lib/aws-sdk-s3/customizations.rb +11 -1
  28. data/lib/aws-sdk-s3/encryption/client.rb +25 -8
  29. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  30. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  31. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  32. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  33. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  34. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
  35. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  36. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  37. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
  39. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  40. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  41. data/lib/aws-sdk-s3/encryption.rb +4 -0
  42. data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
  43. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
  44. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  45. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  46. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  47. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  48. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  49. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  50. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  51. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  52. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
  53. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  54. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  55. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  56. data/lib/aws-sdk-s3/endpoint_parameters.rb +178 -0
  57. data/lib/aws-sdk-s3/endpoint_provider.rb +591 -0
  58. data/lib/aws-sdk-s3/endpoints.rb +2590 -0
  59. data/lib/aws-sdk-s3/errors.rb +123 -1
  60. data/lib/aws-sdk-s3/event_streams.rb +8 -1
  61. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  62. data/lib/aws-sdk-s3/express_credentials_cache.rb +30 -0
  63. data/lib/aws-sdk-s3/express_credentials_provider.rb +36 -0
  64. data/lib/aws-sdk-s3/file_downloader.rb +176 -44
  65. data/lib/aws-sdk-s3/file_part.rb +2 -0
  66. data/lib/aws-sdk-s3/file_uploader.rb +28 -8
  67. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  68. data/lib/aws-sdk-s3/multipart_file_uploader.rb +68 -12
  69. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +59 -20
  70. data/lib/aws-sdk-s3/multipart_upload.rb +242 -32
  71. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  72. data/lib/aws-sdk-s3/multipart_upload_part.rb +367 -45
  73. data/lib/aws-sdk-s3/object.rb +2191 -227
  74. data/lib/aws-sdk-s3/object_acl.rb +103 -25
  75. data/lib/aws-sdk-s3/object_copier.rb +9 -5
  76. data/lib/aws-sdk-s3/object_multipart_copier.rb +43 -19
  77. data/lib/aws-sdk-s3/object_summary.rb +1811 -208
  78. data/lib/aws-sdk-s3/object_version.rb +452 -80
  79. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  80. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  81. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
  82. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  83. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  84. data/lib/aws-sdk-s3/plugins/endpoints.rb +274 -0
  85. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  86. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +91 -0
  87. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  88. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
  89. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  90. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  91. data/lib/aws-sdk-s3/plugins/md5s.rb +32 -26
  92. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  93. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  94. data/lib/aws-sdk-s3/plugins/s3_signer.rb +56 -92
  95. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  96. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  97. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
  98. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  99. data/lib/aws-sdk-s3/presigned_post.rb +160 -99
  100. data/lib/aws-sdk-s3/presigner.rb +136 -59
  101. data/lib/aws-sdk-s3/resource.rb +120 -8
  102. data/lib/aws-sdk-s3/types.rb +11349 -4242
  103. data/lib/aws-sdk-s3/waiters.rb +67 -1
  104. data/lib/aws-sdk-s3.rb +16 -6
  105. data/sig/bucket.rbs +212 -0
  106. data/sig/bucket_acl.rbs +78 -0
  107. data/sig/bucket_cors.rbs +69 -0
  108. data/sig/bucket_lifecycle.rbs +88 -0
  109. data/sig/bucket_lifecycle_configuration.rbs +111 -0
  110. data/sig/bucket_logging.rbs +76 -0
  111. data/sig/bucket_notification.rbs +114 -0
  112. data/sig/bucket_policy.rbs +59 -0
  113. data/sig/bucket_request_payment.rbs +54 -0
  114. data/sig/bucket_tagging.rbs +65 -0
  115. data/sig/bucket_versioning.rbs +77 -0
  116. data/sig/bucket_website.rbs +93 -0
  117. data/sig/client.rbs +2360 -0
  118. data/sig/errors.rbs +34 -0
  119. data/sig/multipart_upload.rbs +110 -0
  120. data/sig/multipart_upload_part.rbs +105 -0
  121. data/sig/object.rbs +436 -0
  122. data/sig/object_acl.rbs +86 -0
  123. data/sig/object_summary.rbs +334 -0
  124. data/sig/object_version.rbs +131 -0
  125. data/sig/resource.rbs +124 -0
  126. data/sig/types.rbs +2562 -0
  127. data/sig/waiters.rbs +83 -0
  128. metadata +68 -15
@@ -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,7 +34,7 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
33
-
37
+ # Container for a lifecycle rule.
34
38
  # @return [Array<Types::LifecycleRule>]
35
39
  def rules
36
40
  data[:rules]
@@ -50,7 +54,9 @@ module Aws::S3
50
54
  #
51
55
  # @return [self]
52
56
  def load
53
- resp = @client.get_bucket_lifecycle_configuration(bucket: @bucket_name)
57
+ resp = Aws::Plugins::UserAgent.feature('resource') do
58
+ @client.get_bucket_lifecycle_configuration(bucket: @bucket_name)
59
+ end
54
60
  @data = resp.data
55
61
  self
56
62
  end
@@ -76,7 +82,8 @@ module Aws::S3
76
82
  # Waiter polls an API operation until a resource enters a desired
77
83
  # state.
78
84
  #
79
- # @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.
80
87
  #
81
88
  # ## Basic Usage
82
89
  #
@@ -89,13 +96,15 @@ module Aws::S3
89
96
  #
90
97
  # ## Example
91
98
  #
92
- # 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
93
102
  #
94
103
  # ## Configuration
95
104
  #
96
105
  # You can configure the maximum number of polling attempts, and the
97
- # delay (in seconds) between each polling attempt. The waiting condition is set
98
- # 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}:
99
108
  #
100
109
  # # poll for ~25 seconds
101
110
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -126,17 +135,16 @@ module Aws::S3
126
135
  # # resource did not enter the desired state in time
127
136
  # end
128
137
  #
138
+ # @yieldparam [Resource] resource to be used in the waiting condition.
129
139
  #
130
- # @yield param [Resource] resource to be used in the waiting condition
131
- #
132
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
133
- # because the waiter has entered a state that it will not transition
134
- # 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.
135
143
  #
136
144
  # yet successful.
137
145
  #
138
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
139
- # 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.
140
148
  #
141
149
  # @raise [NotImplementedError] Raised when the resource does not
142
150
  #
@@ -163,25 +171,36 @@ module Aws::S3
163
171
  :retry
164
172
  end
165
173
  end
166
- Aws::Waiters::Waiter.new(options).wait({})
174
+ Aws::Plugins::UserAgent.feature('resource') do
175
+ Aws::Waiters::Waiter.new(options).wait({})
176
+ end
167
177
  end
168
178
 
169
179
  # @!group Actions
170
180
 
171
181
  # @example Request syntax with placeholder values
172
182
  #
173
- # bucket_lifecycle_configuration.delete()
183
+ # bucket_lifecycle_configuration.delete({
184
+ # expected_bucket_owner: "AccountId",
185
+ # })
174
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).
175
191
  # @return [EmptyStructure]
176
192
  def delete(options = {})
177
193
  options = options.merge(bucket: @bucket_name)
178
- resp = @client.delete_bucket_lifecycle(options)
194
+ resp = Aws::Plugins::UserAgent.feature('resource') do
195
+ @client.delete_bucket_lifecycle(options)
196
+ end
179
197
  resp.data
180
198
  end
181
199
 
182
200
  # @example Request syntax with placeholder values
183
201
  #
184
202
  # bucket_lifecycle_configuration.put({
203
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
185
204
  # lifecycle_configuration: {
186
205
  # rules: [ # required
187
206
  # {
@@ -198,6 +217,8 @@ module Aws::S3
198
217
  # key: "ObjectKey", # required
199
218
  # value: "Value", # required
200
219
  # },
220
+ # object_size_greater_than: 1,
221
+ # object_size_less_than: 1,
201
222
  # and: {
202
223
  # prefix: "Prefix",
203
224
  # tags: [
@@ -206,6 +227,8 @@ module Aws::S3
206
227
  # value: "Value", # required
207
228
  # },
208
229
  # ],
230
+ # object_size_greater_than: 1,
231
+ # object_size_less_than: 1,
209
232
  # },
210
233
  # },
211
234
  # status: "Enabled", # required, accepts Enabled, Disabled
@@ -213,17 +236,19 @@ module Aws::S3
213
236
  # {
214
237
  # date: Time.now,
215
238
  # days: 1,
216
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
239
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
217
240
  # },
218
241
  # ],
219
242
  # noncurrent_version_transitions: [
220
243
  # {
221
244
  # noncurrent_days: 1,
222
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
245
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
246
+ # newer_noncurrent_versions: 1,
223
247
  # },
224
248
  # ],
225
249
  # noncurrent_version_expiration: {
226
250
  # noncurrent_days: 1,
251
+ # newer_noncurrent_versions: 1,
227
252
  # },
228
253
  # abort_incomplete_multipart_upload: {
229
254
  # days_after_initiation: 1,
@@ -231,13 +256,36 @@ module Aws::S3
231
256
  # },
232
257
  # ],
233
258
  # },
259
+ # expected_bucket_owner: "AccountId",
234
260
  # })
235
261
  # @param [Hash] options ({})
262
+ # @option options [String] :checksum_algorithm
263
+ # Indicates the algorithm used to create the checksum for the object
264
+ # when you use the SDK. This header will not provide any additional
265
+ # functionality if you don't use the SDK. When you send this header,
266
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
267
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
268
+ # status code `400 Bad Request`. For more information, see [Checking
269
+ # object integrity][1] in the *Amazon S3 User Guide*.
270
+ #
271
+ # If you provide an individual checksum, Amazon S3 ignores any provided
272
+ # `ChecksumAlgorithm` parameter.
273
+ #
274
+ #
275
+ #
276
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
236
277
  # @option options [Types::BucketLifecycleConfiguration] :lifecycle_configuration
278
+ # Container for lifecycle rules. You can add as many as 1,000 rules.
279
+ # @option options [String] :expected_bucket_owner
280
+ # The account ID of the expected bucket owner. If the account ID that
281
+ # you provide does not match the actual owner of the bucket, the request
282
+ # fails with the HTTP status code `403 Forbidden` (access denied).
237
283
  # @return [EmptyStructure]
238
284
  def put(options = {})
239
285
  options = options.merge(bucket: @bucket_name)
240
- resp = @client.put_bucket_lifecycle_configuration(options)
286
+ resp = Aws::Plugins::UserAgent.feature('resource') do
287
+ @client.put_bucket_lifecycle_configuration(options)
288
+ end
241
289
  resp.data
242
290
  end
243
291
 
@@ -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,7 +34,13 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
33
-
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
34
44
  # @return [Types::LoggingEnabled]
35
45
  def logging_enabled
36
46
  data[:logging_enabled]
@@ -50,7 +60,9 @@ module Aws::S3
50
60
  #
51
61
  # @return [self]
52
62
  def load
53
- resp = @client.get_bucket_logging(bucket: @bucket_name)
63
+ resp = Aws::Plugins::UserAgent.feature('resource') do
64
+ @client.get_bucket_logging(bucket: @bucket_name)
65
+ end
54
66
  @data = resp.data
55
67
  self
56
68
  end
@@ -76,7 +88,8 @@ module Aws::S3
76
88
  # Waiter polls an API operation until a resource enters a desired
77
89
  # state.
78
90
  #
79
- # @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.
80
93
  #
81
94
  # ## Basic Usage
82
95
  #
@@ -89,13 +102,15 @@ module Aws::S3
89
102
  #
90
103
  # ## Example
91
104
  #
92
- # 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
93
108
  #
94
109
  # ## Configuration
95
110
  #
96
111
  # You can configure the maximum number of polling attempts, and the
97
- # delay (in seconds) between each polling attempt. The waiting condition is set
98
- # 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}:
99
114
  #
100
115
  # # poll for ~25 seconds
101
116
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -126,17 +141,16 @@ module Aws::S3
126
141
  # # resource did not enter the desired state in time
127
142
  # end
128
143
  #
144
+ # @yieldparam [Resource] resource to be used in the waiting condition.
129
145
  #
130
- # @yield param [Resource] resource to be used in the waiting condition
131
- #
132
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
133
- # because the waiter has entered a state that it will not transition
134
- # 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.
135
149
  #
136
150
  # yet successful.
137
151
  #
138
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
139
- # 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.
140
154
  #
141
155
  # @raise [NotImplementedError] Raised when the resource does not
142
156
  #
@@ -163,7 +177,9 @@ module Aws::S3
163
177
  :retry
164
178
  end
165
179
  end
166
- Aws::Waiters::Waiter.new(options).wait({})
180
+ Aws::Plugins::UserAgent.feature('resource') do
181
+ Aws::Waiters::Waiter.new(options).wait({})
182
+ end
167
183
  end
168
184
 
169
185
  # @!group Actions
@@ -187,17 +203,53 @@ module Aws::S3
187
203
  # },
188
204
  # ],
189
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
+ # },
190
213
  # },
191
214
  # },
192
215
  # content_md5: "ContentMD5",
216
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
217
+ # expected_bucket_owner: "AccountId",
193
218
  # })
194
219
  # @param [Hash] options ({})
195
220
  # @option options [required, Types::BucketLoggingStatus] :bucket_logging_status
221
+ # Container for logging status information.
196
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 object
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).
197
247
  # @return [EmptyStructure]
198
248
  def put(options = {})
199
249
  options = options.merge(bucket: @bucket_name)
200
- resp = @client.put_bucket_logging(options)
250
+ resp = Aws::Plugins::UserAgent.feature('resource') do
251
+ @client.put_bucket_logging(options)
252
+ end
201
253
  resp.data
202
254
  end
203
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
@@ -44,13 +48,19 @@ module Aws::S3
44
48
  data[:queue_configurations]
45
49
  end
46
50
 
47
- # Describes the AWS Lambda functions to invoke and the events for which
48
- # to invoke them.
51
+ # Describes the Lambda functions to invoke and the events for which to
52
+ # invoke them.
49
53
  # @return [Array<Types::LambdaFunctionConfiguration>]
50
54
  def lambda_function_configurations
51
55
  data[:lambda_function_configurations]
52
56
  end
53
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
+
54
64
  # @!endgroup
55
65
 
56
66
  # @return [Client]
@@ -65,7 +75,9 @@ module Aws::S3
65
75
  #
66
76
  # @return [self]
67
77
  def load
68
- resp = @client.get_bucket_notification_configuration(bucket: @bucket_name)
78
+ resp = Aws::Plugins::UserAgent.feature('resource') do
79
+ @client.get_bucket_notification_configuration(bucket: @bucket_name)
80
+ end
69
81
  @data = resp.data
70
82
  self
71
83
  end
@@ -91,7 +103,8 @@ module Aws::S3
91
103
  # Waiter polls an API operation until a resource enters a desired
92
104
  # state.
93
105
  #
94
- # @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.
95
108
  #
96
109
  # ## Basic Usage
97
110
  #
@@ -104,13 +117,15 @@ module Aws::S3
104
117
  #
105
118
  # ## Example
106
119
  #
107
- # 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
108
123
  #
109
124
  # ## Configuration
110
125
  #
111
126
  # You can configure the maximum number of polling attempts, and the
112
- # delay (in seconds) between each polling attempt. The waiting condition is set
113
- # 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}:
114
129
  #
115
130
  # # poll for ~25 seconds
116
131
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -141,17 +156,16 @@ module Aws::S3
141
156
  # # resource did not enter the desired state in time
142
157
  # end
143
158
  #
159
+ # @yieldparam [Resource] resource to be used in the waiting condition.
144
160
  #
145
- # @yield param [Resource] resource to be used in the waiting condition
146
- #
147
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
148
- # because the waiter has entered a state that it will not transition
149
- # 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.
150
164
  #
151
165
  # yet successful.
152
166
  #
153
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
154
- # 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.
155
169
  #
156
170
  # @raise [NotImplementedError] Raised when the resource does not
157
171
  #
@@ -178,7 +192,9 @@ module Aws::S3
178
192
  :retry
179
193
  end
180
194
  end
181
- Aws::Waiters::Waiter.new(options).wait({})
195
+ Aws::Plugins::UserAgent.feature('resource') do
196
+ Aws::Waiters::Waiter.new(options).wait({})
197
+ end
182
198
  end
183
199
 
184
200
  # @!group Actions
@@ -191,7 +207,7 @@ module Aws::S3
191
207
  # {
192
208
  # id: "NotificationId",
193
209
  # topic_arn: "TopicArn", # required
194
- # 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:Post, s3:ObjectRestore:Completed
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
195
211
  # filter: {
196
212
  # key: {
197
213
  # filter_rules: [
@@ -208,7 +224,7 @@ module Aws::S3
208
224
  # {
209
225
  # id: "NotificationId",
210
226
  # queue_arn: "QueueArn", # required
211
- # 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:Post, s3:ObjectRestore:Completed
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
212
228
  # filter: {
213
229
  # key: {
214
230
  # filter_rules: [
@@ -225,7 +241,7 @@ module Aws::S3
225
241
  # {
226
242
  # id: "NotificationId",
227
243
  # lambda_function_arn: "LambdaFunctionArn", # required
228
- # 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:Post, s3:ObjectRestore:Completed
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
229
245
  # filter: {
230
246
  # key: {
231
247
  # filter_rules: [
@@ -238,14 +254,30 @@ module Aws::S3
238
254
  # },
239
255
  # },
240
256
  # ],
257
+ # event_bridge_configuration: {
258
+ # },
241
259
  # },
260
+ # expected_bucket_owner: "AccountId",
261
+ # skip_destination_validation: false,
242
262
  # })
243
263
  # @param [Hash] options ({})
244
264
  # @option options [required, Types::NotificationConfiguration] :notification_configuration
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.
245
275
  # @return [EmptyStructure]
246
276
  def put(options = {})
247
277
  options = options.merge(bucket: @bucket_name)
248
- resp = @client.put_bucket_notification_configuration(options)
278
+ resp = Aws::Plugins::UserAgent.feature('resource') do
279
+ @client.put_bucket_notification_configuration(options)
280
+ end
249
281
  resp.data
250
282
  end
251
283