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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1352 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
- data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
- data/lib/aws-sdk-s3/bucket.rb +1005 -106
- data/lib/aws-sdk-s3/bucket_acl.rb +65 -18
- data/lib/aws-sdk-s3/bucket_cors.rb +80 -18
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -20
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -21
- data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
- data/lib/aws-sdk-s3/bucket_notification.rb +52 -20
- data/lib/aws-sdk-s3/bucket_policy.rb +108 -17
- data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
- data/lib/aws-sdk-s3/bucket_tagging.rb +71 -18
- data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
- data/lib/aws-sdk-s3/bucket_website.rb +78 -21
- data/lib/aws-sdk-s3/client.rb +14517 -941
- data/lib/aws-sdk-s3/client_api.rb +1296 -197
- data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
- data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +288 -68
- data/lib/aws-sdk-s3/customizations/object_summary.rb +10 -0
- data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
- data/lib/aws-sdk-s3/customizations.rb +27 -28
- data/lib/aws-sdk-s3/encryption/client.rb +28 -7
- 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 +46 -11
- 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 +570 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -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 +173 -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/endpoint_parameters.rb +181 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +716 -0
- data/lib/aws-sdk-s3/endpoints.rb +1434 -0
- data/lib/aws-sdk-s3/errors.rb +170 -1
- data/lib/aws-sdk-s3/event_streams.rb +8 -1
- data/lib/aws-sdk-s3/express_credentials.rb +55 -0
- data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
- data/lib/aws-sdk-s3/file_downloader.rb +161 -46
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +39 -18
- data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +104 -27
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +61 -21
- data/lib/aws-sdk-s3/multipart_upload.rb +342 -32
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +384 -46
- data/lib/aws-sdk-s3/object.rb +2600 -231
- data/lib/aws-sdk-s3/object_acl.rb +103 -25
- data/lib/aws-sdk-s3/object_copier.rb +9 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -22
- data/lib/aws-sdk-s3/object_summary.rb +2174 -204
- data/lib/aws-sdk-s3/object_version.rb +539 -80
- data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
- data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
- data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
- data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
- data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
- data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +14 -70
- 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 +63 -94
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +160 -99
- data/lib/aws-sdk-s3/presigner.rb +141 -62
- data/lib/aws-sdk-s3/resource.rb +156 -17
- data/lib/aws-sdk-s3/types.rb +13021 -4106
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +46 -32
- data/sig/bucket.rbs +222 -0
- data/sig/bucket_acl.rbs +78 -0
- data/sig/bucket_cors.rbs +69 -0
- data/sig/bucket_lifecycle.rbs +88 -0
- data/sig/bucket_lifecycle_configuration.rbs +115 -0
- data/sig/bucket_logging.rbs +76 -0
- data/sig/bucket_notification.rbs +114 -0
- data/sig/bucket_policy.rbs +59 -0
- data/sig/bucket_request_payment.rbs +54 -0
- data/sig/bucket_tagging.rbs +65 -0
- data/sig/bucket_versioning.rbs +77 -0
- data/sig/bucket_website.rbs +93 -0
- data/sig/client.rbs +2472 -0
- data/sig/customizations/bucket.rbs +19 -0
- data/sig/customizations/object.rbs +38 -0
- data/sig/customizations/object_summary.rbs +35 -0
- data/sig/errors.rbs +42 -0
- data/sig/multipart_upload.rbs +120 -0
- data/sig/multipart_upload_part.rbs +109 -0
- data/sig/object.rbs +459 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +345 -0
- data/sig/object_version.rbs +143 -0
- data/sig/resource.rbs +134 -0
- data/sig/types.rbs +2712 -0
- data/sig/waiters.rbs +95 -0
- 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/
|
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]
|
@@ -56,7 +60,9 @@ module Aws::S3
|
|
56
60
|
#
|
57
61
|
# @return [self]
|
58
62
|
def load
|
59
|
-
resp =
|
63
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
64
|
+
@client.get_bucket_acl(bucket: @bucket_name)
|
65
|
+
end
|
60
66
|
@data = resp.data
|
61
67
|
self
|
62
68
|
end
|
@@ -82,7 +88,8 @@ module Aws::S3
|
|
82
88
|
# Waiter polls an API operation until a resource enters a desired
|
83
89
|
# state.
|
84
90
|
#
|
85
|
-
# @note The waiting operation is performed on a copy. The original resource
|
91
|
+
# @note The waiting operation is performed on a copy. The original resource
|
92
|
+
# remains unchanged.
|
86
93
|
#
|
87
94
|
# ## Basic Usage
|
88
95
|
#
|
@@ -95,13 +102,15 @@ module Aws::S3
|
|
95
102
|
#
|
96
103
|
# ## Example
|
97
104
|
#
|
98
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
105
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
106
|
+
# instance.state.name == 'running'
|
107
|
+
# end
|
99
108
|
#
|
100
109
|
# ## Configuration
|
101
110
|
#
|
102
111
|
# 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}:
|
112
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
113
|
+
# set by passing a block to {#wait_until}:
|
105
114
|
#
|
106
115
|
# # poll for ~25 seconds
|
107
116
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -132,17 +141,16 @@ module Aws::S3
|
|
132
141
|
# # resource did not enter the desired state in time
|
133
142
|
# end
|
134
143
|
#
|
144
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
135
145
|
#
|
136
|
-
# @
|
137
|
-
#
|
138
|
-
#
|
139
|
-
# because the waiter has entered a state that it will not transition
|
140
|
-
# out of, preventing success.
|
146
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
147
|
+
# terminates because the waiter has entered a state that it will not
|
148
|
+
# transition out of, preventing success.
|
141
149
|
#
|
142
150
|
# yet successful.
|
143
151
|
#
|
144
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
145
|
-
# while polling for a resource that is not expected.
|
152
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
153
|
+
# encountered while polling for a resource that is not expected.
|
146
154
|
#
|
147
155
|
# @raise [NotImplementedError] Raised when the resource does not
|
148
156
|
#
|
@@ -169,7 +177,9 @@ module Aws::S3
|
|
169
177
|
:retry
|
170
178
|
end
|
171
179
|
end
|
172
|
-
Aws::
|
180
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
181
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
182
|
+
end
|
173
183
|
end
|
174
184
|
|
175
185
|
# @!group Actions
|
@@ -197,11 +207,13 @@ module Aws::S3
|
|
197
207
|
# },
|
198
208
|
# },
|
199
209
|
# content_md5: "ContentMD5",
|
210
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
200
211
|
# grant_full_control: "GrantFullControl",
|
201
212
|
# grant_read: "GrantRead",
|
202
213
|
# grant_read_acp: "GrantReadACP",
|
203
214
|
# grant_write: "GrantWrite",
|
204
215
|
# grant_write_acp: "GrantWriteACP",
|
216
|
+
# expected_bucket_owner: "AccountId",
|
205
217
|
# })
|
206
218
|
# @param [Hash] options ({})
|
207
219
|
# @option options [String] :acl
|
@@ -210,6 +222,33 @@ module Aws::S3
|
|
210
222
|
# Contains the elements that set the ACL permissions for an object per
|
211
223
|
# grantee.
|
212
224
|
# @option options [String] :content_md5
|
225
|
+
# The Base64 encoded 128-bit `MD5` digest of the data. This header must
|
226
|
+
# be used as a message integrity check to verify that the request body
|
227
|
+
# was not corrupted in transit. For more information, go to [RFC
|
228
|
+
# 1864.][1]
|
229
|
+
#
|
230
|
+
# For requests made using the Amazon Web Services Command Line Interface
|
231
|
+
# (CLI) or Amazon Web Services SDKs, this field is calculated
|
232
|
+
# automatically.
|
233
|
+
#
|
234
|
+
#
|
235
|
+
#
|
236
|
+
# [1]: http://www.ietf.org/rfc/rfc1864.txt
|
237
|
+
# @option options [String] :checksum_algorithm
|
238
|
+
# Indicates the algorithm used to create the checksum for the request
|
239
|
+
# when you use the SDK. This header will not provide any additional
|
240
|
+
# functionality if you don't use the SDK. When you send this header,
|
241
|
+
# there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
|
242
|
+
# header sent. Otherwise, Amazon S3 fails the request with the HTTP
|
243
|
+
# status code `400 Bad Request`. For more information, see [Checking
|
244
|
+
# object 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
|
213
252
|
# @option options [String] :grant_full_control
|
214
253
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
215
254
|
# the bucket.
|
@@ -218,14 +257,22 @@ module Aws::S3
|
|
218
257
|
# @option options [String] :grant_read_acp
|
219
258
|
# Allows grantee to read the bucket ACL.
|
220
259
|
# @option options [String] :grant_write
|
221
|
-
# Allows grantee to create
|
222
|
-
#
|
260
|
+
# Allows grantee to create new objects in the bucket.
|
261
|
+
#
|
262
|
+
# For the bucket and object owners of existing objects, also allows
|
263
|
+
# deletions and overwrites of those objects.
|
223
264
|
# @option options [String] :grant_write_acp
|
224
265
|
# Allows grantee to write the ACL for the applicable bucket.
|
266
|
+
# @option options [String] :expected_bucket_owner
|
267
|
+
# The account ID of the expected bucket owner. If the account ID that
|
268
|
+
# you provide does not match the actual owner of the bucket, the request
|
269
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
225
270
|
# @return [EmptyStructure]
|
226
271
|
def put(options = {})
|
227
272
|
options = options.merge(bucket: @bucket_name)
|
228
|
-
resp =
|
273
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
274
|
+
@client.put_bucket_acl(options)
|
275
|
+
end
|
229
276
|
resp.data
|
230
277
|
end
|
231
278
|
|
@@ -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]
|
@@ -50,7 +55,9 @@ module Aws::S3
|
|
50
55
|
#
|
51
56
|
# @return [self]
|
52
57
|
def load
|
53
|
-
resp =
|
58
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
59
|
+
@client.get_bucket_cors(bucket: @bucket_name)
|
60
|
+
end
|
54
61
|
@data = resp.data
|
55
62
|
self
|
56
63
|
end
|
@@ -76,7 +83,8 @@ module Aws::S3
|
|
76
83
|
# Waiter polls an API operation until a resource enters a desired
|
77
84
|
# state.
|
78
85
|
#
|
79
|
-
# @note The waiting operation is performed on a copy. The original resource
|
86
|
+
# @note The waiting operation is performed on a copy. The original resource
|
87
|
+
# remains unchanged.
|
80
88
|
#
|
81
89
|
# ## Basic Usage
|
82
90
|
#
|
@@ -89,13 +97,15 @@ module Aws::S3
|
|
89
97
|
#
|
90
98
|
# ## Example
|
91
99
|
#
|
92
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
100
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
101
|
+
# instance.state.name == 'running'
|
102
|
+
# end
|
93
103
|
#
|
94
104
|
# ## Configuration
|
95
105
|
#
|
96
106
|
# 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}:
|
107
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
108
|
+
# set by passing a block to {#wait_until}:
|
99
109
|
#
|
100
110
|
# # poll for ~25 seconds
|
101
111
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -126,17 +136,16 @@ module Aws::S3
|
|
126
136
|
# # resource did not enter the desired state in time
|
127
137
|
# end
|
128
138
|
#
|
139
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
129
140
|
#
|
130
|
-
# @
|
131
|
-
#
|
132
|
-
#
|
133
|
-
# because the waiter has entered a state that it will not transition
|
134
|
-
# out of, preventing success.
|
141
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
142
|
+
# terminates because the waiter has entered a state that it will not
|
143
|
+
# transition out of, preventing success.
|
135
144
|
#
|
136
145
|
# yet successful.
|
137
146
|
#
|
138
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
139
|
-
# while polling for a resource that is not expected.
|
147
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
148
|
+
# encountered while polling for a resource that is not expected.
|
140
149
|
#
|
141
150
|
# @raise [NotImplementedError] Raised when the resource does not
|
142
151
|
#
|
@@ -163,19 +172,29 @@ module Aws::S3
|
|
163
172
|
:retry
|
164
173
|
end
|
165
174
|
end
|
166
|
-
Aws::
|
175
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
176
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
177
|
+
end
|
167
178
|
end
|
168
179
|
|
169
180
|
# @!group Actions
|
170
181
|
|
171
182
|
# @example Request syntax with placeholder values
|
172
183
|
#
|
173
|
-
# bucket_cors.delete(
|
184
|
+
# bucket_cors.delete({
|
185
|
+
# expected_bucket_owner: "AccountId",
|
186
|
+
# })
|
174
187
|
# @param [Hash] options ({})
|
188
|
+
# @option options [String] :expected_bucket_owner
|
189
|
+
# The account ID of the expected bucket owner. If the account ID that
|
190
|
+
# you provide does not match the actual owner of the bucket, the request
|
191
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
175
192
|
# @return [EmptyStructure]
|
176
193
|
def delete(options = {})
|
177
194
|
options = options.merge(bucket: @bucket_name)
|
178
|
-
resp =
|
195
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
196
|
+
@client.delete_bucket_cors(options)
|
197
|
+
end
|
179
198
|
resp.data
|
180
199
|
end
|
181
200
|
|
@@ -185,6 +204,7 @@ module Aws::S3
|
|
185
204
|
# cors_configuration: { # required
|
186
205
|
# cors_rules: [ # required
|
187
206
|
# {
|
207
|
+
# id: "ID",
|
188
208
|
# allowed_headers: ["AllowedHeader"],
|
189
209
|
# allowed_methods: ["AllowedMethod"], # required
|
190
210
|
# allowed_origins: ["AllowedOrigin"], # required
|
@@ -194,14 +214,56 @@ module Aws::S3
|
|
194
214
|
# ],
|
195
215
|
# },
|
196
216
|
# content_md5: "ContentMD5",
|
217
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
218
|
+
# expected_bucket_owner: "AccountId",
|
197
219
|
# })
|
198
220
|
# @param [Hash] options ({})
|
199
221
|
# @option options [required, Types::CORSConfiguration] :cors_configuration
|
222
|
+
# Describes the cross-origin access configuration for objects in an
|
223
|
+
# Amazon S3 bucket. For more information, see [Enabling Cross-Origin
|
224
|
+
# Resource Sharing][1] in the *Amazon S3 User Guide*.
|
225
|
+
#
|
226
|
+
#
|
227
|
+
#
|
228
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html
|
200
229
|
# @option options [String] :content_md5
|
230
|
+
# The Base64 encoded 128-bit `MD5` digest of the data. This header must
|
231
|
+
# be used as a message integrity check to verify that the request body
|
232
|
+
# was not corrupted in transit. For more information, go to [RFC
|
233
|
+
# 1864.][1]
|
234
|
+
#
|
235
|
+
# For requests made using the Amazon Web Services Command Line Interface
|
236
|
+
# (CLI) or Amazon Web Services SDKs, this field is calculated
|
237
|
+
# automatically.
|
238
|
+
#
|
239
|
+
#
|
240
|
+
#
|
241
|
+
# [1]: http://www.ietf.org/rfc/rfc1864.txt
|
242
|
+
# @option options [String] :checksum_algorithm
|
243
|
+
# Indicates the algorithm used to create the checksum for the request
|
244
|
+
# when you use the SDK. This header will not provide any additional
|
245
|
+
# functionality if you don't use the SDK. When you send this header,
|
246
|
+
# there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
|
247
|
+
# header sent. Otherwise, Amazon S3 fails the request with the HTTP
|
248
|
+
# status code `400 Bad Request`. For more information, see [Checking
|
249
|
+
# object integrity][1] in the *Amazon S3 User Guide*.
|
250
|
+
#
|
251
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
252
|
+
# `ChecksumAlgorithm` parameter.
|
253
|
+
#
|
254
|
+
#
|
255
|
+
#
|
256
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
257
|
+
# @option options [String] :expected_bucket_owner
|
258
|
+
# The account ID of the expected bucket owner. If the account ID that
|
259
|
+
# you provide does not match the actual owner of the bucket, the request
|
260
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
201
261
|
# @return [EmptyStructure]
|
202
262
|
def put(options = {})
|
203
263
|
options = options.merge(bucket: @bucket_name)
|
204
|
-
resp =
|
264
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
265
|
+
@client.put_bucket_cors(options)
|
266
|
+
end
|
205
267
|
resp.data
|
206
268
|
end
|
207
269
|
|
@@ -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]
|
@@ -50,7 +54,9 @@ module Aws::S3
|
|
50
54
|
#
|
51
55
|
# @return [self]
|
52
56
|
def load
|
53
|
-
resp =
|
57
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
58
|
+
@client.get_bucket_lifecycle(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
|
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)
|
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
|
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
|
-
# @
|
131
|
-
#
|
132
|
-
#
|
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
|
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,34 @@ module Aws::S3
|
|
163
171
|
:retry
|
164
172
|
end
|
165
173
|
end
|
166
|
-
Aws::
|
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_lifecycle.delete(
|
183
|
+
# bucket_lifecycle.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"> This parameter applies to general purpose buckets only. It is not
|
193
|
+
# supported for directory bucket lifecycle configurations.
|
194
|
+
#
|
195
|
+
# </note>
|
175
196
|
# @return [EmptyStructure]
|
176
197
|
def delete(options = {})
|
177
198
|
options = options.merge(bucket: @bucket_name)
|
178
|
-
resp =
|
199
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
200
|
+
@client.delete_bucket_lifecycle(options)
|
201
|
+
end
|
179
202
|
resp.data
|
180
203
|
end
|
181
204
|
|
@@ -183,6 +206,7 @@ module Aws::S3
|
|
183
206
|
#
|
184
207
|
# bucket_lifecycle.put({
|
185
208
|
# content_md5: "ContentMD5",
|
209
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
|
186
210
|
# lifecycle_configuration: {
|
187
211
|
# rules: [ # required
|
188
212
|
# {
|
@@ -197,14 +221,16 @@ module Aws::S3
|
|
197
221
|
# transition: {
|
198
222
|
# date: Time.now,
|
199
223
|
# days: 1,
|
200
|
-
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
|
224
|
+
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
|
201
225
|
# },
|
202
226
|
# noncurrent_version_transition: {
|
203
227
|
# noncurrent_days: 1,
|
204
|
-
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
|
228
|
+
# storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR
|
229
|
+
# newer_noncurrent_versions: 1,
|
205
230
|
# },
|
206
231
|
# noncurrent_version_expiration: {
|
207
232
|
# noncurrent_days: 1,
|
233
|
+
# newer_noncurrent_versions: 1,
|
208
234
|
# },
|
209
235
|
# abort_incomplete_multipart_upload: {
|
210
236
|
# days_after_initiation: 1,
|
@@ -212,14 +238,39 @@ module Aws::S3
|
|
212
238
|
# },
|
213
239
|
# ],
|
214
240
|
# },
|
241
|
+
# expected_bucket_owner: "AccountId",
|
215
242
|
# })
|
216
243
|
# @param [Hash] options ({})
|
217
244
|
# @option options [String] :content_md5
|
245
|
+
# For requests made using the Amazon Web Services Command Line Interface
|
246
|
+
# (CLI) or Amazon Web Services SDKs, this field is calculated
|
247
|
+
# automatically.
|
248
|
+
# @option options [String] :checksum_algorithm
|
249
|
+
# Indicates the algorithm used to create the checksum for the request
|
250
|
+
# when you use the SDK. This header will not provide any additional
|
251
|
+
# functionality if you don't use the SDK. When you send this header,
|
252
|
+
# there must be a corresponding `x-amz-checksum` or `x-amz-trailer`
|
253
|
+
# header sent. Otherwise, Amazon S3 fails the request with the HTTP
|
254
|
+
# status code `400 Bad Request`. For more information, see [Checking
|
255
|
+
# object integrity][1] in the *Amazon S3 User Guide*.
|
256
|
+
#
|
257
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
258
|
+
# `ChecksumAlgorithm` parameter.
|
259
|
+
#
|
260
|
+
#
|
261
|
+
#
|
262
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
218
263
|
# @option options [Types::LifecycleConfiguration] :lifecycle_configuration
|
264
|
+
# @option options [String] :expected_bucket_owner
|
265
|
+
# The account ID of the expected bucket owner. If the account ID that
|
266
|
+
# you provide does not match the actual owner of the bucket, the request
|
267
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
219
268
|
# @return [EmptyStructure]
|
220
269
|
def put(options = {})
|
221
270
|
options = options.merge(bucket: @bucket_name)
|
222
|
-
resp =
|
271
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
272
|
+
@client.put_bucket_lifecycle(options)
|
273
|
+
end
|
223
274
|
resp.data
|
224
275
|
end
|
225
276
|
|