aws-sdk-s3 1.48.0 → 1.113.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +888 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +68 -0
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +74 -0
- data/lib/aws-sdk-s3/bucket.rb +375 -82
- data/lib/aws-sdk-s3/bucket_acl.rb +55 -15
- data/lib/aws-sdk-s3/bucket_cors.rb +67 -14
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +54 -16
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +56 -16
- data/lib/aws-sdk-s3/bucket_logging.rb +52 -13
- data/lib/aws-sdk-s3/bucket_notification.rb +43 -17
- data/lib/aws-sdk-s3/bucket_policy.rb +51 -13
- data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
- data/lib/aws-sdk-s3/bucket_request_payment.rb +51 -12
- data/lib/aws-sdk-s3/bucket_tagging.rb +59 -14
- data/lib/aws-sdk-s3/bucket_versioning.rb +118 -12
- data/lib/aws-sdk-s3/bucket_website.rb +66 -17
- data/lib/aws-sdk-s3/client.rb +8973 -740
- data/lib/aws-sdk-s3/client_api.rb +778 -2
- data/lib/aws-sdk-s3/customizations/bucket.rb +59 -16
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +200 -62
- data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations.rb +4 -1
- data/lib/aws-sdk-s3/encryption/client.rb +22 -5
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +34 -3
- data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
- data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
- data/lib/aws-sdk-s3/encryption.rb +4 -0
- data/lib/aws-sdk-s3/encryptionV2/client.rb +566 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +222 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
- data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
- data/lib/aws-sdk-s3/errors.rb +123 -1
- data/lib/aws-sdk-s3/event_streams.rb +8 -1
- data/lib/aws-sdk-s3/file_downloader.rb +17 -10
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +33 -14
- data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +78 -19
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +18 -7
- data/lib/aws-sdk-s3/multipart_upload.rb +178 -29
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +233 -42
- data/lib/aws-sdk-s3/object.rb +846 -179
- data/lib/aws-sdk-s3/object_acl.rb +79 -21
- data/lib/aws-sdk-s3/object_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_summary.rb +611 -162
- data/lib/aws-sdk-s3/object_version.rb +162 -71
- data/lib/aws-sdk-s3/plugins/accelerate.rb +38 -38
- data/lib/aws-sdk-s3/plugins/arn.rb +254 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +8 -8
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +25 -3
- data/lib/aws-sdk-s3/plugins/dualstack.rb +38 -33
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +4 -4
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +73 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
- data/lib/aws-sdk-s3/plugins/md5s.rb +34 -30
- data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
- data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +89 -36
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +118 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +110 -51
- data/lib/aws-sdk-s3/presigner.rb +133 -45
- data/lib/aws-sdk-s3/resource.rb +43 -7
- data/lib/aws-sdk-s3/types.rb +8437 -1132
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +12 -6
- metadata +37 -12
@@ -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/
|
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,7 +34,7 @@ module Aws::S3
|
|
30
34
|
@bucket_name
|
31
35
|
end
|
32
36
|
|
33
|
-
|
37
|
+
# Container for the bucket owner's display name and ID.
|
34
38
|
# @return [Types::Owner]
|
35
39
|
def owner
|
36
40
|
data[:owner]
|
@@ -82,7 +86,8 @@ module Aws::S3
|
|
82
86
|
# Waiter polls an API operation until a resource enters a desired
|
83
87
|
# state.
|
84
88
|
#
|
85
|
-
# @note The waiting operation is performed on a copy. The original resource
|
89
|
+
# @note The waiting operation is performed on a copy. The original resource
|
90
|
+
# remains unchanged.
|
86
91
|
#
|
87
92
|
# ## Basic Usage
|
88
93
|
#
|
@@ -95,13 +100,15 @@ module Aws::S3
|
|
95
100
|
#
|
96
101
|
# ## Example
|
97
102
|
#
|
98
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
103
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
104
|
+
# instance.state.name == 'running'
|
105
|
+
# end
|
99
106
|
#
|
100
107
|
# ## Configuration
|
101
108
|
#
|
102
109
|
# You can configure the maximum number of polling attempts, and the
|
103
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
104
|
-
# 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}:
|
105
112
|
#
|
106
113
|
# # poll for ~25 seconds
|
107
114
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -132,17 +139,16 @@ module Aws::S3
|
|
132
139
|
# # resource did not enter the desired state in time
|
133
140
|
# end
|
134
141
|
#
|
142
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
135
143
|
#
|
136
|
-
# @
|
137
|
-
#
|
138
|
-
#
|
139
|
-
# because the waiter has entered a state that it will not transition
|
140
|
-
# 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.
|
141
147
|
#
|
142
148
|
# yet successful.
|
143
149
|
#
|
144
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
145
|
-
# 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.
|
146
152
|
#
|
147
153
|
# @raise [NotImplementedError] Raised when the resource does not
|
148
154
|
#
|
@@ -197,11 +203,13 @@ module Aws::S3
|
|
197
203
|
# },
|
198
204
|
# },
|
199
205
|
# content_md5: "ContentMD5",
|
206
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
200
207
|
# grant_full_control: "GrantFullControl",
|
201
208
|
# grant_read: "GrantRead",
|
202
209
|
# grant_read_acp: "GrantReadACP",
|
203
210
|
# grant_write: "GrantWrite",
|
204
211
|
# grant_write_acp: "GrantWriteACP",
|
212
|
+
# expected_bucket_owner: "AccountId",
|
205
213
|
# })
|
206
214
|
# @param [Hash] options ({})
|
207
215
|
# @option options [String] :acl
|
@@ -210,6 +218,32 @@ module Aws::S3
|
|
210
218
|
# Contains the elements that set the ACL permissions for an object per
|
211
219
|
# grantee.
|
212
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
|
213
247
|
# @option options [String] :grant_full_control
|
214
248
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
215
249
|
# the bucket.
|
@@ -218,10 +252,16 @@ module Aws::S3
|
|
218
252
|
# @option options [String] :grant_read_acp
|
219
253
|
# Allows grantee to read the bucket ACL.
|
220
254
|
# @option options [String] :grant_write
|
221
|
-
# Allows grantee to create
|
222
|
-
#
|
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.
|
223
259
|
# @option options [String] :grant_write_acp
|
224
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).
|
225
265
|
# @return [EmptyStructure]
|
226
266
|
def put(options = {})
|
227
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/
|
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,7 +34,8 @@ module Aws::S3
|
|
30
34
|
@bucket_name
|
31
35
|
end
|
32
36
|
|
33
|
-
|
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.
|
34
39
|
# @return [Array<Types::CORSRule>]
|
35
40
|
def cors_rules
|
36
41
|
data[:cors_rules]
|
@@ -76,7 +81,8 @@ module Aws::S3
|
|
76
81
|
# Waiter polls an API operation until a resource enters a desired
|
77
82
|
# state.
|
78
83
|
#
|
79
|
-
# @note The waiting operation is performed on a copy. The original resource
|
84
|
+
# @note The waiting operation is performed on a copy. The original resource
|
85
|
+
# remains unchanged.
|
80
86
|
#
|
81
87
|
# ## Basic Usage
|
82
88
|
#
|
@@ -89,13 +95,15 @@ module Aws::S3
|
|
89
95
|
#
|
90
96
|
# ## Example
|
91
97
|
#
|
92
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
98
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
99
|
+
# instance.state.name == 'running'
|
100
|
+
# end
|
93
101
|
#
|
94
102
|
# ## Configuration
|
95
103
|
#
|
96
104
|
# You can configure the maximum number of polling attempts, and the
|
97
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
98
|
-
# 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}:
|
99
107
|
#
|
100
108
|
# # poll for ~25 seconds
|
101
109
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -126,17 +134,16 @@ module Aws::S3
|
|
126
134
|
# # resource did not enter the desired state in time
|
127
135
|
# end
|
128
136
|
#
|
137
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
129
138
|
#
|
130
|
-
# @
|
131
|
-
#
|
132
|
-
#
|
133
|
-
# because the waiter has entered a state that it will not transition
|
134
|
-
# 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.
|
135
142
|
#
|
136
143
|
# yet successful.
|
137
144
|
#
|
138
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
139
|
-
# 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.
|
140
147
|
#
|
141
148
|
# @raise [NotImplementedError] Raised when the resource does not
|
142
149
|
#
|
@@ -170,8 +177,14 @@ module Aws::S3
|
|
170
177
|
|
171
178
|
# @example Request syntax with placeholder values
|
172
179
|
#
|
173
|
-
# bucket_cors.delete(
|
180
|
+
# bucket_cors.delete({
|
181
|
+
# expected_bucket_owner: "AccountId",
|
182
|
+
# })
|
174
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).
|
175
188
|
# @return [EmptyStructure]
|
176
189
|
def delete(options = {})
|
177
190
|
options = options.merge(bucket: @bucket_name)
|
@@ -185,6 +198,7 @@ module Aws::S3
|
|
185
198
|
# cors_configuration: { # required
|
186
199
|
# cors_rules: [ # required
|
187
200
|
# {
|
201
|
+
# id: "ID",
|
188
202
|
# allowed_headers: ["AllowedHeader"],
|
189
203
|
# allowed_methods: ["AllowedMethod"], # required
|
190
204
|
# allowed_origins: ["AllowedOrigin"], # required
|
@@ -194,10 +208,49 @@ module Aws::S3
|
|
194
208
|
# ],
|
195
209
|
# },
|
196
210
|
# content_md5: "ContentMD5",
|
211
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
212
|
+
# expected_bucket_owner: "AccountId",
|
197
213
|
# })
|
198
214
|
# @param [Hash] options ({})
|
199
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
|
200
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).
|
201
254
|
# @return [EmptyStructure]
|
202
255
|
def put(options = {})
|
203
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/
|
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,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::Rule>]
|
35
39
|
def rules
|
36
40
|
data[:rules]
|
@@ -76,7 +80,8 @@ module Aws::S3
|
|
76
80
|
# Waiter polls an API operation until a resource enters a desired
|
77
81
|
# state.
|
78
82
|
#
|
79
|
-
# @note The waiting operation is performed on a copy. The original resource
|
83
|
+
# @note The waiting operation is performed on a copy. The original resource
|
84
|
+
# remains unchanged.
|
80
85
|
#
|
81
86
|
# ## Basic Usage
|
82
87
|
#
|
@@ -89,13 +94,15 @@ module Aws::S3
|
|
89
94
|
#
|
90
95
|
# ## Example
|
91
96
|
#
|
92
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
97
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
98
|
+
# instance.state.name == 'running'
|
99
|
+
# end
|
93
100
|
#
|
94
101
|
# ## Configuration
|
95
102
|
#
|
96
103
|
# You can configure the maximum number of polling attempts, and the
|
97
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
98
|
-
# 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}:
|
99
106
|
#
|
100
107
|
# # poll for ~25 seconds
|
101
108
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -126,17 +133,16 @@ module Aws::S3
|
|
126
133
|
# # resource did not enter the desired state in time
|
127
134
|
# end
|
128
135
|
#
|
136
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
129
137
|
#
|
130
|
-
# @
|
131
|
-
#
|
132
|
-
#
|
133
|
-
# because the waiter has entered a state that it will not transition
|
134
|
-
# 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.
|
135
141
|
#
|
136
142
|
# yet successful.
|
137
143
|
#
|
138
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
139
|
-
# 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.
|
140
146
|
#
|
141
147
|
# @raise [NotImplementedError] Raised when the resource does not
|
142
148
|
#
|
@@ -170,8 +176,14 @@ module Aws::S3
|
|
170
176
|
|
171
177
|
# @example Request syntax with placeholder values
|
172
178
|
#
|
173
|
-
# bucket_lifecycle.delete(
|
179
|
+
# bucket_lifecycle.delete({
|
180
|
+
# expected_bucket_owner: "AccountId",
|
181
|
+
# })
|
174
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).
|
175
187
|
# @return [EmptyStructure]
|
176
188
|
def delete(options = {})
|
177
189
|
options = options.merge(bucket: @bucket_name)
|
@@ -183,6 +195,7 @@ module Aws::S3
|
|
183
195
|
#
|
184
196
|
# bucket_lifecycle.put({
|
185
197
|
# content_md5: "ContentMD5",
|
198
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
186
199
|
# lifecycle_configuration: {
|
187
200
|
# rules: [ # required
|
188
201
|
# {
|
@@ -197,14 +210,16 @@ module Aws::S3
|
|
197
210
|
# transition: {
|
198
211
|
# date: Time.now,
|
199
212
|
# days: 1,
|
200
|
-
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
|
213
|
+
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
|
201
214
|
# },
|
202
215
|
# noncurrent_version_transition: {
|
203
216
|
# noncurrent_days: 1,
|
204
|
-
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
|
217
|
+
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
|
218
|
+
# newer_noncurrent_versions: 1,
|
205
219
|
# },
|
206
220
|
# noncurrent_version_expiration: {
|
207
221
|
# noncurrent_days: 1,
|
222
|
+
# newer_noncurrent_versions: 1,
|
208
223
|
# },
|
209
224
|
# abort_incomplete_multipart_upload: {
|
210
225
|
# days_after_initiation: 1,
|
@@ -212,10 +227,33 @@ module Aws::S3
|
|
212
227
|
# },
|
213
228
|
# ],
|
214
229
|
# },
|
230
|
+
# expected_bucket_owner: "AccountId",
|
215
231
|
# })
|
216
232
|
# @param [Hash] options ({})
|
217
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
|
218
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).
|
219
257
|
# @return [EmptyStructure]
|
220
258
|
def put(options = {})
|
221
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/
|
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]
|
@@ -76,7 +80,8 @@ module Aws::S3
|
|
76
80
|
# Waiter polls an API operation until a resource enters a desired
|
77
81
|
# state.
|
78
82
|
#
|
79
|
-
# @note The waiting operation is performed on a copy. The original resource
|
83
|
+
# @note The waiting operation is performed on a copy. The original resource
|
84
|
+
# remains unchanged.
|
80
85
|
#
|
81
86
|
# ## Basic Usage
|
82
87
|
#
|
@@ -89,13 +94,15 @@ module Aws::S3
|
|
89
94
|
#
|
90
95
|
# ## Example
|
91
96
|
#
|
92
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
97
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
98
|
+
# instance.state.name == 'running'
|
99
|
+
# end
|
93
100
|
#
|
94
101
|
# ## Configuration
|
95
102
|
#
|
96
103
|
# You can configure the maximum number of polling attempts, and the
|
97
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
98
|
-
# 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}:
|
99
106
|
#
|
100
107
|
# # poll for ~25 seconds
|
101
108
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -126,17 +133,16 @@ module Aws::S3
|
|
126
133
|
# # resource did not enter the desired state in time
|
127
134
|
# end
|
128
135
|
#
|
136
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
129
137
|
#
|
130
|
-
# @
|
131
|
-
#
|
132
|
-
#
|
133
|
-
# because the waiter has entered a state that it will not transition
|
134
|
-
# 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.
|
135
141
|
#
|
136
142
|
# yet successful.
|
137
143
|
#
|
138
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
139
|
-
# 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.
|
140
146
|
#
|
141
147
|
# @raise [NotImplementedError] Raised when the resource does not
|
142
148
|
#
|
@@ -170,8 +176,14 @@ module Aws::S3
|
|
170
176
|
|
171
177
|
# @example Request syntax with placeholder values
|
172
178
|
#
|
173
|
-
# bucket_lifecycle_configuration.delete(
|
179
|
+
# bucket_lifecycle_configuration.delete({
|
180
|
+
# expected_bucket_owner: "AccountId",
|
181
|
+
# })
|
174
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).
|
175
187
|
# @return [EmptyStructure]
|
176
188
|
def delete(options = {})
|
177
189
|
options = options.merge(bucket: @bucket_name)
|
@@ -182,6 +194,7 @@ module Aws::S3
|
|
182
194
|
# @example Request syntax with placeholder values
|
183
195
|
#
|
184
196
|
# bucket_lifecycle_configuration.put({
|
197
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
185
198
|
# lifecycle_configuration: {
|
186
199
|
# rules: [ # required
|
187
200
|
# {
|
@@ -198,6 +211,8 @@ module Aws::S3
|
|
198
211
|
# key: "ObjectKey", # required
|
199
212
|
# value: "Value", # required
|
200
213
|
# },
|
214
|
+
# object_size_greater_than: 1,
|
215
|
+
# object_size_less_than: 1,
|
201
216
|
# and: {
|
202
217
|
# prefix: "Prefix",
|
203
218
|
# tags: [
|
@@ -206,6 +221,8 @@ module Aws::S3
|
|
206
221
|
# value: "Value", # required
|
207
222
|
# },
|
208
223
|
# ],
|
224
|
+
# object_size_greater_than: 1,
|
225
|
+
# object_size_less_than: 1,
|
209
226
|
# },
|
210
227
|
# },
|
211
228
|
# status: "Enabled", # required, accepts Enabled, Disabled
|
@@ -213,17 +230,19 @@ module Aws::S3
|
|
213
230
|
# {
|
214
231
|
# date: Time.now,
|
215
232
|
# days: 1,
|
216
|
-
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
|
233
|
+
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
|
217
234
|
# },
|
218
235
|
# ],
|
219
236
|
# noncurrent_version_transitions: [
|
220
237
|
# {
|
221
238
|
# noncurrent_days: 1,
|
222
|
-
# 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
|
240
|
+
# newer_noncurrent_versions: 1,
|
223
241
|
# },
|
224
242
|
# ],
|
225
243
|
# noncurrent_version_expiration: {
|
226
244
|
# noncurrent_days: 1,
|
245
|
+
# newer_noncurrent_versions: 1,
|
227
246
|
# },
|
228
247
|
# abort_incomplete_multipart_upload: {
|
229
248
|
# days_after_initiation: 1,
|
@@ -231,9 +250,30 @@ module Aws::S3
|
|
231
250
|
# },
|
232
251
|
# ],
|
233
252
|
# },
|
253
|
+
# expected_bucket_owner: "AccountId",
|
234
254
|
# })
|
235
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
|
236
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).
|
237
277
|
# @return [EmptyStructure]
|
238
278
|
def put(options = {})
|
239
279
|
options = options.merge(bucket: @bucket_name)
|