aws-sdk-s3 1.21.0 → 1.117.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +930 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/bucket.rb +393 -75
  6. data/lib/aws-sdk-s3/bucket_acl.rb +57 -14
  7. data/lib/aws-sdk-s3/bucket_cors.rb +67 -13
  8. data/lib/aws-sdk-s3/bucket_lifecycle.rb +54 -15
  9. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +56 -15
  10. data/lib/aws-sdk-s3/bucket_logging.rb +52 -15
  11. data/lib/aws-sdk-s3/bucket_notification.rb +47 -17
  12. data/lib/aws-sdk-s3/bucket_policy.rb +51 -13
  13. data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
  14. data/lib/aws-sdk-s3/bucket_request_payment.rb +51 -12
  15. data/lib/aws-sdk-s3/bucket_tagging.rb +59 -13
  16. data/lib/aws-sdk-s3/bucket_versioning.rb +118 -12
  17. data/lib/aws-sdk-s3/bucket_website.rb +66 -13
  18. data/lib/aws-sdk-s3/client.rb +11422 -2518
  19. data/lib/aws-sdk-s3/client_api.rb +1196 -155
  20. data/lib/aws-sdk-s3/customizations/bucket.rb +53 -36
  21. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  22. data/lib/aws-sdk-s3/customizations/object.rb +200 -62
  23. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  24. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  25. data/lib/aws-sdk-s3/customizations.rb +4 -1
  26. data/lib/aws-sdk-s3/encryption/client.rb +23 -6
  27. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  28. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  29. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  30. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  31. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  32. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +11 -3
  33. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  34. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  35. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  36. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +34 -3
  37. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  38. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  39. data/lib/aws-sdk-s3/encryption.rb +4 -0
  40. data/lib/aws-sdk-s3/encryptionV2/client.rb +566 -0
  41. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +222 -0
  42. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  43. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  44. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  45. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  46. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  47. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  48. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  49. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  50. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
  51. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  52. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  53. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  54. data/lib/aws-sdk-s3/endpoint_parameters.rb +142 -0
  55. data/lib/aws-sdk-s3/endpoint_provider.rb +2020 -0
  56. data/lib/aws-sdk-s3/endpoints.rb +2149 -0
  57. data/lib/aws-sdk-s3/errors.rb +123 -1
  58. data/lib/aws-sdk-s3/event_streams.rb +20 -7
  59. data/lib/aws-sdk-s3/file_downloader.rb +17 -10
  60. data/lib/aws-sdk-s3/file_part.rb +11 -6
  61. data/lib/aws-sdk-s3/file_uploader.rb +33 -14
  62. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  63. data/lib/aws-sdk-s3/multipart_file_uploader.rb +78 -19
  64. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +54 -15
  65. data/lib/aws-sdk-s3/multipart_upload.rb +178 -28
  66. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  67. data/lib/aws-sdk-s3/multipart_upload_part.rb +237 -44
  68. data/lib/aws-sdk-s3/object.rb +897 -154
  69. data/lib/aws-sdk-s3/object_acl.rb +81 -20
  70. data/lib/aws-sdk-s3/object_copier.rb +2 -0
  71. data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
  72. data/lib/aws-sdk-s3/object_summary.rb +649 -139
  73. data/lib/aws-sdk-s3/object_version.rb +167 -65
  74. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  75. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  76. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
  77. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  78. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  79. data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
  80. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  81. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  82. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
  83. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  84. data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
  85. data/lib/aws-sdk-s3/plugins/md5s.rb +34 -27
  86. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  87. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  88. data/lib/aws-sdk-s3/plugins/s3_signer.rb +55 -92
  89. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  90. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  91. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
  92. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  93. data/lib/aws-sdk-s3/presigned_post.rb +108 -56
  94. data/lib/aws-sdk-s3/presigner.rb +169 -77
  95. data/lib/aws-sdk-s3/resource.rb +45 -5
  96. data/lib/aws-sdk-s3/types.rb +8564 -3891
  97. data/lib/aws-sdk-s3/waiters.rb +67 -1
  98. data/lib/aws-sdk-s3.rb +16 -6
  99. metadata +37 -13
@@ -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 BucketAcl
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,6 +34,7 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
37
+ # Container for the bucket owner's display name and ID.
33
38
  # @return [Types::Owner]
34
39
  def owner
35
40
  data[:owner]
@@ -81,7 +86,8 @@ module Aws::S3
81
86
  # Waiter polls an API operation until a resource enters a desired
82
87
  # state.
83
88
  #
84
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
89
+ # @note The waiting operation is performed on a copy. The original resource
90
+ # remains unchanged.
85
91
  #
86
92
  # ## Basic Usage
87
93
  #
@@ -94,13 +100,15 @@ module Aws::S3
94
100
  #
95
101
  # ## Example
96
102
  #
97
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
103
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
104
+ # instance.state.name == 'running'
105
+ # end
98
106
  #
99
107
  # ## Configuration
100
108
  #
101
109
  # You can configure the maximum number of polling attempts, and the
102
- # delay (in seconds) between each polling attempt. The waiting condition is set
103
- # by passing a block to {#wait_until}:
110
+ # delay (in seconds) between each polling attempt. The waiting condition is
111
+ # set by passing a block to {#wait_until}:
104
112
  #
105
113
  # # poll for ~25 seconds
106
114
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -131,17 +139,16 @@ module Aws::S3
131
139
  # # resource did not enter the desired state in time
132
140
  # end
133
141
  #
142
+ # @yieldparam [Resource] resource to be used in the waiting condition.
134
143
  #
135
- # @yield param [Resource] resource to be used in the waiting condition
136
- #
137
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
138
- # because the waiter has entered a state that it will not transition
139
- # out of, preventing success.
144
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
145
+ # terminates because the waiter has entered a state that it will not
146
+ # transition out of, preventing success.
140
147
  #
141
148
  # yet successful.
142
149
  #
143
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
144
- # while polling for a resource that is not expected.
150
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
151
+ # encountered while polling for a resource that is not expected.
145
152
  #
146
153
  # @raise [NotImplementedError] Raised when the resource does not
147
154
  #
@@ -196,17 +203,47 @@ module Aws::S3
196
203
  # },
197
204
  # },
198
205
  # content_md5: "ContentMD5",
206
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
199
207
  # grant_full_control: "GrantFullControl",
200
208
  # grant_read: "GrantRead",
201
209
  # grant_read_acp: "GrantReadACP",
202
210
  # grant_write: "GrantWrite",
203
211
  # grant_write_acp: "GrantWriteACP",
212
+ # expected_bucket_owner: "AccountId",
204
213
  # })
205
214
  # @param [Hash] options ({})
206
215
  # @option options [String] :acl
207
216
  # The canned ACL to apply to the bucket.
208
217
  # @option options [Types::AccessControlPolicy] :access_control_policy
218
+ # Contains the elements that set the ACL permissions for an object per
219
+ # grantee.
209
220
  # @option options [String] :content_md5
221
+ # The base64-encoded 128-bit MD5 digest of the data. This header must be
222
+ # used as a message integrity check to verify that the request body was
223
+ # not corrupted in transit. For more information, go to [RFC 1864.][1]
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
+ #
229
+ #
230
+ #
231
+ # [1]: http://www.ietf.org/rfc/rfc1864.txt
232
+ # @option options [String] :checksum_algorithm
233
+ # Indicates the algorithm used to create the checksum for the object
234
+ # when using the SDK. This header will not provide any additional
235
+ # functionality if not using the SDK. When sending this header, there
236
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
237
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
238
+ # `400 Bad Request`. For more information, see [Checking object
239
+ # integrity][1] in the *Amazon S3 User Guide*.
240
+ #
241
+ # If you provide an individual checksum, Amazon S3 ignores any provided
242
+ # `ChecksumAlgorithm` parameter.
243
+ #
244
+ #
245
+ #
246
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
210
247
  # @option options [String] :grant_full_control
211
248
  # Allows grantee the read, write, read ACP, and write ACP permissions on
212
249
  # the bucket.
@@ -215,10 +252,16 @@ module Aws::S3
215
252
  # @option options [String] :grant_read_acp
216
253
  # Allows grantee to read the bucket ACL.
217
254
  # @option options [String] :grant_write
218
- # Allows grantee to create, overwrite, and delete any object in the
219
- # bucket.
255
+ # Allows grantee to create new objects in the bucket.
256
+ #
257
+ # For the bucket and object owners of existing objects, also allows
258
+ # deletions and overwrites of those objects.
220
259
  # @option options [String] :grant_write_acp
221
260
  # Allows grantee to write the ACL for the applicable bucket.
261
+ # @option options [String] :expected_bucket_owner
262
+ # The account ID of the expected bucket owner. If the bucket is owned by
263
+ # a different account, the request fails with the HTTP status code `403
264
+ # Forbidden` (access denied).
222
265
  # @return [EmptyStructure]
223
266
  def put(options = {})
224
267
  options = options.merge(bucket: @bucket_name)
@@ -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 BucketCors
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,6 +34,8 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
37
+ # A set of origins and methods (cross-origin access that you want to
38
+ # allow). You can add up to 100 rules to the configuration.
33
39
  # @return [Array<Types::CORSRule>]
34
40
  def cors_rules
35
41
  data[:cors_rules]
@@ -75,7 +81,8 @@ module Aws::S3
75
81
  # Waiter polls an API operation until a resource enters a desired
76
82
  # state.
77
83
  #
78
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
84
+ # @note The waiting operation is performed on a copy. The original resource
85
+ # remains unchanged.
79
86
  #
80
87
  # ## Basic Usage
81
88
  #
@@ -88,13 +95,15 @@ module Aws::S3
88
95
  #
89
96
  # ## Example
90
97
  #
91
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
98
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
99
+ # instance.state.name == 'running'
100
+ # end
92
101
  #
93
102
  # ## Configuration
94
103
  #
95
104
  # 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}:
105
+ # delay (in seconds) between each polling attempt. The waiting condition is
106
+ # set by passing a block to {#wait_until}:
98
107
  #
99
108
  # # poll for ~25 seconds
100
109
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -125,17 +134,16 @@ module Aws::S3
125
134
  # # resource did not enter the desired state in time
126
135
  # end
127
136
  #
137
+ # @yieldparam [Resource] resource to be used in the waiting condition.
128
138
  #
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.
139
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
140
+ # terminates because the waiter has entered a state that it will not
141
+ # transition out of, preventing success.
134
142
  #
135
143
  # yet successful.
136
144
  #
137
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
- # while polling for a resource that is not expected.
145
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
146
+ # encountered while polling for a resource that is not expected.
139
147
  #
140
148
  # @raise [NotImplementedError] Raised when the resource does not
141
149
  #
@@ -169,8 +177,14 @@ module Aws::S3
169
177
 
170
178
  # @example Request syntax with placeholder values
171
179
  #
172
- # bucket_cors.delete()
180
+ # bucket_cors.delete({
181
+ # expected_bucket_owner: "AccountId",
182
+ # })
173
183
  # @param [Hash] options ({})
184
+ # @option options [String] :expected_bucket_owner
185
+ # The account ID of the expected bucket owner. If the bucket is owned by
186
+ # a different account, the request fails with the HTTP status code `403
187
+ # Forbidden` (access denied).
174
188
  # @return [EmptyStructure]
175
189
  def delete(options = {})
176
190
  options = options.merge(bucket: @bucket_name)
@@ -184,6 +198,7 @@ module Aws::S3
184
198
  # cors_configuration: { # required
185
199
  # cors_rules: [ # required
186
200
  # {
201
+ # id: "ID",
187
202
  # allowed_headers: ["AllowedHeader"],
188
203
  # allowed_methods: ["AllowedMethod"], # required
189
204
  # allowed_origins: ["AllowedOrigin"], # required
@@ -193,10 +208,49 @@ module Aws::S3
193
208
  # ],
194
209
  # },
195
210
  # content_md5: "ContentMD5",
211
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
212
+ # expected_bucket_owner: "AccountId",
196
213
  # })
197
214
  # @param [Hash] options ({})
198
215
  # @option options [required, Types::CORSConfiguration] :cors_configuration
216
+ # Describes the cross-origin access configuration for objects in an
217
+ # Amazon S3 bucket. For more information, see [Enabling Cross-Origin
218
+ # Resource Sharing][1] in the *Amazon S3 User Guide*.
219
+ #
220
+ #
221
+ #
222
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html
199
223
  # @option options [String] :content_md5
224
+ # The base64-encoded 128-bit MD5 digest of the data. This header must be
225
+ # used as a message integrity check to verify that the request body was
226
+ # not corrupted in transit. For more information, go to [RFC 1864.][1]
227
+ #
228
+ # For requests made using the Amazon Web Services Command Line Interface
229
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
230
+ # automatically.
231
+ #
232
+ #
233
+ #
234
+ # [1]: http://www.ietf.org/rfc/rfc1864.txt
235
+ # @option options [String] :checksum_algorithm
236
+ # Indicates the algorithm used to create the checksum for the object
237
+ # when using the SDK. This header will not provide any additional
238
+ # functionality if not using the SDK. When sending this header, there
239
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
240
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
241
+ # `400 Bad Request`. For more information, see [Checking object
242
+ # integrity][1] in the *Amazon S3 User Guide*.
243
+ #
244
+ # If you provide an individual checksum, Amazon S3 ignores any provided
245
+ # `ChecksumAlgorithm` parameter.
246
+ #
247
+ #
248
+ #
249
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
250
+ # @option options [String] :expected_bucket_owner
251
+ # The account ID of the expected bucket owner. If the bucket is owned by
252
+ # a different account, the request fails with the HTTP status code `403
253
+ # Forbidden` (access denied).
200
254
  # @return [EmptyStructure]
201
255
  def put(options = {})
202
256
  options = options.merge(bucket: @bucket_name)
@@ -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 BucketLifecycle
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,6 +34,7 @@ module Aws::S3
30
34
  @bucket_name
31
35
  end
32
36
 
37
+ # Container for a lifecycle rule.
33
38
  # @return [Array<Types::Rule>]
34
39
  def rules
35
40
  data[:rules]
@@ -75,7 +80,8 @@ module Aws::S3
75
80
  # Waiter polls an API operation until a resource enters a desired
76
81
  # state.
77
82
  #
78
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
83
+ # @note The waiting operation is performed on a copy. The original resource
84
+ # remains unchanged.
79
85
  #
80
86
  # ## Basic Usage
81
87
  #
@@ -88,13 +94,15 @@ module Aws::S3
88
94
  #
89
95
  # ## Example
90
96
  #
91
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
97
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
98
+ # instance.state.name == 'running'
99
+ # end
92
100
  #
93
101
  # ## Configuration
94
102
  #
95
103
  # 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}:
104
+ # delay (in seconds) between each polling attempt. The waiting condition is
105
+ # set by passing a block to {#wait_until}:
98
106
  #
99
107
  # # poll for ~25 seconds
100
108
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -125,17 +133,16 @@ module Aws::S3
125
133
  # # resource did not enter the desired state in time
126
134
  # end
127
135
  #
136
+ # @yieldparam [Resource] resource to be used in the waiting condition.
128
137
  #
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.
138
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
139
+ # terminates because the waiter has entered a state that it will not
140
+ # transition out of, preventing success.
134
141
  #
135
142
  # yet successful.
136
143
  #
137
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
- # while polling for a resource that is not expected.
144
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
145
+ # encountered while polling for a resource that is not expected.
139
146
  #
140
147
  # @raise [NotImplementedError] Raised when the resource does not
141
148
  #
@@ -169,8 +176,14 @@ module Aws::S3
169
176
 
170
177
  # @example Request syntax with placeholder values
171
178
  #
172
- # bucket_lifecycle.delete()
179
+ # bucket_lifecycle.delete({
180
+ # expected_bucket_owner: "AccountId",
181
+ # })
173
182
  # @param [Hash] options ({})
183
+ # @option options [String] :expected_bucket_owner
184
+ # The account ID of the expected bucket owner. If the bucket is owned by
185
+ # a different account, the request fails with the HTTP status code `403
186
+ # Forbidden` (access denied).
174
187
  # @return [EmptyStructure]
175
188
  def delete(options = {})
176
189
  options = options.merge(bucket: @bucket_name)
@@ -182,6 +195,7 @@ module Aws::S3
182
195
  #
183
196
  # bucket_lifecycle.put({
184
197
  # content_md5: "ContentMD5",
198
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
185
199
  # lifecycle_configuration: {
186
200
  # rules: [ # required
187
201
  # {
@@ -196,14 +210,16 @@ module Aws::S3
196
210
  # transition: {
197
211
  # date: Time.now,
198
212
  # days: 1,
199
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
213
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
200
214
  # },
201
215
  # noncurrent_version_transition: {
202
216
  # noncurrent_days: 1,
203
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
217
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
218
+ # newer_noncurrent_versions: 1,
204
219
  # },
205
220
  # noncurrent_version_expiration: {
206
221
  # noncurrent_days: 1,
222
+ # newer_noncurrent_versions: 1,
207
223
  # },
208
224
  # abort_incomplete_multipart_upload: {
209
225
  # days_after_initiation: 1,
@@ -211,10 +227,33 @@ module Aws::S3
211
227
  # },
212
228
  # ],
213
229
  # },
230
+ # expected_bucket_owner: "AccountId",
214
231
  # })
215
232
  # @param [Hash] options ({})
216
233
  # @option options [String] :content_md5
234
+ # For requests made using the Amazon Web Services Command Line Interface
235
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
236
+ # automatically.
237
+ # @option options [String] :checksum_algorithm
238
+ # Indicates the algorithm used to create the checksum for the object
239
+ # when using the SDK. This header will not provide any additional
240
+ # functionality if not using the SDK. When sending this header, there
241
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
242
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
243
+ # `400 Bad Request`. For more information, see [Checking object
244
+ # integrity][1] in the *Amazon S3 User Guide*.
245
+ #
246
+ # If you provide an individual checksum, Amazon S3 ignores any provided
247
+ # `ChecksumAlgorithm` parameter.
248
+ #
249
+ #
250
+ #
251
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
217
252
  # @option options [Types::LifecycleConfiguration] :lifecycle_configuration
253
+ # @option options [String] :expected_bucket_owner
254
+ # The account ID of the expected bucket owner. If the bucket is owned by
255
+ # a different account, the request fails with the HTTP status code `403
256
+ # Forbidden` (access denied).
218
257
  # @return [EmptyStructure]
219
258
  def put(options = {})
220
259
  options = options.merge(bucket: @bucket_name)
@@ -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,6 +34,7 @@ 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]
@@ -75,7 +80,8 @@ module Aws::S3
75
80
  # Waiter polls an API operation until a resource enters a desired
76
81
  # state.
77
82
  #
78
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
83
+ # @note The waiting operation is performed on a copy. The original resource
84
+ # remains unchanged.
79
85
  #
80
86
  # ## Basic Usage
81
87
  #
@@ -88,13 +94,15 @@ module Aws::S3
88
94
  #
89
95
  # ## Example
90
96
  #
91
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
97
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
98
+ # instance.state.name == 'running'
99
+ # end
92
100
  #
93
101
  # ## Configuration
94
102
  #
95
103
  # 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}:
104
+ # delay (in seconds) between each polling attempt. The waiting condition is
105
+ # set by passing a block to {#wait_until}:
98
106
  #
99
107
  # # poll for ~25 seconds
100
108
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -125,17 +133,16 @@ module Aws::S3
125
133
  # # resource did not enter the desired state in time
126
134
  # end
127
135
  #
136
+ # @yieldparam [Resource] resource to be used in the waiting condition.
128
137
  #
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.
138
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
139
+ # terminates because the waiter has entered a state that it will not
140
+ # transition out of, preventing success.
134
141
  #
135
142
  # yet successful.
136
143
  #
137
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
- # while polling for a resource that is not expected.
144
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
145
+ # encountered while polling for a resource that is not expected.
139
146
  #
140
147
  # @raise [NotImplementedError] Raised when the resource does not
141
148
  #
@@ -169,8 +176,14 @@ module Aws::S3
169
176
 
170
177
  # @example Request syntax with placeholder values
171
178
  #
172
- # bucket_lifecycle_configuration.delete()
179
+ # bucket_lifecycle_configuration.delete({
180
+ # expected_bucket_owner: "AccountId",
181
+ # })
173
182
  # @param [Hash] options ({})
183
+ # @option options [String] :expected_bucket_owner
184
+ # The account ID of the expected bucket owner. If the bucket is owned by
185
+ # a different account, the request fails with the HTTP status code `403
186
+ # Forbidden` (access denied).
174
187
  # @return [EmptyStructure]
175
188
  def delete(options = {})
176
189
  options = options.merge(bucket: @bucket_name)
@@ -181,6 +194,7 @@ module Aws::S3
181
194
  # @example Request syntax with placeholder values
182
195
  #
183
196
  # bucket_lifecycle_configuration.put({
197
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
184
198
  # lifecycle_configuration: {
185
199
  # rules: [ # required
186
200
  # {
@@ -197,6 +211,8 @@ module Aws::S3
197
211
  # key: "ObjectKey", # required
198
212
  # value: "Value", # required
199
213
  # },
214
+ # object_size_greater_than: 1,
215
+ # object_size_less_than: 1,
200
216
  # and: {
201
217
  # prefix: "Prefix",
202
218
  # tags: [
@@ -205,6 +221,8 @@ module Aws::S3
205
221
  # value: "Value", # required
206
222
  # },
207
223
  # ],
224
+ # object_size_greater_than: 1,
225
+ # object_size_less_than: 1,
208
226
  # },
209
227
  # },
210
228
  # status: "Enabled", # required, accepts Enabled, Disabled
@@ -212,17 +230,19 @@ module Aws::S3
212
230
  # {
213
231
  # date: Time.now,
214
232
  # days: 1,
215
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
233
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
216
234
  # },
217
235
  # ],
218
236
  # noncurrent_version_transitions: [
219
237
  # {
220
238
  # noncurrent_days: 1,
221
- # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA
239
+ # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
240
+ # newer_noncurrent_versions: 1,
222
241
  # },
223
242
  # ],
224
243
  # noncurrent_version_expiration: {
225
244
  # noncurrent_days: 1,
245
+ # newer_noncurrent_versions: 1,
226
246
  # },
227
247
  # abort_incomplete_multipart_upload: {
228
248
  # days_after_initiation: 1,
@@ -230,9 +250,30 @@ module Aws::S3
230
250
  # },
231
251
  # ],
232
252
  # },
253
+ # expected_bucket_owner: "AccountId",
233
254
  # })
234
255
  # @param [Hash] options ({})
256
+ # @option options [String] :checksum_algorithm
257
+ # Indicates the algorithm used to create the checksum for the object
258
+ # when using the SDK. This header will not provide any additional
259
+ # functionality if not using the SDK. When sending this header, there
260
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
261
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
262
+ # `400 Bad Request`. For more information, see [Checking object
263
+ # integrity][1] in the *Amazon S3 User Guide*.
264
+ #
265
+ # If you provide an individual checksum, Amazon S3 ignores any provided
266
+ # `ChecksumAlgorithm` parameter.
267
+ #
268
+ #
269
+ #
270
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
235
271
  # @option options [Types::BucketLifecycleConfiguration] :lifecycle_configuration
272
+ # Container for lifecycle rules. You can add as many as 1,000 rules.
273
+ # @option options [String] :expected_bucket_owner
274
+ # The account ID of the expected bucket owner. If the bucket is owned by
275
+ # a different account, the request fails with the HTTP status code `403
276
+ # Forbidden` (access denied).
236
277
  # @return [EmptyStructure]
237
278
  def put(options = {})
238
279
  options = options.merge(bucket: @bucket_name)