aws-sdk-s3 1.84.1 → 1.117.2
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 +4 -4
- data/CHANGELOG.md +930 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/bucket.rb +154 -46
- data/lib/aws-sdk-s3/bucket_acl.rb +28 -6
- data/lib/aws-sdk-s3/bucket_cors.rb +29 -9
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +30 -9
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +31 -9
- data/lib/aws-sdk-s3/bucket_logging.rb +25 -6
- data/lib/aws-sdk-s3/bucket_notification.rb +21 -9
- data/lib/aws-sdk-s3/bucket_policy.rb +27 -7
- data/lib/aws-sdk-s3/bucket_request_payment.rb +27 -8
- data/lib/aws-sdk-s3/bucket_tagging.rb +27 -7
- data/lib/aws-sdk-s3/bucket_versioning.rb +70 -10
- data/lib/aws-sdk-s3/bucket_website.rb +27 -7
- data/lib/aws-sdk-s3/client.rb +3747 -1848
- data/lib/aws-sdk-s3/client_api.rb +677 -227
- data/lib/aws-sdk-s3/customizations/bucket.rb +28 -49
- data/lib/aws-sdk-s3/customizations/object.rb +116 -18
- data/lib/aws-sdk-s3/encryption/client.rb +1 -1
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/encryptionV2/client.rb +1 -1
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +3 -3
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +0 -4
- data/lib/aws-sdk-s3/endpoint_parameters.rb +142 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +2020 -0
- data/lib/aws-sdk-s3/endpoints.rb +2149 -0
- data/lib/aws-sdk-s3/errors.rb +1 -1
- data/lib/aws-sdk-s3/event_streams.rb +1 -1
- data/lib/aws-sdk-s3/file_downloader.rb +7 -2
- data/lib/aws-sdk-s3/file_uploader.rb +8 -3
- data/lib/aws-sdk-s3/legacy_signer.rb +15 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +36 -10
- data/lib/aws-sdk-s3/multipart_upload.rb +133 -19
- data/lib/aws-sdk-s3/multipart_upload_part.rb +141 -21
- data/lib/aws-sdk-s3/object.rb +430 -126
- data/lib/aws-sdk-s3/object_acl.rb +31 -9
- data/lib/aws-sdk-s3/object_summary.rb +265 -110
- data/lib/aws-sdk-s3/object_version.rb +80 -53
- data/lib/aws-sdk-s3/plugins/accelerate.rb +1 -39
- data/lib/aws-sdk-s3/plugins/arn.rb +25 -142
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
- data/lib/aws-sdk-s3/plugins/dualstack.rb +2 -49
- data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +3 -1
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +1 -1
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +8 -31
- data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +33 -102
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
- data/lib/aws-sdk-s3/presigned_post.rb +47 -35
- data/lib/aws-sdk-s3/presigner.rb +39 -49
- data/lib/aws-sdk-s3/resource.rb +24 -4
- data/lib/aws-sdk-s3/types.rb +3785 -4735
- data/lib/aws-sdk-s3/waiters.rb +1 -1
- data/lib/aws-sdk-s3.rb +6 -2
- metadata +19 -14
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -62
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -71
@@ -5,22 +5,6 @@ require 'uri'
|
|
5
5
|
module Aws
|
6
6
|
module S3
|
7
7
|
class Bucket
|
8
|
-
# Save the old initialize method so that we can call 'super'.
|
9
|
-
old_initialize = instance_method(:initialize)
|
10
|
-
# Make the method redefinable
|
11
|
-
alias_method :initialize, :initialize
|
12
|
-
# Define a new initialize method that extracts out a bucket ARN.
|
13
|
-
define_method(:initialize) do |*args|
|
14
|
-
old_initialize.bind(self).call(*args)
|
15
|
-
resolved_region, arn = Plugins::ARN.resolve_arn!(
|
16
|
-
name,
|
17
|
-
client.config.region,
|
18
|
-
client.config.s3_use_arn_region
|
19
|
-
)
|
20
|
-
@resolved_region = resolved_region
|
21
|
-
@arn = arn
|
22
|
-
end
|
23
|
-
|
24
8
|
# Deletes all objects and versioned objects from this bucket
|
25
9
|
#
|
26
10
|
# @example
|
@@ -88,26 +72,44 @@ module Aws
|
|
88
72
|
# You can pass `virtual_host: true` to use the bucket name as the
|
89
73
|
# host name.
|
90
74
|
#
|
91
|
-
# bucket = s3.bucket('my
|
75
|
+
# bucket = s3.bucket('my-bucket.com')
|
92
76
|
# bucket.url(virtual_host: true)
|
93
|
-
# #=> "http://my
|
77
|
+
# #=> "http://my-bucket.com"
|
94
78
|
#
|
95
79
|
# @option options [Boolean] :virtual_host (false) When `true`,
|
96
80
|
# the bucket name will be used as the host name. This is useful
|
97
81
|
# when you have a CNAME configured for this bucket.
|
98
82
|
#
|
83
|
+
# @option options [Boolean] :secure (true) When `false`, http
|
84
|
+
# will be used with virtual_host. This is required when
|
85
|
+
# the bucket name has a dot (.) in it.
|
86
|
+
#
|
99
87
|
# @return [String] the URL for this bucket.
|
100
88
|
def url(options = {})
|
101
89
|
if options[:virtual_host]
|
102
|
-
|
103
|
-
|
104
|
-
Plugins::ARN.resolve_url!(
|
105
|
-
client.config.endpoint.dup,
|
106
|
-
@arn,
|
107
|
-
@resolved_region
|
108
|
-
).to_s
|
90
|
+
scheme = options.fetch(:secure, true) ? 'https' : 'http'
|
91
|
+
"#{scheme}://#{name}"
|
109
92
|
else
|
110
|
-
|
93
|
+
# Taken from Aws::S3::Endpoints module
|
94
|
+
unless client.config.regional_endpoint
|
95
|
+
endpoint = client.config.endpoint.to_s
|
96
|
+
end
|
97
|
+
params = Aws::S3::EndpointParameters.new(
|
98
|
+
bucket: name,
|
99
|
+
region: client.config.region,
|
100
|
+
use_fips: client.config.use_fips_endpoint,
|
101
|
+
use_dual_stack: client.config.use_dualstack_endpoint,
|
102
|
+
endpoint: endpoint,
|
103
|
+
force_path_style: client.config.force_path_style,
|
104
|
+
accelerate: client.config.use_accelerate_endpoint,
|
105
|
+
use_global_endpoint: client.config.s3_us_east_1_regional_endpoint == 'legacy',
|
106
|
+
use_object_lambda_endpoint: nil,
|
107
|
+
disable_access_points: nil,
|
108
|
+
disable_multi_region_access_points: client.config.s3_disable_multiregion_access_points,
|
109
|
+
use_arn_region: client.config.s3_use_arn_region,
|
110
|
+
)
|
111
|
+
endpoint = Aws::S3::EndpointProvider.new.resolve_endpoint(params)
|
112
|
+
endpoint.url
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
@@ -137,29 +139,6 @@ module Aws
|
|
137
139
|
|
138
140
|
self
|
139
141
|
end
|
140
|
-
|
141
|
-
private
|
142
|
-
|
143
|
-
def s3_bucket_url
|
144
|
-
url = client.config.endpoint.dup
|
145
|
-
if bucket_as_hostname?(url.scheme == 'https')
|
146
|
-
url.host = "#{name}.#{url.host}"
|
147
|
-
else
|
148
|
-
url.path += '/' unless url.path[-1] == '/'
|
149
|
-
url.path += Seahorse::Util.uri_escape(name)
|
150
|
-
end
|
151
|
-
if (client.config.region == 'us-east-1') &&
|
152
|
-
(client.config.s3_us_east_1_regional_endpoint == 'legacy')
|
153
|
-
url.host = Plugins::IADRegionalEndpoint.legacy_host(url.host)
|
154
|
-
end
|
155
|
-
url.to_s
|
156
|
-
end
|
157
|
-
|
158
|
-
def bucket_as_hostname?(https)
|
159
|
-
Plugins::BucketDns.dns_compatible?(name, https) &&
|
160
|
-
!client.config.force_path_style
|
161
|
-
end
|
162
|
-
|
163
142
|
end
|
164
143
|
end
|
165
144
|
end
|
@@ -153,21 +153,35 @@ module Aws
|
|
153
153
|
# obj.presigned_url(:put, acl: 'public-read')
|
154
154
|
# #=> "https://bucket-name.s3.amazonaws.com/object-key?..."
|
155
155
|
#
|
156
|
-
# @
|
157
|
-
#
|
158
|
-
#
|
156
|
+
# @example Pre-signed UploadPart PUT
|
157
|
+
#
|
158
|
+
# # the object uploaded using this URL will be publicly accessible
|
159
|
+
# obj.presigned_url(:upload_part, part_number: 1, upload_id: 'uploadIdToken')
|
160
|
+
# #=> "https://bucket-name.s3.amazonaws.com/object-key?..."
|
161
|
+
#
|
162
|
+
# @param [Symbol] method
|
163
|
+
# The S3 operation to generate a presigned URL for. Valid values
|
164
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
165
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
166
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
159
167
|
#
|
160
168
|
# @param [Hash] params
|
161
169
|
# Additional request parameters to use when generating the pre-signed
|
162
170
|
# URL. See the related documentation in {Client} for accepted
|
163
171
|
# params.
|
164
172
|
#
|
165
|
-
# |
|
166
|
-
#
|
167
|
-
# | `:get`
|
168
|
-
# | `:put`
|
169
|
-
# | `:head`
|
170
|
-
# | `:delete`
|
173
|
+
# | Method | Client Method |
|
174
|
+
# |------------------------------|------------------------------------|
|
175
|
+
# | `:get` | {Client#get_object} |
|
176
|
+
# | `:put` | {Client#put_object} |
|
177
|
+
# | `:head` | {Client#head_object} |
|
178
|
+
# | `:delete` | {Client#delete_object} |
|
179
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
180
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
181
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
182
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
183
|
+
# | `:list_parts` | {Client#list_parts} |
|
184
|
+
# | `:upload_part` | {Client#upload_part} |
|
171
185
|
#
|
172
186
|
# @option params [Boolean] :virtual_host (false) When `true` the
|
173
187
|
# presigned URL will use the bucket name as a virtual host.
|
@@ -188,10 +202,88 @@ module Aws
|
|
188
202
|
#
|
189
203
|
# @return [String]
|
190
204
|
#
|
191
|
-
def presigned_url(
|
205
|
+
def presigned_url(method, params = {})
|
192
206
|
presigner = Presigner.new(client: client)
|
207
|
+
|
208
|
+
if %w(delete head get put).include?(method.to_s)
|
209
|
+
method = "#{method}_object".to_sym
|
210
|
+
end
|
211
|
+
|
193
212
|
presigner.presigned_url(
|
194
|
-
|
213
|
+
method.downcase,
|
214
|
+
params.merge(bucket: bucket_name, key: key)
|
215
|
+
)
|
216
|
+
end
|
217
|
+
|
218
|
+
# Allows you to create presigned URL requests for S3 operations. This
|
219
|
+
# method returns a tuple containing the URL and the signed X-amz-* headers
|
220
|
+
# to be used with the presigned url.
|
221
|
+
#
|
222
|
+
# @example Pre-signed GET URL, valid for one hour
|
223
|
+
#
|
224
|
+
# obj.presigned_request(:get, expires_in: 3600)
|
225
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...", {}]
|
226
|
+
#
|
227
|
+
# @example Pre-signed PUT with a canned ACL
|
228
|
+
#
|
229
|
+
# # the object uploaded using this URL will be publicly accessible
|
230
|
+
# obj.presigned_request(:put, acl: 'public-read')
|
231
|
+
# #=> ["https://bucket-name.s3.amazonaws.com/object-key?...",
|
232
|
+
# {"x-amz-acl"=>"public-read"}]
|
233
|
+
#
|
234
|
+
# @param [Symbol] method
|
235
|
+
# The S3 operation to generate a presigned request for. Valid values
|
236
|
+
# are `:get`, `:put`, `:head`, `:delete`, `:create_multipart_upload`,
|
237
|
+
# `:list_multipart_uploads`, `:complete_multipart_upload`,
|
238
|
+
# `:abort_multipart_upload`, `:list_parts`, and `:upload_part`.
|
239
|
+
#
|
240
|
+
# @param [Hash] params
|
241
|
+
# Additional request parameters to use when generating the pre-signed
|
242
|
+
# request. See the related documentation in {Client} for accepted
|
243
|
+
# params.
|
244
|
+
#
|
245
|
+
# | Method | Client Method |
|
246
|
+
# |------------------------------|------------------------------------|
|
247
|
+
# | `:get` | {Client#get_object} |
|
248
|
+
# | `:put` | {Client#put_object} |
|
249
|
+
# | `:head` | {Client#head_object} |
|
250
|
+
# | `:delete` | {Client#delete_object} |
|
251
|
+
# | `:create_multipart_upload` | {Client#create_multipart_upload} |
|
252
|
+
# | `:list_multipart_uploads` | {Client#list_multipart_uploads} |
|
253
|
+
# | `:complete_multipart_upload` | {Client#complete_multipart_upload} |
|
254
|
+
# | `:abort_multipart_upload` | {Client#abort_multipart_upload} |
|
255
|
+
# | `:list_parts` | {Client#list_parts} |
|
256
|
+
# | `:upload_part` | {Client#upload_part} |
|
257
|
+
#
|
258
|
+
# @option params [Boolean] :virtual_host (false) When `true` the
|
259
|
+
# presigned URL will use the bucket name as a virtual host.
|
260
|
+
#
|
261
|
+
# bucket = Aws::S3::Bucket.new('my.bucket.com')
|
262
|
+
# bucket.object('key').presigned_request(virtual_host: true)
|
263
|
+
# #=> ["http://my.bucket.com/key?...", {}]
|
264
|
+
#
|
265
|
+
# @option params [Integer] :expires_in (900) Number of seconds before
|
266
|
+
# the pre-signed URL expires. This may not exceed one week (604800
|
267
|
+
# seconds). Note that the pre-signed URL is also only valid as long as
|
268
|
+
# credentials used to sign it are. For example, when using IAM roles,
|
269
|
+
# temporary tokens generated for signing also have a default expiration
|
270
|
+
# which will affect the effective expiration of the pre-signed URL.
|
271
|
+
#
|
272
|
+
# @raise [ArgumentError] Raised if `:expires_in` exceeds one week
|
273
|
+
# (604800 seconds).
|
274
|
+
#
|
275
|
+
# @return [String, Hash] A tuple with a presigned URL and headers that
|
276
|
+
# should be included with the request.
|
277
|
+
#
|
278
|
+
def presigned_request(method, params = {})
|
279
|
+
presigner = Presigner.new(client: client)
|
280
|
+
|
281
|
+
if %w(delete head get put).include?(method.to_s)
|
282
|
+
method = "#{method}_object".to_sym
|
283
|
+
end
|
284
|
+
|
285
|
+
presigner.presigned_request(
|
286
|
+
method.downcase,
|
195
287
|
params.merge(bucket: bucket_name, key: key)
|
196
288
|
)
|
197
289
|
end
|
@@ -201,16 +293,22 @@ module Aws
|
|
201
293
|
# s3.bucket('bucket-name').object('obj-key').public_url
|
202
294
|
# #=> "https://bucket-name.s3.amazonaws.com/obj-key"
|
203
295
|
#
|
204
|
-
# To use virtual hosted bucket url
|
296
|
+
# To use virtual hosted bucket url.
|
297
|
+
# Uses https unless secure: false is set. If the bucket
|
298
|
+
# name contains dots (.) then you will need to set secure: false.
|
205
299
|
#
|
206
|
-
# s3.bucket('my
|
300
|
+
# s3.bucket('my-bucket.com').object('key')
|
207
301
|
# .public_url(virtual_host: true)
|
208
|
-
# #=> "
|
302
|
+
# #=> "https://my-bucket.com/key"
|
209
303
|
#
|
210
304
|
# @option options [Boolean] :virtual_host (false) When `true`, the bucket
|
211
305
|
# name will be used as the host name. This is useful when you have
|
212
306
|
# a CNAME configured for the bucket.
|
213
307
|
#
|
308
|
+
# @option options [Boolean] :secure (true) When `false`, http
|
309
|
+
# will be used with virtual_host. This is required when
|
310
|
+
# the bucket name has a dot (.) in it.
|
311
|
+
#
|
214
312
|
# @return [String]
|
215
313
|
def public_url(options = {})
|
216
314
|
url = URI.parse(bucket.url(options))
|
@@ -302,7 +400,7 @@ module Aws
|
|
302
400
|
# progress = Proc.new do |bytes, totals|
|
303
401
|
# puts bytes.map.with_index { |b, i| "Part #{i+1}: #{b} / #{totals[i]}"}.join(' ') + "Total: #{100.0 * bytes.sum / totals.sum }%" }
|
304
402
|
# end
|
305
|
-
# obj.upload_file('/path/to/file')
|
403
|
+
# obj.upload_file('/path/to/file', progress_callback: progress)
|
306
404
|
#
|
307
405
|
# @param [String, Pathname, File, Tempfile] source A file on the local
|
308
406
|
# file system that will be uploaded as this object. This can either be
|
@@ -312,10 +410,10 @@ module Aws
|
|
312
410
|
# using an open Tempfile, rewind it before uploading or else the object
|
313
411
|
# will be empty.
|
314
412
|
#
|
315
|
-
# @option options [Integer] :multipart_threshold (
|
413
|
+
# @option options [Integer] :multipart_threshold (104857600) Files larger
|
316
414
|
# than or equal to `:multipart_threshold` are uploaded using the S3
|
317
415
|
# multipart APIs.
|
318
|
-
# Default threshold is
|
416
|
+
# Default threshold is 100MB.
|
319
417
|
#
|
320
418
|
# @option options [Integer] :thread_count (10) The number of parallel
|
321
419
|
# multipart uploads. This option is not used if the file is smaller than
|
@@ -366,7 +464,7 @@ module Aws
|
|
366
464
|
# customizing each range size in multipart_download,
|
367
465
|
# By default, `auto` mode is enabled, which performs multipart_download
|
368
466
|
#
|
369
|
-
# @option options [
|
467
|
+
# @option options [Integer] chunk_size required in get_range mode.
|
370
468
|
#
|
371
469
|
# @option options [Integer] thread_count (10) Customize threads used in
|
372
470
|
# the multipart download.
|
@@ -165,10 +165,6 @@ module Aws
|
|
165
165
|
# to initialize the cipher, and the decrypter truncates the
|
166
166
|
# auth tag from the body when writing the final bytes.
|
167
167
|
def authenticated_decrypter(context, cipher, envelope)
|
168
|
-
if RUBY_VERSION.match(/1.9/)
|
169
|
-
raise "authenticated decryption not supported by OpenSSL in Ruby version ~> 1.9"
|
170
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
171
|
-
end
|
172
168
|
http_resp = context.http_response
|
173
169
|
content_length = http_resp.headers['content-length'].to_i
|
174
170
|
auth_tag_length = auth_tag_length(envelope)
|
@@ -166,10 +166,6 @@ module Aws
|
|
166
166
|
# to initialize the cipher, and the decrypter truncates the
|
167
167
|
# auth tag from the body when writing the final bytes.
|
168
168
|
def authenticated_decrypter(context, cipher, envelope)
|
169
|
-
if RUBY_VERSION.match(/1.9/)
|
170
|
-
raise "authenticated decryption not supported by OpenSSL in Ruby version ~> 1.9"
|
171
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
172
|
-
end
|
173
169
|
http_resp = context.http_response
|
174
170
|
content_length = http_resp.headers['content-length'].to_i
|
175
171
|
auth_tag_length = auth_tag_length(envelope)
|
@@ -87,9 +87,9 @@ module Aws
|
|
87
87
|
' kms+context. Please configure the client with the' \
|
88
88
|
' required kms_key_id'
|
89
89
|
else
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
raise ArgumentError, 'Unsupported wrap-alg: ' \
|
91
|
+
"#{envelope['x-amz-wrap-alg']}"
|
92
|
+
end
|
93
93
|
iv = decode64(envelope['x-amz-iv'])
|
94
94
|
Utils.aes_decryption_cipher(:GCM, key, iv)
|
95
95
|
end
|
@@ -9,10 +9,6 @@ module Aws
|
|
9
9
|
class EncryptHandler < Seahorse::Client::Handler
|
10
10
|
|
11
11
|
def call(context)
|
12
|
-
if RUBY_VERSION.match(/1.9/)
|
13
|
-
raise "authenticated encryption not supported by OpenSSL in Ruby version ~> 1.9"
|
14
|
-
raise Aws::Errors::NonSupportedRubyVersionError, msg
|
15
|
-
end
|
16
12
|
envelope, cipher = context[:encryption][:cipher_provider]
|
17
13
|
.encryption_cipher(
|
18
14
|
kms_encryption_context: context[:encryption][:kms_encryption_context]
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
module Aws::S3
|
11
|
+
# Endpoint parameters used to influence endpoints per request.
|
12
|
+
#
|
13
|
+
# @!attribute bucket
|
14
|
+
# The S3 bucket used to send the request. This is an optional parameter that will be set automatically for operations that are scoped to an S3 bucket.
|
15
|
+
#
|
16
|
+
# @return [String]
|
17
|
+
#
|
18
|
+
# @!attribute region
|
19
|
+
# The AWS region used to dispatch the request.
|
20
|
+
#
|
21
|
+
# @return [String]
|
22
|
+
#
|
23
|
+
# @!attribute use_fips
|
24
|
+
# When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
|
25
|
+
#
|
26
|
+
# @return [Boolean]
|
27
|
+
#
|
28
|
+
# @!attribute use_dual_stack
|
29
|
+
# When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
|
30
|
+
#
|
31
|
+
# @return [Boolean]
|
32
|
+
#
|
33
|
+
# @!attribute endpoint
|
34
|
+
# Override the endpoint used to send this request
|
35
|
+
#
|
36
|
+
# @return [String]
|
37
|
+
#
|
38
|
+
# @!attribute force_path_style
|
39
|
+
# When true, force a path-style endpoint to be used where the bucket name is part of the path.
|
40
|
+
#
|
41
|
+
# @return [Boolean]
|
42
|
+
#
|
43
|
+
# @!attribute accelerate
|
44
|
+
# When true, use S3 Accelerate. NOTE: Not all regions support S3 accelerate.
|
45
|
+
#
|
46
|
+
# @return [Boolean]
|
47
|
+
#
|
48
|
+
# @!attribute use_global_endpoint
|
49
|
+
# Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.
|
50
|
+
#
|
51
|
+
# @return [Boolean]
|
52
|
+
#
|
53
|
+
# @!attribute use_object_lambda_endpoint
|
54
|
+
# Internal parameter to use object lambda endpoint for an operation (eg: WriteGetObjectResponse)
|
55
|
+
#
|
56
|
+
# @return [Boolean]
|
57
|
+
#
|
58
|
+
# @!attribute disable_access_points
|
59
|
+
# Internal parameter to disable Access Point Buckets
|
60
|
+
#
|
61
|
+
# @return [Boolean]
|
62
|
+
#
|
63
|
+
# @!attribute disable_multi_region_access_points
|
64
|
+
# Whether multi-region access points (MRAP) should be disabled.
|
65
|
+
#
|
66
|
+
# @return [Boolean]
|
67
|
+
#
|
68
|
+
# @!attribute use_arn_region
|
69
|
+
# When an Access Point ARN is provided and this flag is enabled, the SDK MUST use the ARN's region when constructing the endpoint instead of the client's configured region.
|
70
|
+
#
|
71
|
+
# @return [Boolean]
|
72
|
+
#
|
73
|
+
EndpointParameters = Struct.new(
|
74
|
+
:bucket,
|
75
|
+
:region,
|
76
|
+
:use_fips,
|
77
|
+
:use_dual_stack,
|
78
|
+
:endpoint,
|
79
|
+
:force_path_style,
|
80
|
+
:accelerate,
|
81
|
+
:use_global_endpoint,
|
82
|
+
:use_object_lambda_endpoint,
|
83
|
+
:disable_access_points,
|
84
|
+
:disable_multi_region_access_points,
|
85
|
+
:use_arn_region,
|
86
|
+
) do
|
87
|
+
include Aws::Structure
|
88
|
+
|
89
|
+
# @api private
|
90
|
+
class << self
|
91
|
+
PARAM_MAP = {
|
92
|
+
'Bucket' => :bucket,
|
93
|
+
'Region' => :region,
|
94
|
+
'UseFIPS' => :use_fips,
|
95
|
+
'UseDualStack' => :use_dual_stack,
|
96
|
+
'Endpoint' => :endpoint,
|
97
|
+
'ForcePathStyle' => :force_path_style,
|
98
|
+
'Accelerate' => :accelerate,
|
99
|
+
'UseGlobalEndpoint' => :use_global_endpoint,
|
100
|
+
'UseObjectLambdaEndpoint' => :use_object_lambda_endpoint,
|
101
|
+
'DisableAccessPoints' => :disable_access_points,
|
102
|
+
'DisableMultiRegionAccessPoints' => :disable_multi_region_access_points,
|
103
|
+
'UseArnRegion' => :use_arn_region,
|
104
|
+
}.freeze
|
105
|
+
end
|
106
|
+
|
107
|
+
def initialize(options = {})
|
108
|
+
self[:bucket] = options[:bucket]
|
109
|
+
self[:region] = options[:region]
|
110
|
+
self[:use_fips] = options[:use_fips]
|
111
|
+
self[:use_fips] = false if self[:use_fips].nil?
|
112
|
+
if self[:use_fips].nil?
|
113
|
+
raise ArgumentError, "Missing required EndpointParameter: :use_fips"
|
114
|
+
end
|
115
|
+
self[:use_dual_stack] = options[:use_dual_stack]
|
116
|
+
self[:use_dual_stack] = false if self[:use_dual_stack].nil?
|
117
|
+
if self[:use_dual_stack].nil?
|
118
|
+
raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
|
119
|
+
end
|
120
|
+
self[:endpoint] = options[:endpoint]
|
121
|
+
self[:force_path_style] = options[:force_path_style]
|
122
|
+
self[:accelerate] = options[:accelerate]
|
123
|
+
self[:accelerate] = false if self[:accelerate].nil?
|
124
|
+
if self[:accelerate].nil?
|
125
|
+
raise ArgumentError, "Missing required EndpointParameter: :accelerate"
|
126
|
+
end
|
127
|
+
self[:use_global_endpoint] = options[:use_global_endpoint]
|
128
|
+
self[:use_global_endpoint] = false if self[:use_global_endpoint].nil?
|
129
|
+
if self[:use_global_endpoint].nil?
|
130
|
+
raise ArgumentError, "Missing required EndpointParameter: :use_global_endpoint"
|
131
|
+
end
|
132
|
+
self[:use_object_lambda_endpoint] = options[:use_object_lambda_endpoint]
|
133
|
+
self[:disable_access_points] = options[:disable_access_points]
|
134
|
+
self[:disable_multi_region_access_points] = options[:disable_multi_region_access_points]
|
135
|
+
self[:disable_multi_region_access_points] = false if self[:disable_multi_region_access_points].nil?
|
136
|
+
if self[:disable_multi_region_access_points].nil?
|
137
|
+
raise ArgumentError, "Missing required EndpointParameter: :disable_multi_region_access_points"
|
138
|
+
end
|
139
|
+
self[:use_arn_region] = options[:use_arn_region]
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|