aws-sdk-s3 1.13.0 → 1.146.1

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