aws-sdk-s3 1.48.0 → 1.183.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 (134) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1352 -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 +1005 -106
  8. data/lib/aws-sdk-s3/bucket_acl.rb +65 -18
  9. data/lib/aws-sdk-s3/bucket_cors.rb +80 -18
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -20
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -21
  12. data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
  13. data/lib/aws-sdk-s3/bucket_notification.rb +52 -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 -18
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
  19. data/lib/aws-sdk-s3/bucket_website.rb +78 -21
  20. data/lib/aws-sdk-s3/client.rb +14517 -941
  21. data/lib/aws-sdk-s3/client_api.rb +1296 -197
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
  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 +288 -68
  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 +28 -7
  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 +181 -0
  60. data/lib/aws-sdk-s3/endpoint_provider.rb +716 -0
  61. data/lib/aws-sdk-s3/endpoints.rb +1434 -0
  62. data/lib/aws-sdk-s3/errors.rb +170 -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 +161 -46
  67. data/lib/aws-sdk-s3/file_part.rb +11 -6
  68. data/lib/aws-sdk-s3/file_uploader.rb +39 -18
  69. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  70. data/lib/aws-sdk-s3/multipart_file_uploader.rb +104 -27
  71. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +61 -21
  72. data/lib/aws-sdk-s3/multipart_upload.rb +342 -32
  73. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  74. data/lib/aws-sdk-s3/multipart_upload_part.rb +384 -46
  75. data/lib/aws-sdk-s3/object.rb +2600 -231
  76. data/lib/aws-sdk-s3/object_acl.rb +103 -25
  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 +2174 -204
  80. data/lib/aws-sdk-s3/object_version.rb +539 -80
  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 +7 -43
  85. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  86. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
  87. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  88. data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
  89. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  90. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
  91. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  92. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
  93. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  94. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  95. data/lib/aws-sdk-s3/plugins/md5s.rb +14 -70
  96. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  97. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  98. data/lib/aws-sdk-s3/plugins/s3_signer.rb +63 -94
  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 -99
  103. data/lib/aws-sdk-s3/presigner.rb +141 -62
  104. data/lib/aws-sdk-s3/resource.rb +156 -17
  105. data/lib/aws-sdk-s3/types.rb +13021 -4106
  106. data/lib/aws-sdk-s3/waiters.rb +67 -1
  107. data/lib/aws-sdk-s3.rb +46 -32
  108. data/sig/bucket.rbs +222 -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 +115 -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 +2472 -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 +42 -0
  125. data/sig/multipart_upload.rbs +120 -0
  126. data/sig/multipart_upload_part.rbs +109 -0
  127. data/sig/object.rbs +459 -0
  128. data/sig/object_acl.rbs +86 -0
  129. data/sig/object_summary.rbs +345 -0
  130. data/sig/object_version.rbs +143 -0
  131. data/sig/resource.rbs +134 -0
  132. data/sig/types.rbs +2712 -0
  133. data/sig/waiters.rbs +95 -0
  134. metadata +74 -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 BucketPolicy
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
@@ -50,7 +54,9 @@ module Aws::S3
50
54
  #
51
55
  # @return [self]
52
56
  def load
53
- resp = @client.get_bucket_policy(bucket: @bucket_name)
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
+ @client.get_bucket_policy(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,19 +171,35 @@ module Aws::S3
163
171
  :retry
164
172
  end
165
173
  end
166
- Aws::Waiters::Waiter.new(options).wait({})
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') 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_policy.delete()
183
+ # bucket_policy.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).
191
+ #
192
+ # <note markdown="1"> For directory buckets, this header is not supported in this API
193
+ # operation. If you specify this header, the request fails with the HTTP
194
+ # status code `501 Not Implemented`.
195
+ #
196
+ # </note>
175
197
  # @return [EmptyStructure]
176
198
  def delete(options = {})
177
199
  options = options.merge(bucket: @bucket_name)
178
- resp = @client.delete_bucket_policy(options)
200
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
201
+ @client.delete_bucket_policy(options)
202
+ end
179
203
  resp.data
180
204
  end
181
205
 
@@ -183,20 +207,87 @@ module Aws::S3
183
207
  #
184
208
  # bucket_policy.put({
185
209
  # content_md5: "ContentMD5",
210
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
186
211
  # confirm_remove_self_bucket_access: false,
187
212
  # policy: "Policy", # required
213
+ # expected_bucket_owner: "AccountId",
188
214
  # })
189
215
  # @param [Hash] options ({})
190
216
  # @option options [String] :content_md5
217
+ # The MD5 hash of the request body.
218
+ #
219
+ # For requests made using the Amazon Web Services Command Line Interface
220
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
221
+ # automatically.
222
+ #
223
+ # <note markdown="1"> This functionality is not supported for directory buckets.
224
+ #
225
+ # </note>
226
+ # @option options [String] :checksum_algorithm
227
+ # Indicates the algorithm used to create the checksum for the request
228
+ # when you use the SDK. This header will not provide any additional
229
+ # functionality if you don't use the SDK. When you send this header,
230
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
231
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
232
+ # with the HTTP status code `400 Bad Request`.
233
+ #
234
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
235
+ # the supported algorithm from the following list:
236
+ #
237
+ # * `CRC32`
238
+ #
239
+ # * `CRC32C`
240
+ #
241
+ # * `CRC64NVME`
242
+ #
243
+ # * `SHA1`
244
+ #
245
+ # * `SHA256`
246
+ #
247
+ # For more information, see [Checking object integrity][1] in the
248
+ # *Amazon S3 User Guide*.
249
+ #
250
+ # If the individual checksum value you provide through
251
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
252
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
253
+ # request with a `BadDigest` error.
254
+ #
255
+ # <note markdown="1"> For directory buckets, when you use Amazon Web Services SDKs, `CRC32`
256
+ # is the default checksum algorithm that's used for performance.
257
+ #
258
+ # </note>
259
+ #
260
+ #
261
+ #
262
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
191
263
  # @option options [Boolean] :confirm_remove_self_bucket_access
192
264
  # Set this parameter to true to confirm that you want to remove your
193
265
  # permissions to change this bucket policy in the future.
266
+ #
267
+ # <note markdown="1"> This functionality is not supported for directory buckets.
268
+ #
269
+ # </note>
194
270
  # @option options [required, String] :policy
195
271
  # The bucket policy as a JSON document.
272
+ #
273
+ # For directory buckets, the only IAM action supported in the bucket
274
+ # policy is `s3express:CreateSession`.
275
+ # @option options [String] :expected_bucket_owner
276
+ # The account ID of the expected bucket owner. If the account ID that
277
+ # you provide does not match the actual owner of the bucket, the request
278
+ # fails with the HTTP status code `403 Forbidden` (access denied).
279
+ #
280
+ # <note markdown="1"> For directory buckets, this header is not supported in this API
281
+ # operation. If you specify this header, the request fails with the HTTP
282
+ # status code `501 Not Implemented`.
283
+ #
284
+ # </note>
196
285
  # @return [EmptyStructure]
197
286
  def put(options = {})
198
287
  options = options.merge(bucket: @bucket_name)
199
- resp = @client.put_bucket_policy(options)
288
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
289
+ @client.put_bucket_policy(options)
290
+ end
200
291
  resp.data
201
292
  end
202
293
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'thread'
2
4
 
3
5
  module Aws
@@ -13,7 +15,7 @@ module Aws
13
15
  # Registers a block as a callback. This listener is called when a
14
16
  # new bucket/region pair is added to the cache.
15
17
  #
16
- # S3::BUCKET_REGIONS.bucket_added do |bucket_name, region_name|
18
+ # Aws::S3.bucket_region_cache.bucket_added do |bucket_name, region_name|
17
19
  # # ...
18
20
  # end
19
21
  #
@@ -57,6 +59,14 @@ module Aws
57
59
  end
58
60
  end
59
61
 
62
+ # @param [String] key
63
+ # @return [Boolean]
64
+ def key?(key)
65
+ @mutex.synchronize do
66
+ @regions.key?(key)
67
+ end
68
+ end
69
+
60
70
  # @api private
61
71
  def clear
62
72
  @mutex.synchronize { @regions = {} }
@@ -71,9 +81,5 @@ module Aws
71
81
  alias to_h to_hash
72
82
 
73
83
  end
74
-
75
- # @api private
76
- BUCKET_REGIONS = BucketRegionCache.new
77
-
78
84
  end
79
85
  end
@@ -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 BucketRequestPayment
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
@@ -50,7 +54,9 @@ module Aws::S3
50
54
  #
51
55
  # @return [self]
52
56
  def load
53
- resp = @client.get_bucket_request_payment(bucket: @bucket_name)
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
+ @client.get_bucket_request_payment(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,7 +171,9 @@ module Aws::S3
163
171
  :retry
164
172
  end
165
173
  end
166
- Aws::Waiters::Waiter.new(options).wait({})
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
175
+ Aws::Waiters::Waiter.new(options).wait({})
176
+ end
167
177
  end
168
178
 
169
179
  # @!group Actions
@@ -172,17 +182,52 @@ module Aws::S3
172
182
  #
173
183
  # bucket_request_payment.put({
174
184
  # content_md5: "ContentMD5",
185
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
175
186
  # request_payment_configuration: { # required
176
187
  # payer: "Requester", # required, accepts Requester, BucketOwner
177
188
  # },
189
+ # expected_bucket_owner: "AccountId",
178
190
  # })
179
191
  # @param [Hash] options ({})
180
192
  # @option options [String] :content_md5
193
+ # The Base64 encoded 128-bit `MD5` digest of the data. You must use this
194
+ # header as a message integrity check to verify that the request body
195
+ # was not corrupted in transit. For more information, see [RFC 1864][1].
196
+ #
197
+ # For requests made using the Amazon Web Services Command Line Interface
198
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
199
+ # automatically.
200
+ #
201
+ #
202
+ #
203
+ # [1]: http://www.ietf.org/rfc/rfc1864.txt
204
+ # @option options [String] :checksum_algorithm
205
+ # Indicates the algorithm used to create the checksum for the request
206
+ # when you use the SDK. This header will not provide any additional
207
+ # functionality if you don't use the SDK. When you send this header,
208
+ # there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
209
+ # header sent. Otherwise, Amazon S3 fails the request with the HTTP
210
+ # status code `400 Bad Request`. For more information, see [Checking
211
+ # object integrity][1] in the *Amazon S3 User Guide*.
212
+ #
213
+ # If you provide an individual checksum, Amazon S3 ignores any provided
214
+ # `ChecksumAlgorithm` parameter.
215
+ #
216
+ #
217
+ #
218
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
181
219
  # @option options [required, Types::RequestPaymentConfiguration] :request_payment_configuration
220
+ # Container for Payer.
221
+ # @option options [String] :expected_bucket_owner
222
+ # The account ID of the expected bucket owner. If the account ID that
223
+ # you provide does not match the actual owner of the bucket, the request
224
+ # fails with the HTTP status code `403 Forbidden` (access denied).
182
225
  # @return [EmptyStructure]
183
226
  def put(options = {})
184
227
  options = options.merge(bucket: @bucket_name)
185
- resp = @client.put_bucket_request_payment(options)
228
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
229
+ @client.put_bucket_request_payment(options)
230
+ end
186
231
  resp.data
187
232
  end
188
233
 
@@ -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 BucketTagging
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
+ # Contains the tag set.
34
38
  # @return [Array<Types::Tag>]
35
39
  def tag_set
36
40
  data[:tag_set]
@@ -50,7 +54,9 @@ module Aws::S3
50
54
  #
51
55
  # @return [self]
52
56
  def load
53
- resp = @client.get_bucket_tagging(bucket: @bucket_name)
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
+ @client.get_bucket_tagging(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,19 +171,29 @@ module Aws::S3
163
171
  :retry
164
172
  end
165
173
  end
166
- Aws::Waiters::Waiter.new(options).wait({})
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') 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_tagging.delete()
183
+ # bucket_tagging.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_tagging(options)
194
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
195
+ @client.delete_bucket_tagging(options)
196
+ end
179
197
  resp.data
180
198
  end
181
199
 
@@ -183,6 +201,7 @@ module Aws::S3
183
201
  #
184
202
  # bucket_tagging.put({
185
203
  # content_md5: "ContentMD5",
204
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
186
205
  # tagging: { # required
187
206
  # tag_set: [ # required
188
207
  # {
@@ -191,14 +210,48 @@ module Aws::S3
191
210
  # },
192
211
  # ],
193
212
  # },
213
+ # expected_bucket_owner: "AccountId",
194
214
  # })
195
215
  # @param [Hash] options ({})
196
216
  # @option options [String] :content_md5
217
+ # The Base64 encoded 128-bit `MD5` digest of the data. You must use this
218
+ # header as a message integrity check to verify that the request body
219
+ # was not corrupted in transit. For more information, see [RFC 1864][1].
220
+ #
221
+ # For requests made using the Amazon Web Services Command Line Interface
222
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
223
+ # automatically.
224
+ #
225
+ #
226
+ #
227
+ # [1]: http://www.ietf.org/rfc/rfc1864.txt
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
197
243
  # @option options [required, Types::Tagging] :tagging
244
+ # Container for the `TagSet` and `Tag` elements.
245
+ # @option options [String] :expected_bucket_owner
246
+ # The account ID of the expected bucket owner. If the account ID that
247
+ # you provide does not match the actual owner of the bucket, the request
248
+ # fails with the HTTP status code `403 Forbidden` (access denied).
198
249
  # @return [EmptyStructure]
199
250
  def put(options = {})
200
251
  options = options.merge(bucket: @bucket_name)
201
- resp = @client.put_bucket_tagging(options)
252
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
253
+ @client.put_bucket_tagging(options)
254
+ end
202
255
  resp.data
203
256
  end
204
257