aws-sdk-s3 1.0.0.rc2 → 1.0.0.rc3

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.
@@ -1,955 +1,953 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module S3
10
- class Object
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(bucket_name, key, options = {})
15
- # @param [String] bucket_name
16
- # @param [String] key
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :bucket_name
20
- # @option options [required, String] :key
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @bucket_name = extract_bucket_name(args, options)
25
- @key = extract_key(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::S3
9
+ class Object
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(bucket_name, key, options = {})
14
+ # @param [String] bucket_name
15
+ # @param [String] key
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :bucket_name
19
+ # @option options [required, String] :key
20
+ # @option options [Client] :client
21
+ def initialize(*args)
22
+ options = Hash === args.last ? args.pop.dup : {}
23
+ @bucket_name = extract_bucket_name(args, options)
24
+ @key = extract_key(args, options)
25
+ @data = options.delete(:data)
26
+ @client = options.delete(:client) || Client.new(options)
27
+ end
29
28
 
30
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def bucket_name
34
- @bucket_name
35
- end
31
+ # @return [String]
32
+ def bucket_name
33
+ @bucket_name
34
+ end
36
35
 
37
- # @return [String]
38
- def key
39
- @key
40
- end
36
+ # @return [String]
37
+ def key
38
+ @key
39
+ end
41
40
 
42
- # Specifies whether the object retrieved was (true) or was not (false) a
43
- # Delete Marker. If false, this response header does not appear in the
44
- # response.
45
- # @return [Boolean]
46
- def delete_marker
47
- data.delete_marker
48
- end
41
+ # Specifies whether the object retrieved was (true) or was not (false) a
42
+ # Delete Marker. If false, this response header does not appear in the
43
+ # response.
44
+ # @return [Boolean]
45
+ def delete_marker
46
+ data.delete_marker
47
+ end
49
48
 
50
- # @return [String]
51
- def accept_ranges
52
- data.accept_ranges
53
- end
49
+ # @return [String]
50
+ def accept_ranges
51
+ data.accept_ranges
52
+ end
54
53
 
55
- # If the object expiration is configured (see PUT Bucket lifecycle), the
56
- # response includes this header. It includes the expiry-date and rule-id
57
- # key value pairs providing object expiration information. The value of
58
- # the rule-id is URL encoded.
59
- # @return [String]
60
- def expiration
61
- data.expiration
62
- end
54
+ # If the object expiration is configured (see PUT Bucket lifecycle), the
55
+ # response includes this header. It includes the expiry-date and rule-id
56
+ # key value pairs providing object expiration information. The value of
57
+ # the rule-id is URL encoded.
58
+ # @return [String]
59
+ def expiration
60
+ data.expiration
61
+ end
63
62
 
64
- # Provides information about object restoration operation and expiration
65
- # time of the restored object copy.
66
- # @return [String]
67
- def restore
68
- data.restore
69
- end
63
+ # Provides information about object restoration operation and expiration
64
+ # time of the restored object copy.
65
+ # @return [String]
66
+ def restore
67
+ data.restore
68
+ end
70
69
 
71
- # Last modified date of the object
72
- # @return [Time]
73
- def last_modified
74
- data.last_modified
75
- end
70
+ # Last modified date of the object
71
+ # @return [Time]
72
+ def last_modified
73
+ data.last_modified
74
+ end
76
75
 
77
- # Size of the body in bytes.
78
- # @return [Integer]
79
- def content_length
80
- data.content_length
81
- end
76
+ # Size of the body in bytes.
77
+ # @return [Integer]
78
+ def content_length
79
+ data.content_length
80
+ end
82
81
 
83
- # An ETag is an opaque identifier assigned by a web server to a specific
84
- # version of a resource found at a URL
85
- # @return [String]
86
- def etag
87
- data.etag
88
- end
82
+ # An ETag is an opaque identifier assigned by a web server to a specific
83
+ # version of a resource found at a URL
84
+ # @return [String]
85
+ def etag
86
+ data.etag
87
+ end
89
88
 
90
- # This is set to the number of metadata entries not returned in
91
- # x-amz-meta headers. This can happen if you create metadata using an
92
- # API like SOAP that supports more flexible metadata than the REST API.
93
- # For example, using SOAP, you can create metadata whose values are not
94
- # legal HTTP headers.
95
- # @return [Integer]
96
- def missing_meta
97
- data.missing_meta
98
- end
89
+ # This is set to the number of metadata entries not returned in
90
+ # x-amz-meta headers. This can happen if you create metadata using an
91
+ # API like SOAP that supports more flexible metadata than the REST API.
92
+ # For example, using SOAP, you can create metadata whose values are not
93
+ # legal HTTP headers.
94
+ # @return [Integer]
95
+ def missing_meta
96
+ data.missing_meta
97
+ end
99
98
 
100
- # Version of the object.
101
- # @return [String]
102
- def version_id
103
- data.version_id
104
- end
99
+ # Version of the object.
100
+ # @return [String]
101
+ def version_id
102
+ data.version_id
103
+ end
105
104
 
106
- # Specifies caching behavior along the request/reply chain.
107
- # @return [String]
108
- def cache_control
109
- data.cache_control
110
- end
105
+ # Specifies caching behavior along the request/reply chain.
106
+ # @return [String]
107
+ def cache_control
108
+ data.cache_control
109
+ end
111
110
 
112
- # Specifies presentational information for the object.
113
- # @return [String]
114
- def content_disposition
115
- data.content_disposition
116
- end
111
+ # Specifies presentational information for the object.
112
+ # @return [String]
113
+ def content_disposition
114
+ data.content_disposition
115
+ end
117
116
 
118
- # Specifies what content encodings have been applied to the object and
119
- # thus what decoding mechanisms must be applied to obtain the media-type
120
- # referenced by the Content-Type header field.
121
- # @return [String]
122
- def content_encoding
123
- data.content_encoding
124
- end
117
+ # Specifies what content encodings have been applied to the object and
118
+ # thus what decoding mechanisms must be applied to obtain the media-type
119
+ # referenced by the Content-Type header field.
120
+ # @return [String]
121
+ def content_encoding
122
+ data.content_encoding
123
+ end
125
124
 
126
- # The language the content is in.
127
- # @return [String]
128
- def content_language
129
- data.content_language
130
- end
125
+ # The language the content is in.
126
+ # @return [String]
127
+ def content_language
128
+ data.content_language
129
+ end
131
130
 
132
- # A standard MIME type describing the format of the object data.
133
- # @return [String]
134
- def content_type
135
- data.content_type
136
- end
131
+ # A standard MIME type describing the format of the object data.
132
+ # @return [String]
133
+ def content_type
134
+ data.content_type
135
+ end
137
136
 
138
- # The date and time at which the object is no longer cacheable.
139
- # @return [Time]
140
- def expires
141
- data.expires
142
- end
137
+ # The date and time at which the object is no longer cacheable.
138
+ # @return [Time]
139
+ def expires
140
+ data.expires
141
+ end
143
142
 
144
- # @return [String]
145
- def expires_string
146
- data.expires_string
147
- end
143
+ # @return [String]
144
+ def expires_string
145
+ data.expires_string
146
+ end
148
147
 
149
- # If the bucket is configured as a website, redirects requests for this
150
- # object to another object in the same bucket or to an external URL.
151
- # Amazon S3 stores the value of this header in the object metadata.
152
- # @return [String]
153
- def website_redirect_location
154
- data.website_redirect_location
155
- end
148
+ # If the bucket is configured as a website, redirects requests for this
149
+ # object to another object in the same bucket or to an external URL.
150
+ # Amazon S3 stores the value of this header in the object metadata.
151
+ # @return [String]
152
+ def website_redirect_location
153
+ data.website_redirect_location
154
+ end
156
155
 
157
- # The Server-side encryption algorithm used when storing this object in
158
- # S3 (e.g., AES256, aws:kms).
159
- # @return [String]
160
- def server_side_encryption
161
- data.server_side_encryption
162
- end
156
+ # The Server-side encryption algorithm used when storing this object in
157
+ # S3 (e.g., AES256, aws:kms).
158
+ # @return [String]
159
+ def server_side_encryption
160
+ data.server_side_encryption
161
+ end
163
162
 
164
- # A map of metadata to store with the object in S3.
165
- # @return [Hash<String,String>]
166
- def metadata
167
- data.metadata
168
- end
163
+ # A map of metadata to store with the object in S3.
164
+ # @return [Hash<String,String>]
165
+ def metadata
166
+ data.metadata
167
+ end
169
168
 
170
- # If server-side encryption with a customer-provided encryption key was
171
- # requested, the response will include this header confirming the
172
- # encryption algorithm used.
173
- # @return [String]
174
- def sse_customer_algorithm
175
- data.sse_customer_algorithm
176
- end
169
+ # If server-side encryption with a customer-provided encryption key was
170
+ # requested, the response will include this header confirming the
171
+ # encryption algorithm used.
172
+ # @return [String]
173
+ def sse_customer_algorithm
174
+ data.sse_customer_algorithm
175
+ end
177
176
 
178
- # If server-side encryption with a customer-provided encryption key was
179
- # requested, the response will include this header to provide round trip
180
- # message integrity verification of the customer-provided encryption
181
- # key.
182
- # @return [String]
183
- def sse_customer_key_md5
184
- data.sse_customer_key_md5
185
- end
177
+ # If server-side encryption with a customer-provided encryption key was
178
+ # requested, the response will include this header to provide round trip
179
+ # message integrity verification of the customer-provided encryption
180
+ # key.
181
+ # @return [String]
182
+ def sse_customer_key_md5
183
+ data.sse_customer_key_md5
184
+ end
186
185
 
187
- # If present, specifies the ID of the AWS Key Management Service (KMS)
188
- # master encryption key that was used for the object.
189
- # @return [String]
190
- def ssekms_key_id
191
- data.ssekms_key_id
192
- end
186
+ # If present, specifies the ID of the AWS Key Management Service (KMS)
187
+ # master encryption key that was used for the object.
188
+ # @return [String]
189
+ def ssekms_key_id
190
+ data.ssekms_key_id
191
+ end
193
192
 
194
- # @return [String]
195
- def storage_class
196
- data.storage_class
197
- end
193
+ # @return [String]
194
+ def storage_class
195
+ data.storage_class
196
+ end
198
197
 
199
- # If present, indicates that the requester was successfully charged for
200
- # the request.
201
- # @return [String]
202
- def request_charged
203
- data.request_charged
204
- end
198
+ # If present, indicates that the requester was successfully charged for
199
+ # the request.
200
+ # @return [String]
201
+ def request_charged
202
+ data.request_charged
203
+ end
205
204
 
206
- # @return [String]
207
- def replication_status
208
- data.replication_status
209
- end
205
+ # @return [String]
206
+ def replication_status
207
+ data.replication_status
208
+ end
210
209
 
211
- # The count of parts this object has.
212
- # @return [Integer]
213
- def parts_count
214
- data.parts_count
215
- end
210
+ # The count of parts this object has.
211
+ # @return [Integer]
212
+ def parts_count
213
+ data.parts_count
214
+ end
216
215
 
217
- # @!endgroup
216
+ # @!endgroup
218
217
 
219
- # @return [Client]
220
- def client
221
- @client
222
- end
218
+ # @return [Client]
219
+ def client
220
+ @client
221
+ end
223
222
 
224
- # Loads, or reloads {#data} for the current {Object}.
225
- # Returns `self` making it possible to chain methods.
226
- #
227
- # object.reload.data
228
- #
229
- # @return [self]
230
- def load
231
- resp = @client.head_object(
232
- bucket: @bucket_name,
233
- key: @key
234
- )
235
- @data = resp.data
236
- self
237
- end
238
- alias :reload :load
239
-
240
- # @return [Types::HeadObjectOutput]
241
- # Returns the data for this {Object}. Calls
242
- # {Client#head_object} if {#data_loaded?} is `false`.
243
- def data
244
- load unless @data
245
- @data
246
- end
223
+ # Loads, or reloads {#data} for the current {Object}.
224
+ # Returns `self` making it possible to chain methods.
225
+ #
226
+ # object.reload.data
227
+ #
228
+ # @return [self]
229
+ def load
230
+ resp = @client.head_object(
231
+ bucket: @bucket_name,
232
+ key: @key
233
+ )
234
+ @data = resp.data
235
+ self
236
+ end
237
+ alias :reload :load
238
+
239
+ # @return [Types::HeadObjectOutput]
240
+ # Returns the data for this {Object}. Calls
241
+ # {Client#head_object} if {#data_loaded?} is `false`.
242
+ def data
243
+ load unless @data
244
+ @data
245
+ end
247
246
 
248
- # @return [Boolean]
249
- # Returns `true` if this resource is loaded. Accessing attributes or
250
- # {#data} on an unloaded resource will trigger a call to {#load}.
251
- def data_loaded?
252
- !!@data
253
- end
247
+ # @return [Boolean]
248
+ # Returns `true` if this resource is loaded. Accessing attributes or
249
+ # {#data} on an unloaded resource will trigger a call to {#load}.
250
+ def data_loaded?
251
+ !!@data
252
+ end
254
253
 
255
- # @param [Hash] options ({})
256
- # @return [Boolean]
257
- # Returns `true` if the Object exists.
258
- def exists?(options = {})
259
- begin
260
- wait_until_exists(options.merge(max_attempts: 1))
261
- true
262
- rescue Aws::Waiters::Errors::UnexpectedError => e
263
- raise e.error
264
- rescue Aws::Waiters::Errors::WaiterFailed
265
- false
266
- end
254
+ # @param [Hash] options ({})
255
+ # @return [Boolean]
256
+ # Returns `true` if the Object exists.
257
+ def exists?(options = {})
258
+ begin
259
+ wait_until_exists(options.merge(max_attempts: 1))
260
+ true
261
+ rescue Aws::Waiters::Errors::UnexpectedError => e
262
+ raise e.error
263
+ rescue Aws::Waiters::Errors::WaiterFailed
264
+ false
267
265
  end
266
+ end
268
267
 
269
- # @param [Hash] options ({})
270
- # @option options [Integer] :max_attempts (20)
271
- # @option options [Float] :delay (5)
272
- # @option options [Proc] :before_attempt
273
- # @option options [Proc] :before_wait
274
- # @return [Object]
275
- def wait_until_exists(options = {})
276
- options, params = separate_params_and_options(options)
277
- waiter = Waiters::ObjectExists.new(options)
278
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
279
- waiter.wait(params.merge(bucket: @bucket_name,
280
- key: @key))
281
- Object.new({
282
- bucket_name: @bucket_name,
283
- key: @key,
284
- client: @client
285
- })
286
- end
268
+ # @param [Hash] options ({})
269
+ # @option options [Integer] :max_attempts (20)
270
+ # @option options [Float] :delay (5)
271
+ # @option options [Proc] :before_attempt
272
+ # @option options [Proc] :before_wait
273
+ # @return [Object]
274
+ def wait_until_exists(options = {})
275
+ options, params = separate_params_and_options(options)
276
+ waiter = Waiters::ObjectExists.new(options)
277
+ yield_waiter_and_warn(waiter, &Proc.new) if block_given?
278
+ waiter.wait(params.merge(bucket: @bucket_name,
279
+ key: @key))
280
+ Object.new({
281
+ bucket_name: @bucket_name,
282
+ key: @key,
283
+ client: @client
284
+ })
285
+ end
287
286
 
288
- # @param [Hash] options ({})
289
- # @option options [Integer] :max_attempts (20)
290
- # @option options [Float] :delay (5)
291
- # @option options [Proc] :before_attempt
292
- # @option options [Proc] :before_wait
293
- # @return [Object]
294
- def wait_until_not_exists(options = {})
295
- options, params = separate_params_and_options(options)
296
- waiter = Waiters::ObjectNotExists.new(options)
297
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
298
- waiter.wait(params.merge(bucket: @bucket_name,
299
- key: @key))
300
- Object.new({
301
- bucket_name: @bucket_name,
302
- key: @key,
303
- client: @client
304
- })
305
- end
287
+ # @param [Hash] options ({})
288
+ # @option options [Integer] :max_attempts (20)
289
+ # @option options [Float] :delay (5)
290
+ # @option options [Proc] :before_attempt
291
+ # @option options [Proc] :before_wait
292
+ # @return [Object]
293
+ def wait_until_not_exists(options = {})
294
+ options, params = separate_params_and_options(options)
295
+ waiter = Waiters::ObjectNotExists.new(options)
296
+ yield_waiter_and_warn(waiter, &Proc.new) if block_given?
297
+ waiter.wait(params.merge(bucket: @bucket_name,
298
+ key: @key))
299
+ Object.new({
300
+ bucket_name: @bucket_name,
301
+ key: @key,
302
+ client: @client
303
+ })
304
+ end
306
305
 
307
- # @!group Actions
306
+ # @!group Actions
307
+
308
+ # @example Request syntax with placeholder values
309
+ #
310
+ # object.copy_from({
311
+ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
312
+ # cache_control: "CacheControl",
313
+ # content_disposition: "ContentDisposition",
314
+ # content_encoding: "ContentEncoding",
315
+ # content_language: "ContentLanguage",
316
+ # content_type: "ContentType",
317
+ # copy_source: "CopySource", # required
318
+ # copy_source_if_match: "CopySourceIfMatch",
319
+ # copy_source_if_modified_since: Time.now,
320
+ # copy_source_if_none_match: "CopySourceIfNoneMatch",
321
+ # copy_source_if_unmodified_since: Time.now,
322
+ # expires: Time.now,
323
+ # grant_full_control: "GrantFullControl",
324
+ # grant_read: "GrantRead",
325
+ # grant_read_acp: "GrantReadACP",
326
+ # grant_write_acp: "GrantWriteACP",
327
+ # metadata: {
328
+ # "MetadataKey" => "MetadataValue",
329
+ # },
330
+ # metadata_directive: "COPY", # accepts COPY, REPLACE
331
+ # tagging_directive: "COPY", # accepts COPY, REPLACE
332
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms
333
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
334
+ # website_redirect_location: "WebsiteRedirectLocation",
335
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
336
+ # sse_customer_key: "SSECustomerKey",
337
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
338
+ # ssekms_key_id: "SSEKMSKeyId",
339
+ # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
340
+ # copy_source_sse_customer_key: "CopySourceSSECustomerKey",
341
+ # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
342
+ # request_payer: "requester", # accepts requester
343
+ # tagging: "TaggingHeader",
344
+ # })
345
+ # @param [Hash] options ({})
346
+ # @option options [String] :acl
347
+ # The canned ACL to apply to the object.
348
+ # @option options [String] :cache_control
349
+ # Specifies caching behavior along the request/reply chain.
350
+ # @option options [String] :content_disposition
351
+ # Specifies presentational information for the object.
352
+ # @option options [String] :content_encoding
353
+ # Specifies what content encodings have been applied to the object and
354
+ # thus what decoding mechanisms must be applied to obtain the media-type
355
+ # referenced by the Content-Type header field.
356
+ # @option options [String] :content_language
357
+ # The language the content is in.
358
+ # @option options [String] :content_type
359
+ # A standard MIME type describing the format of the object data.
360
+ # @option options [required, String] :copy_source
361
+ # The name of the source bucket and key name of the source object,
362
+ # separated by a slash (/). Must be URL-encoded.
363
+ # @option options [String] :copy_source_if_match
364
+ # Copies the object if its entity tag (ETag) matches the specified tag.
365
+ # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
366
+ # Copies the object if it has been modified since the specified time.
367
+ # @option options [String] :copy_source_if_none_match
368
+ # Copies the object if its entity tag (ETag) is different than the
369
+ # specified ETag.
370
+ # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since
371
+ # Copies the object if it hasn't been modified since the specified
372
+ # time.
373
+ # @option options [Time,DateTime,Date,Integer,String] :expires
374
+ # The date and time at which the object is no longer cacheable.
375
+ # @option options [String] :grant_full_control
376
+ # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
377
+ # object.
378
+ # @option options [String] :grant_read
379
+ # Allows grantee to read the object data and its metadata.
380
+ # @option options [String] :grant_read_acp
381
+ # Allows grantee to read the object ACL.
382
+ # @option options [String] :grant_write_acp
383
+ # Allows grantee to write the ACL for the applicable object.
384
+ # @option options [Hash<String,String>] :metadata
385
+ # A map of metadata to store with the object in S3.
386
+ # @option options [String] :metadata_directive
387
+ # Specifies whether the metadata is copied from the source object or
388
+ # replaced with metadata provided in the request.
389
+ # @option options [String] :tagging_directive
390
+ # Specifies whether the object tag-set are copied from the source object
391
+ # or replaced with tag-set provided in the request.
392
+ # @option options [String] :server_side_encryption
393
+ # The Server-side encryption algorithm used when storing this object in
394
+ # S3 (e.g., AES256, aws:kms).
395
+ # @option options [String] :storage_class
396
+ # The type of storage to use for the object. Defaults to 'STANDARD'.
397
+ # @option options [String] :website_redirect_location
398
+ # If the bucket is configured as a website, redirects requests for this
399
+ # object to another object in the same bucket or to an external URL.
400
+ # Amazon S3 stores the value of this header in the object metadata.
401
+ # @option options [String] :sse_customer_algorithm
402
+ # Specifies the algorithm to use to when encrypting the object (e.g.,
403
+ # AES256).
404
+ # @option options [String] :sse_customer_key
405
+ # Specifies the customer-provided encryption key for Amazon S3 to use in
406
+ # encrypting data. This value is used to store the object and then it is
407
+ # discarded; Amazon does not store the encryption key. The key must be
408
+ # appropriate for use with the algorithm specified in the
409
+ # x-amz-server-side​-encryption​-customer-algorithm header.
410
+ # @option options [String] :sse_customer_key_md5
411
+ # Specifies the 128-bit MD5 digest of the encryption key according to
412
+ # RFC 1321. Amazon S3 uses this header for a message integrity check to
413
+ # ensure the encryption key was transmitted without error.
414
+ # @option options [String] :ssekms_key_id
415
+ # Specifies the AWS KMS key ID to use for object encryption. All GET and
416
+ # PUT requests for an object protected by AWS KMS will fail if not made
417
+ # via SSL or using SigV4. Documentation on configuring any of the
418
+ # officially supported AWS SDKs and CLI can be found at
419
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
420
+ # @option options [String] :copy_source_sse_customer_algorithm
421
+ # Specifies the algorithm to use when decrypting the source object
422
+ # (e.g., AES256).
423
+ # @option options [String] :copy_source_sse_customer_key
424
+ # Specifies the customer-provided encryption key for Amazon S3 to use to
425
+ # decrypt the source object. The encryption key provided in this header
426
+ # must be one that was used when the source object was created.
427
+ # @option options [String] :copy_source_sse_customer_key_md5
428
+ # Specifies the 128-bit MD5 digest of the encryption key according to
429
+ # RFC 1321. Amazon S3 uses this header for a message integrity check to
430
+ # ensure the encryption key was transmitted without error.
431
+ # @option options [String] :request_payer
432
+ # Confirms that the requester knows that she or he will be charged for
433
+ # the request. Bucket owners need not specify this parameter in their
434
+ # requests. Documentation on downloading objects from requester pays
435
+ # buckets can be found at
436
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
437
+ # @option options [String] :tagging
438
+ # The tag-set for the object destination object this value must be used
439
+ # in conjunction with the TaggingDirective. The tag-set must be encoded
440
+ # as URL Query parameters
441
+ # @return [Types::CopyObjectOutput]
442
+ def copy_from(options = {})
443
+ options = options.merge(
444
+ bucket: @bucket_name,
445
+ key: @key
446
+ )
447
+ resp = @client.copy_object(options)
448
+ resp.data
449
+ end
308
450
 
309
- # @example Request syntax with placeholder values
310
- #
311
- # object.copy_from({
312
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
313
- # cache_control: "CacheControl",
314
- # content_disposition: "ContentDisposition",
315
- # content_encoding: "ContentEncoding",
316
- # content_language: "ContentLanguage",
317
- # content_type: "ContentType",
318
- # copy_source: "CopySource", # required
319
- # copy_source_if_match: "CopySourceIfMatch",
320
- # copy_source_if_modified_since: Time.now,
321
- # copy_source_if_none_match: "CopySourceIfNoneMatch",
322
- # copy_source_if_unmodified_since: Time.now,
323
- # expires: Time.now,
324
- # grant_full_control: "GrantFullControl",
325
- # grant_read: "GrantRead",
326
- # grant_read_acp: "GrantReadACP",
327
- # grant_write_acp: "GrantWriteACP",
328
- # metadata: {
329
- # "MetadataKey" => "MetadataValue",
330
- # },
331
- # metadata_directive: "COPY", # accepts COPY, REPLACE
332
- # tagging_directive: "COPY", # accepts COPY, REPLACE
333
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
334
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
335
- # website_redirect_location: "WebsiteRedirectLocation",
336
- # sse_customer_algorithm: "SSECustomerAlgorithm",
337
- # sse_customer_key: "SSECustomerKey",
338
- # sse_customer_key_md5: "SSECustomerKeyMD5",
339
- # ssekms_key_id: "SSEKMSKeyId",
340
- # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
341
- # copy_source_sse_customer_key: "CopySourceSSECustomerKey",
342
- # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
343
- # request_payer: "requester", # accepts requester
344
- # tagging: "TaggingHeader",
345
- # })
346
- # @param [Hash] options ({})
347
- # @option options [String] :acl
348
- # The canned ACL to apply to the object.
349
- # @option options [String] :cache_control
350
- # Specifies caching behavior along the request/reply chain.
351
- # @option options [String] :content_disposition
352
- # Specifies presentational information for the object.
353
- # @option options [String] :content_encoding
354
- # Specifies what content encodings have been applied to the object and
355
- # thus what decoding mechanisms must be applied to obtain the media-type
356
- # referenced by the Content-Type header field.
357
- # @option options [String] :content_language
358
- # The language the content is in.
359
- # @option options [String] :content_type
360
- # A standard MIME type describing the format of the object data.
361
- # @option options [required, String] :copy_source
362
- # The name of the source bucket and key name of the source object,
363
- # separated by a slash (/). Must be URL-encoded.
364
- # @option options [String] :copy_source_if_match
365
- # Copies the object if its entity tag (ETag) matches the specified tag.
366
- # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
367
- # Copies the object if it has been modified since the specified time.
368
- # @option options [String] :copy_source_if_none_match
369
- # Copies the object if its entity tag (ETag) is different than the
370
- # specified ETag.
371
- # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since
372
- # Copies the object if it hasn't been modified since the specified
373
- # time.
374
- # @option options [Time,DateTime,Date,Integer,String] :expires
375
- # The date and time at which the object is no longer cacheable.
376
- # @option options [String] :grant_full_control
377
- # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
378
- # object.
379
- # @option options [String] :grant_read
380
- # Allows grantee to read the object data and its metadata.
381
- # @option options [String] :grant_read_acp
382
- # Allows grantee to read the object ACL.
383
- # @option options [String] :grant_write_acp
384
- # Allows grantee to write the ACL for the applicable object.
385
- # @option options [Hash<String,String>] :metadata
386
- # A map of metadata to store with the object in S3.
387
- # @option options [String] :metadata_directive
388
- # Specifies whether the metadata is copied from the source object or
389
- # replaced with metadata provided in the request.
390
- # @option options [String] :tagging_directive
391
- # Specifies whether the object tag-set are copied from the source object
392
- # or replaced with tag-set provided in the request.
393
- # @option options [String] :server_side_encryption
394
- # The Server-side encryption algorithm used when storing this object in
395
- # S3 (e.g., AES256, aws:kms).
396
- # @option options [String] :storage_class
397
- # The type of storage to use for the object. Defaults to 'STANDARD'.
398
- # @option options [String] :website_redirect_location
399
- # If the bucket is configured as a website, redirects requests for this
400
- # object to another object in the same bucket or to an external URL.
401
- # Amazon S3 stores the value of this header in the object metadata.
402
- # @option options [String] :sse_customer_algorithm
403
- # Specifies the algorithm to use to when encrypting the object (e.g.,
404
- # AES256).
405
- # @option options [String] :sse_customer_key
406
- # Specifies the customer-provided encryption key for Amazon S3 to use in
407
- # encrypting data. This value is used to store the object and then it is
408
- # discarded; Amazon does not store the encryption key. The key must be
409
- # appropriate for use with the algorithm specified in the
410
- # x-amz-server-side​-encryption​-customer-algorithm header.
411
- # @option options [String] :sse_customer_key_md5
412
- # Specifies the 128-bit MD5 digest of the encryption key according to
413
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
414
- # ensure the encryption key was transmitted without error.
415
- # @option options [String] :ssekms_key_id
416
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
417
- # PUT requests for an object protected by AWS KMS will fail if not made
418
- # via SSL or using SigV4. Documentation on configuring any of the
419
- # officially supported AWS SDKs and CLI can be found at
420
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
421
- # @option options [String] :copy_source_sse_customer_algorithm
422
- # Specifies the algorithm to use when decrypting the source object
423
- # (e.g., AES256).
424
- # @option options [String] :copy_source_sse_customer_key
425
- # Specifies the customer-provided encryption key for Amazon S3 to use to
426
- # decrypt the source object. The encryption key provided in this header
427
- # must be one that was used when the source object was created.
428
- # @option options [String] :copy_source_sse_customer_key_md5
429
- # Specifies the 128-bit MD5 digest of the encryption key according to
430
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
431
- # ensure the encryption key was transmitted without error.
432
- # @option options [String] :request_payer
433
- # Confirms that the requester knows that she or he will be charged for
434
- # the request. Bucket owners need not specify this parameter in their
435
- # requests. Documentation on downloading objects from requester pays
436
- # buckets can be found at
437
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
438
- # @option options [String] :tagging
439
- # The tag-set for the object destination object this value must be used
440
- # in conjunction with the TaggingDirective. The tag-set must be encoded
441
- # as URL Query parameters
442
- # @return [Types::CopyObjectOutput]
443
- def copy_from(options = {})
444
- options = options.merge(
445
- bucket: @bucket_name,
446
- key: @key
447
- )
448
- resp = @client.copy_object(options)
449
- resp.data
450
- end
451
+ # @example Request syntax with placeholder values
452
+ #
453
+ # object.delete({
454
+ # mfa: "MFA",
455
+ # version_id: "ObjectVersionId",
456
+ # request_payer: "requester", # accepts requester
457
+ # })
458
+ # @param [Hash] options ({})
459
+ # @option options [String] :mfa
460
+ # The concatenation of the authentication device's serial number, a
461
+ # space, and the value that is displayed on your authentication device.
462
+ # @option options [String] :version_id
463
+ # VersionId used to reference a specific version of the object.
464
+ # @option options [String] :request_payer
465
+ # Confirms that the requester knows that she or he will be charged for
466
+ # the request. Bucket owners need not specify this parameter in their
467
+ # requests. Documentation on downloading objects from requester pays
468
+ # buckets can be found at
469
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
470
+ # @return [Types::DeleteObjectOutput]
471
+ def delete(options = {})
472
+ options = options.merge(
473
+ bucket: @bucket_name,
474
+ key: @key
475
+ )
476
+ resp = @client.delete_object(options)
477
+ resp.data
478
+ end
451
479
 
452
- # @example Request syntax with placeholder values
453
- #
454
- # object.delete({
455
- # mfa: "MFA",
456
- # version_id: "ObjectVersionId",
457
- # request_payer: "requester", # accepts requester
458
- # })
459
- # @param [Hash] options ({})
460
- # @option options [String] :mfa
461
- # The concatenation of the authentication device's serial number, a
462
- # space, and the value that is displayed on your authentication device.
463
- # @option options [String] :version_id
464
- # VersionId used to reference a specific version of the object.
465
- # @option options [String] :request_payer
466
- # Confirms that the requester knows that she or he will be charged for
467
- # the request. Bucket owners need not specify this parameter in their
468
- # requests. Documentation on downloading objects from requester pays
469
- # buckets can be found at
470
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
471
- # @return [Types::DeleteObjectOutput]
472
- def delete(options = {})
473
- options = options.merge(
474
- bucket: @bucket_name,
475
- key: @key
476
- )
477
- resp = @client.delete_object(options)
478
- resp.data
479
- end
480
+ # @example Request syntax with placeholder values
481
+ #
482
+ # object.get({
483
+ # if_match: "IfMatch",
484
+ # if_modified_since: Time.now,
485
+ # if_none_match: "IfNoneMatch",
486
+ # if_unmodified_since: Time.now,
487
+ # range: "Range",
488
+ # response_cache_control: "ResponseCacheControl",
489
+ # response_content_disposition: "ResponseContentDisposition",
490
+ # response_content_encoding: "ResponseContentEncoding",
491
+ # response_content_language: "ResponseContentLanguage",
492
+ # response_content_type: "ResponseContentType",
493
+ # response_expires: Time.now,
494
+ # version_id: "ObjectVersionId",
495
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
496
+ # sse_customer_key: "SSECustomerKey",
497
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
498
+ # request_payer: "requester", # accepts requester
499
+ # part_number: 1,
500
+ # })
501
+ # @param [Hash] options ({})
502
+ # @option options [String] :if_match
503
+ # Return the object only if its entity tag (ETag) is the same as the one
504
+ # specified, otherwise return a 412 (precondition failed).
505
+ # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
506
+ # Return the object only if it has been modified since the specified
507
+ # time, otherwise return a 304 (not modified).
508
+ # @option options [String] :if_none_match
509
+ # Return the object only if its entity tag (ETag) is different from the
510
+ # one specified, otherwise return a 304 (not modified).
511
+ # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
512
+ # Return the object only if it has not been modified since the specified
513
+ # time, otherwise return a 412 (precondition failed).
514
+ # @option options [String] :range
515
+ # Downloads the specified range bytes of an object. For more information
516
+ # about the HTTP Range header, go to
517
+ # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
518
+ # @option options [String] :response_cache_control
519
+ # Sets the Cache-Control header of the response.
520
+ # @option options [String] :response_content_disposition
521
+ # Sets the Content-Disposition header of the response
522
+ # @option options [String] :response_content_encoding
523
+ # Sets the Content-Encoding header of the response.
524
+ # @option options [String] :response_content_language
525
+ # Sets the Content-Language header of the response.
526
+ # @option options [String] :response_content_type
527
+ # Sets the Content-Type header of the response.
528
+ # @option options [Time,DateTime,Date,Integer,String] :response_expires
529
+ # Sets the Expires header of the response.
530
+ # @option options [String] :version_id
531
+ # VersionId used to reference a specific version of the object.
532
+ # @option options [String] :sse_customer_algorithm
533
+ # Specifies the algorithm to use to when encrypting the object (e.g.,
534
+ # AES256).
535
+ # @option options [String] :sse_customer_key
536
+ # Specifies the customer-provided encryption key for Amazon S3 to use in
537
+ # encrypting data. This value is used to store the object and then it is
538
+ # discarded; Amazon does not store the encryption key. The key must be
539
+ # appropriate for use with the algorithm specified in the
540
+ # x-amz-server-side​-encryption​-customer-algorithm header.
541
+ # @option options [String] :sse_customer_key_md5
542
+ # Specifies the 128-bit MD5 digest of the encryption key according to
543
+ # RFC 1321. Amazon S3 uses this header for a message integrity check to
544
+ # ensure the encryption key was transmitted without error.
545
+ # @option options [String] :request_payer
546
+ # Confirms that the requester knows that she or he will be charged for
547
+ # the request. Bucket owners need not specify this parameter in their
548
+ # requests. Documentation on downloading objects from requester pays
549
+ # buckets can be found at
550
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
551
+ # @option options [Integer] :part_number
552
+ # Part number of the object being read. This is a positive integer
553
+ # between 1 and 10,000. Effectively performs a 'ranged' GET request
554
+ # for the part specified. Useful for downloading just a part of an
555
+ # object.
556
+ # @return [Types::GetObjectOutput]
557
+ def get(options = {})
558
+ options = options.merge(
559
+ bucket: @bucket_name,
560
+ key: @key
561
+ )
562
+ resp = @client.get_object(options)
563
+ resp.data
564
+ end
480
565
 
481
- # @example Request syntax with placeholder values
482
- #
483
- # object.get({
484
- # if_match: "IfMatch",
485
- # if_modified_since: Time.now,
486
- # if_none_match: "IfNoneMatch",
487
- # if_unmodified_since: Time.now,
488
- # range: "Range",
489
- # response_cache_control: "ResponseCacheControl",
490
- # response_content_disposition: "ResponseContentDisposition",
491
- # response_content_encoding: "ResponseContentEncoding",
492
- # response_content_language: "ResponseContentLanguage",
493
- # response_content_type: "ResponseContentType",
494
- # response_expires: Time.now,
495
- # version_id: "ObjectVersionId",
496
- # sse_customer_algorithm: "SSECustomerAlgorithm",
497
- # sse_customer_key: "SSECustomerKey",
498
- # sse_customer_key_md5: "SSECustomerKeyMD5",
499
- # request_payer: "requester", # accepts requester
500
- # part_number: 1,
501
- # })
502
- # @param [Hash] options ({})
503
- # @option options [String] :if_match
504
- # Return the object only if its entity tag (ETag) is the same as the one
505
- # specified, otherwise return a 412 (precondition failed).
506
- # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
507
- # Return the object only if it has been modified since the specified
508
- # time, otherwise return a 304 (not modified).
509
- # @option options [String] :if_none_match
510
- # Return the object only if its entity tag (ETag) is different from the
511
- # one specified, otherwise return a 304 (not modified).
512
- # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
513
- # Return the object only if it has not been modified since the specified
514
- # time, otherwise return a 412 (precondition failed).
515
- # @option options [String] :range
516
- # Downloads the specified range bytes of an object. For more information
517
- # about the HTTP Range header, go to
518
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
519
- # @option options [String] :response_cache_control
520
- # Sets the Cache-Control header of the response.
521
- # @option options [String] :response_content_disposition
522
- # Sets the Content-Disposition header of the response
523
- # @option options [String] :response_content_encoding
524
- # Sets the Content-Encoding header of the response.
525
- # @option options [String] :response_content_language
526
- # Sets the Content-Language header of the response.
527
- # @option options [String] :response_content_type
528
- # Sets the Content-Type header of the response.
529
- # @option options [Time,DateTime,Date,Integer,String] :response_expires
530
- # Sets the Expires header of the response.
531
- # @option options [String] :version_id
532
- # VersionId used to reference a specific version of the object.
533
- # @option options [String] :sse_customer_algorithm
534
- # Specifies the algorithm to use to when encrypting the object (e.g.,
535
- # AES256).
536
- # @option options [String] :sse_customer_key
537
- # Specifies the customer-provided encryption key for Amazon S3 to use in
538
- # encrypting data. This value is used to store the object and then it is
539
- # discarded; Amazon does not store the encryption key. The key must be
540
- # appropriate for use with the algorithm specified in the
541
- # x-amz-server-side​-encryption​-customer-algorithm header.
542
- # @option options [String] :sse_customer_key_md5
543
- # Specifies the 128-bit MD5 digest of the encryption key according to
544
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
545
- # ensure the encryption key was transmitted without error.
546
- # @option options [String] :request_payer
547
- # Confirms that the requester knows that she or he will be charged for
548
- # the request. Bucket owners need not specify this parameter in their
549
- # requests. Documentation on downloading objects from requester pays
550
- # buckets can be found at
551
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
552
- # @option options [Integer] :part_number
553
- # Part number of the object being read. This is a positive integer
554
- # between 1 and 10,000. Effectively performs a 'ranged' GET request
555
- # for the part specified. Useful for downloading just a part of an
556
- # object.
557
- # @return [Types::GetObjectOutput]
558
- def get(options = {})
559
- options = options.merge(
560
- bucket: @bucket_name,
561
- key: @key
562
- )
563
- resp = @client.get_object(options)
564
- resp.data
565
- end
566
+ # @example Request syntax with placeholder values
567
+ #
568
+ # multipartupload = object.initiate_multipart_upload({
569
+ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
570
+ # cache_control: "CacheControl",
571
+ # content_disposition: "ContentDisposition",
572
+ # content_encoding: "ContentEncoding",
573
+ # content_language: "ContentLanguage",
574
+ # content_type: "ContentType",
575
+ # expires: Time.now,
576
+ # grant_full_control: "GrantFullControl",
577
+ # grant_read: "GrantRead",
578
+ # grant_read_acp: "GrantReadACP",
579
+ # grant_write_acp: "GrantWriteACP",
580
+ # metadata: {
581
+ # "MetadataKey" => "MetadataValue",
582
+ # },
583
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms
584
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
585
+ # website_redirect_location: "WebsiteRedirectLocation",
586
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
587
+ # sse_customer_key: "SSECustomerKey",
588
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
589
+ # ssekms_key_id: "SSEKMSKeyId",
590
+ # request_payer: "requester", # accepts requester
591
+ # })
592
+ # @param [Hash] options ({})
593
+ # @option options [String] :acl
594
+ # The canned ACL to apply to the object.
595
+ # @option options [String] :cache_control
596
+ # Specifies caching behavior along the request/reply chain.
597
+ # @option options [String] :content_disposition
598
+ # Specifies presentational information for the object.
599
+ # @option options [String] :content_encoding
600
+ # Specifies what content encodings have been applied to the object and
601
+ # thus what decoding mechanisms must be applied to obtain the media-type
602
+ # referenced by the Content-Type header field.
603
+ # @option options [String] :content_language
604
+ # The language the content is in.
605
+ # @option options [String] :content_type
606
+ # A standard MIME type describing the format of the object data.
607
+ # @option options [Time,DateTime,Date,Integer,String] :expires
608
+ # The date and time at which the object is no longer cacheable.
609
+ # @option options [String] :grant_full_control
610
+ # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
611
+ # object.
612
+ # @option options [String] :grant_read
613
+ # Allows grantee to read the object data and its metadata.
614
+ # @option options [String] :grant_read_acp
615
+ # Allows grantee to read the object ACL.
616
+ # @option options [String] :grant_write_acp
617
+ # Allows grantee to write the ACL for the applicable object.
618
+ # @option options [Hash<String,String>] :metadata
619
+ # A map of metadata to store with the object in S3.
620
+ # @option options [String] :server_side_encryption
621
+ # The Server-side encryption algorithm used when storing this object in
622
+ # S3 (e.g., AES256, aws:kms).
623
+ # @option options [String] :storage_class
624
+ # The type of storage to use for the object. Defaults to 'STANDARD'.
625
+ # @option options [String] :website_redirect_location
626
+ # If the bucket is configured as a website, redirects requests for this
627
+ # object to another object in the same bucket or to an external URL.
628
+ # Amazon S3 stores the value of this header in the object metadata.
629
+ # @option options [String] :sse_customer_algorithm
630
+ # Specifies the algorithm to use to when encrypting the object (e.g.,
631
+ # AES256).
632
+ # @option options [String] :sse_customer_key
633
+ # Specifies the customer-provided encryption key for Amazon S3 to use in
634
+ # encrypting data. This value is used to store the object and then it is
635
+ # discarded; Amazon does not store the encryption key. The key must be
636
+ # appropriate for use with the algorithm specified in the
637
+ # x-amz-server-side​-encryption​-customer-algorithm header.
638
+ # @option options [String] :sse_customer_key_md5
639
+ # Specifies the 128-bit MD5 digest of the encryption key according to
640
+ # RFC 1321. Amazon S3 uses this header for a message integrity check to
641
+ # ensure the encryption key was transmitted without error.
642
+ # @option options [String] :ssekms_key_id
643
+ # Specifies the AWS KMS key ID to use for object encryption. All GET and
644
+ # PUT requests for an object protected by AWS KMS will fail if not made
645
+ # via SSL or using SigV4. Documentation on configuring any of the
646
+ # officially supported AWS SDKs and CLI can be found at
647
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
648
+ # @option options [String] :request_payer
649
+ # Confirms that the requester knows that she or he will be charged for
650
+ # the request. Bucket owners need not specify this parameter in their
651
+ # requests. Documentation on downloading objects from requester pays
652
+ # buckets can be found at
653
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
654
+ # @return [MultipartUpload]
655
+ def initiate_multipart_upload(options = {})
656
+ options = options.merge(
657
+ bucket: @bucket_name,
658
+ key: @key
659
+ )
660
+ resp = @client.create_multipart_upload(options)
661
+ MultipartUpload.new(
662
+ bucket_name: @bucket_name,
663
+ object_key: @key,
664
+ id: resp.data.upload_id,
665
+ client: @client
666
+ )
667
+ end
566
668
 
567
- # @example Request syntax with placeholder values
568
- #
569
- # multipartupload = object.initiate_multipart_upload({
570
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
571
- # cache_control: "CacheControl",
572
- # content_disposition: "ContentDisposition",
573
- # content_encoding: "ContentEncoding",
574
- # content_language: "ContentLanguage",
575
- # content_type: "ContentType",
576
- # expires: Time.now,
577
- # grant_full_control: "GrantFullControl",
578
- # grant_read: "GrantRead",
579
- # grant_read_acp: "GrantReadACP",
580
- # grant_write_acp: "GrantWriteACP",
581
- # metadata: {
582
- # "MetadataKey" => "MetadataValue",
583
- # },
584
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
585
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
586
- # website_redirect_location: "WebsiteRedirectLocation",
587
- # sse_customer_algorithm: "SSECustomerAlgorithm",
588
- # sse_customer_key: "SSECustomerKey",
589
- # sse_customer_key_md5: "SSECustomerKeyMD5",
590
- # ssekms_key_id: "SSEKMSKeyId",
591
- # request_payer: "requester", # accepts requester
592
- # })
593
- # @param [Hash] options ({})
594
- # @option options [String] :acl
595
- # The canned ACL to apply to the object.
596
- # @option options [String] :cache_control
597
- # Specifies caching behavior along the request/reply chain.
598
- # @option options [String] :content_disposition
599
- # Specifies presentational information for the object.
600
- # @option options [String] :content_encoding
601
- # Specifies what content encodings have been applied to the object and
602
- # thus what decoding mechanisms must be applied to obtain the media-type
603
- # referenced by the Content-Type header field.
604
- # @option options [String] :content_language
605
- # The language the content is in.
606
- # @option options [String] :content_type
607
- # A standard MIME type describing the format of the object data.
608
- # @option options [Time,DateTime,Date,Integer,String] :expires
609
- # The date and time at which the object is no longer cacheable.
610
- # @option options [String] :grant_full_control
611
- # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
612
- # object.
613
- # @option options [String] :grant_read
614
- # Allows grantee to read the object data and its metadata.
615
- # @option options [String] :grant_read_acp
616
- # Allows grantee to read the object ACL.
617
- # @option options [String] :grant_write_acp
618
- # Allows grantee to write the ACL for the applicable object.
619
- # @option options [Hash<String,String>] :metadata
620
- # A map of metadata to store with the object in S3.
621
- # @option options [String] :server_side_encryption
622
- # The Server-side encryption algorithm used when storing this object in
623
- # S3 (e.g., AES256, aws:kms).
624
- # @option options [String] :storage_class
625
- # The type of storage to use for the object. Defaults to 'STANDARD'.
626
- # @option options [String] :website_redirect_location
627
- # If the bucket is configured as a website, redirects requests for this
628
- # object to another object in the same bucket or to an external URL.
629
- # Amazon S3 stores the value of this header in the object metadata.
630
- # @option options [String] :sse_customer_algorithm
631
- # Specifies the algorithm to use to when encrypting the object (e.g.,
632
- # AES256).
633
- # @option options [String] :sse_customer_key
634
- # Specifies the customer-provided encryption key for Amazon S3 to use in
635
- # encrypting data. This value is used to store the object and then it is
636
- # discarded; Amazon does not store the encryption key. The key must be
637
- # appropriate for use with the algorithm specified in the
638
- # x-amz-server-side​-encryption​-customer-algorithm header.
639
- # @option options [String] :sse_customer_key_md5
640
- # Specifies the 128-bit MD5 digest of the encryption key according to
641
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
642
- # ensure the encryption key was transmitted without error.
643
- # @option options [String] :ssekms_key_id
644
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
645
- # PUT requests for an object protected by AWS KMS will fail if not made
646
- # via SSL or using SigV4. Documentation on configuring any of the
647
- # officially supported AWS SDKs and CLI can be found at
648
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
649
- # @option options [String] :request_payer
650
- # Confirms that the requester knows that she or he will be charged for
651
- # the request. Bucket owners need not specify this parameter in their
652
- # requests. Documentation on downloading objects from requester pays
653
- # buckets can be found at
654
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
655
- # @return [MultipartUpload]
656
- def initiate_multipart_upload(options = {})
657
- options = options.merge(
658
- bucket: @bucket_name,
659
- key: @key
660
- )
661
- resp = @client.create_multipart_upload(options)
662
- MultipartUpload.new(
663
- bucket_name: @bucket_name,
664
- object_key: @key,
665
- id: resp.data.upload_id,
666
- client: @client
667
- )
668
- end
669
+ # @example Request syntax with placeholder values
670
+ #
671
+ # object.put({
672
+ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
673
+ # body: source_file,
674
+ # cache_control: "CacheControl",
675
+ # content_disposition: "ContentDisposition",
676
+ # content_encoding: "ContentEncoding",
677
+ # content_language: "ContentLanguage",
678
+ # content_length: 1,
679
+ # content_md5: "ContentMD5",
680
+ # content_type: "ContentType",
681
+ # expires: Time.now,
682
+ # grant_full_control: "GrantFullControl",
683
+ # grant_read: "GrantRead",
684
+ # grant_read_acp: "GrantReadACP",
685
+ # grant_write_acp: "GrantWriteACP",
686
+ # metadata: {
687
+ # "MetadataKey" => "MetadataValue",
688
+ # },
689
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms
690
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
691
+ # website_redirect_location: "WebsiteRedirectLocation",
692
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
693
+ # sse_customer_key: "SSECustomerKey",
694
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
695
+ # ssekms_key_id: "SSEKMSKeyId",
696
+ # request_payer: "requester", # accepts requester
697
+ # tagging: "TaggingHeader",
698
+ # })
699
+ # @param [Hash] options ({})
700
+ # @option options [String] :acl
701
+ # The canned ACL to apply to the object.
702
+ # @option options [String, IO] :body
703
+ # Object data.
704
+ # @option options [String] :cache_control
705
+ # Specifies caching behavior along the request/reply chain.
706
+ # @option options [String] :content_disposition
707
+ # Specifies presentational information for the object.
708
+ # @option options [String] :content_encoding
709
+ # Specifies what content encodings have been applied to the object and
710
+ # thus what decoding mechanisms must be applied to obtain the media-type
711
+ # referenced by the Content-Type header field.
712
+ # @option options [String] :content_language
713
+ # The language the content is in.
714
+ # @option options [Integer] :content_length
715
+ # Size of the body in bytes. This parameter is useful when the size of
716
+ # the body cannot be determined automatically.
717
+ # @option options [String] :content_md5
718
+ # The base64-encoded 128-bit MD5 digest of the part data.
719
+ # @option options [String] :content_type
720
+ # A standard MIME type describing the format of the object data.
721
+ # @option options [Time,DateTime,Date,Integer,String] :expires
722
+ # The date and time at which the object is no longer cacheable.
723
+ # @option options [String] :grant_full_control
724
+ # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
725
+ # object.
726
+ # @option options [String] :grant_read
727
+ # Allows grantee to read the object data and its metadata.
728
+ # @option options [String] :grant_read_acp
729
+ # Allows grantee to read the object ACL.
730
+ # @option options [String] :grant_write_acp
731
+ # Allows grantee to write the ACL for the applicable object.
732
+ # @option options [Hash<String,String>] :metadata
733
+ # A map of metadata to store with the object in S3.
734
+ # @option options [String] :server_side_encryption
735
+ # The Server-side encryption algorithm used when storing this object in
736
+ # S3 (e.g., AES256, aws:kms).
737
+ # @option options [String] :storage_class
738
+ # The type of storage to use for the object. Defaults to 'STANDARD'.
739
+ # @option options [String] :website_redirect_location
740
+ # If the bucket is configured as a website, redirects requests for this
741
+ # object to another object in the same bucket or to an external URL.
742
+ # Amazon S3 stores the value of this header in the object metadata.
743
+ # @option options [String] :sse_customer_algorithm
744
+ # Specifies the algorithm to use to when encrypting the object (e.g.,
745
+ # AES256).
746
+ # @option options [String] :sse_customer_key
747
+ # Specifies the customer-provided encryption key for Amazon S3 to use in
748
+ # encrypting data. This value is used to store the object and then it is
749
+ # discarded; Amazon does not store the encryption key. The key must be
750
+ # appropriate for use with the algorithm specified in the
751
+ # x-amz-server-side​-encryption​-customer-algorithm header.
752
+ # @option options [String] :sse_customer_key_md5
753
+ # Specifies the 128-bit MD5 digest of the encryption key according to
754
+ # RFC 1321. Amazon S3 uses this header for a message integrity check to
755
+ # ensure the encryption key was transmitted without error.
756
+ # @option options [String] :ssekms_key_id
757
+ # Specifies the AWS KMS key ID to use for object encryption. All GET and
758
+ # PUT requests for an object protected by AWS KMS will fail if not made
759
+ # via SSL or using SigV4. Documentation on configuring any of the
760
+ # officially supported AWS SDKs and CLI can be found at
761
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
762
+ # @option options [String] :request_payer
763
+ # Confirms that the requester knows that she or he will be charged for
764
+ # the request. Bucket owners need not specify this parameter in their
765
+ # requests. Documentation on downloading objects from requester pays
766
+ # buckets can be found at
767
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
768
+ # @option options [String] :tagging
769
+ # The tag-set for the object. The tag-set must be encoded as URL Query
770
+ # parameters
771
+ # @return [Types::PutObjectOutput]
772
+ def put(options = {})
773
+ options = options.merge(
774
+ bucket: @bucket_name,
775
+ key: @key
776
+ )
777
+ resp = @client.put_object(options)
778
+ resp.data
779
+ end
669
780
 
670
- # @example Request syntax with placeholder values
671
- #
672
- # object.put({
673
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
674
- # body: source_file,
675
- # cache_control: "CacheControl",
676
- # content_disposition: "ContentDisposition",
677
- # content_encoding: "ContentEncoding",
678
- # content_language: "ContentLanguage",
679
- # content_length: 1,
680
- # content_md5: "ContentMD5",
681
- # content_type: "ContentType",
682
- # expires: Time.now,
683
- # grant_full_control: "GrantFullControl",
684
- # grant_read: "GrantRead",
685
- # grant_read_acp: "GrantReadACP",
686
- # grant_write_acp: "GrantWriteACP",
687
- # metadata: {
688
- # "MetadataKey" => "MetadataValue",
689
- # },
690
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
691
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
692
- # website_redirect_location: "WebsiteRedirectLocation",
693
- # sse_customer_algorithm: "SSECustomerAlgorithm",
694
- # sse_customer_key: "SSECustomerKey",
695
- # sse_customer_key_md5: "SSECustomerKeyMD5",
696
- # ssekms_key_id: "SSEKMSKeyId",
697
- # request_payer: "requester", # accepts requester
698
- # tagging: "TaggingHeader",
699
- # })
700
- # @param [Hash] options ({})
701
- # @option options [String] :acl
702
- # The canned ACL to apply to the object.
703
- # @option options [String, IO] :body
704
- # Object data.
705
- # @option options [String] :cache_control
706
- # Specifies caching behavior along the request/reply chain.
707
- # @option options [String] :content_disposition
708
- # Specifies presentational information for the object.
709
- # @option options [String] :content_encoding
710
- # Specifies what content encodings have been applied to the object and
711
- # thus what decoding mechanisms must be applied to obtain the media-type
712
- # referenced by the Content-Type header field.
713
- # @option options [String] :content_language
714
- # The language the content is in.
715
- # @option options [Integer] :content_length
716
- # Size of the body in bytes. This parameter is useful when the size of
717
- # the body cannot be determined automatically.
718
- # @option options [String] :content_md5
719
- # The base64-encoded 128-bit MD5 digest of the part data.
720
- # @option options [String] :content_type
721
- # A standard MIME type describing the format of the object data.
722
- # @option options [Time,DateTime,Date,Integer,String] :expires
723
- # The date and time at which the object is no longer cacheable.
724
- # @option options [String] :grant_full_control
725
- # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
726
- # object.
727
- # @option options [String] :grant_read
728
- # Allows grantee to read the object data and its metadata.
729
- # @option options [String] :grant_read_acp
730
- # Allows grantee to read the object ACL.
731
- # @option options [String] :grant_write_acp
732
- # Allows grantee to write the ACL for the applicable object.
733
- # @option options [Hash<String,String>] :metadata
734
- # A map of metadata to store with the object in S3.
735
- # @option options [String] :server_side_encryption
736
- # The Server-side encryption algorithm used when storing this object in
737
- # S3 (e.g., AES256, aws:kms).
738
- # @option options [String] :storage_class
739
- # The type of storage to use for the object. Defaults to 'STANDARD'.
740
- # @option options [String] :website_redirect_location
741
- # If the bucket is configured as a website, redirects requests for this
742
- # object to another object in the same bucket or to an external URL.
743
- # Amazon S3 stores the value of this header in the object metadata.
744
- # @option options [String] :sse_customer_algorithm
745
- # Specifies the algorithm to use to when encrypting the object (e.g.,
746
- # AES256).
747
- # @option options [String] :sse_customer_key
748
- # Specifies the customer-provided encryption key for Amazon S3 to use in
749
- # encrypting data. This value is used to store the object and then it is
750
- # discarded; Amazon does not store the encryption key. The key must be
751
- # appropriate for use with the algorithm specified in the
752
- # x-amz-server-side​-encryption​-customer-algorithm header.
753
- # @option options [String] :sse_customer_key_md5
754
- # Specifies the 128-bit MD5 digest of the encryption key according to
755
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
756
- # ensure the encryption key was transmitted without error.
757
- # @option options [String] :ssekms_key_id
758
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
759
- # PUT requests for an object protected by AWS KMS will fail if not made
760
- # via SSL or using SigV4. Documentation on configuring any of the
761
- # officially supported AWS SDKs and CLI can be found at
762
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
763
- # @option options [String] :request_payer
764
- # Confirms that the requester knows that she or he will be charged for
765
- # the request. Bucket owners need not specify this parameter in their
766
- # requests. Documentation on downloading objects from requester pays
767
- # buckets can be found at
768
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
769
- # @option options [String] :tagging
770
- # The tag-set for the object. The tag-set must be encoded as URL Query
771
- # parameters
772
- # @return [Types::PutObjectOutput]
773
- def put(options = {})
774
- options = options.merge(
775
- bucket: @bucket_name,
776
- key: @key
777
- )
778
- resp = @client.put_object(options)
779
- resp.data
780
- end
781
+ # @example Request syntax with placeholder values
782
+ #
783
+ # object.restore_object({
784
+ # version_id: "ObjectVersionId",
785
+ # restore_request: {
786
+ # days: 1, # required
787
+ # glacier_job_parameters: {
788
+ # tier: "Standard", # required, accepts Standard, Bulk, Expedited
789
+ # },
790
+ # },
791
+ # request_payer: "requester", # accepts requester
792
+ # })
793
+ # @param [Hash] options ({})
794
+ # @option options [String] :version_id
795
+ # @option options [Types::RestoreRequest] :restore_request
796
+ # @option options [String] :request_payer
797
+ # Confirms that the requester knows that she or he will be charged for
798
+ # the request. Bucket owners need not specify this parameter in their
799
+ # requests. Documentation on downloading objects from requester pays
800
+ # buckets can be found at
801
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
802
+ # @return [Types::RestoreObjectOutput]
803
+ def restore_object(options = {})
804
+ options = options.merge(
805
+ bucket: @bucket_name,
806
+ key: @key
807
+ )
808
+ resp = @client.restore_object(options)
809
+ resp.data
810
+ end
781
811
 
782
- # @example Request syntax with placeholder values
783
- #
784
- # object.restore_object({
785
- # version_id: "ObjectVersionId",
786
- # restore_request: {
787
- # days: 1, # required
788
- # glacier_job_parameters: {
789
- # tier: "Standard", # required, accepts Standard, Bulk, Expedited
790
- # },
791
- # },
792
- # request_payer: "requester", # accepts requester
793
- # })
794
- # @param [Hash] options ({})
795
- # @option options [String] :version_id
796
- # @option options [Types::RestoreRequest] :restore_request
797
- # @option options [String] :request_payer
798
- # Confirms that the requester knows that she or he will be charged for
799
- # the request. Bucket owners need not specify this parameter in their
800
- # requests. Documentation on downloading objects from requester pays
801
- # buckets can be found at
802
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
803
- # @return [Types::RestoreObjectOutput]
804
- def restore_object(options = {})
805
- options = options.merge(
806
- bucket: @bucket_name,
807
- key: @key
808
- )
809
- resp = @client.restore_object(options)
810
- resp.data
811
- end
812
+ # @!group Associations
812
813
 
813
- # @!group Associations
814
+ # @return [ObjectAcl]
815
+ def acl
816
+ ObjectAcl.new(
817
+ bucket_name: @bucket_name,
818
+ object_key: @key,
819
+ client: @client
820
+ )
821
+ end
814
822
 
815
- # @return [ObjectAcl]
816
- def acl
817
- ObjectAcl.new(
818
- bucket_name: @bucket_name,
819
- object_key: @key,
820
- client: @client
821
- )
822
- end
823
+ # @return [Bucket]
824
+ def bucket
825
+ Bucket.new(
826
+ name: @bucket_name,
827
+ client: @client
828
+ )
829
+ end
823
830
 
824
- # @return [Bucket]
825
- def bucket
826
- Bucket.new(
827
- name: @bucket_name,
828
- client: @client
829
- )
830
- end
831
+ # @param [String] id
832
+ # @return [MultipartUpload]
833
+ def multipart_upload(id)
834
+ MultipartUpload.new(
835
+ bucket_name: @bucket_name,
836
+ object_key: @key,
837
+ id: id,
838
+ client: @client
839
+ )
840
+ end
831
841
 
832
- # @param [String] id
833
- # @return [MultipartUpload]
834
- def multipart_upload(id)
835
- MultipartUpload.new(
836
- bucket_name: @bucket_name,
837
- object_key: @key,
838
- id: id,
839
- client: @client
840
- )
841
- end
842
+ # @param [String] id
843
+ # @return [ObjectVersion]
844
+ def version(id)
845
+ ObjectVersion.new(
846
+ bucket_name: @bucket_name,
847
+ object_key: @key,
848
+ id: id,
849
+ client: @client
850
+ )
851
+ end
842
852
 
843
- # @param [String] id
844
- # @return [ObjectVersion]
845
- def version(id)
846
- ObjectVersion.new(
847
- bucket_name: @bucket_name,
848
- object_key: @key,
849
- id: id,
850
- client: @client
851
- )
852
- end
853
+ # @deprecated
854
+ # @api private
855
+ def identifiers
856
+ {
857
+ bucket_name: @bucket_name,
858
+ key: @key
859
+ }
860
+ end
861
+ deprecated(:identifiers)
862
+
863
+ private
853
864
 
854
- # @deprecated
855
- # @api private
856
- def identifiers
857
- {
858
- bucket_name: @bucket_name,
859
- key: @key
860
- }
865
+ def extract_bucket_name(args, options)
866
+ value = args[0] || options.delete(:bucket_name)
867
+ case value
868
+ when String then value
869
+ when nil then raise ArgumentError, "missing required option :bucket_name"
870
+ else
871
+ msg = "expected :bucket_name to be a String, got #{value.class}"
872
+ raise ArgumentError, msg
861
873
  end
862
- deprecated(:identifiers)
874
+ end
863
875
 
864
- private
876
+ def extract_key(args, options)
877
+ value = args[1] || options.delete(:key)
878
+ case value
879
+ when String then value
880
+ when nil then raise ArgumentError, "missing required option :key"
881
+ else
882
+ msg = "expected :key to be a String, got #{value.class}"
883
+ raise ArgumentError, msg
884
+ end
885
+ end
865
886
 
866
- def extract_bucket_name(args, options)
867
- value = args[0] || options.delete(:bucket_name)
868
- case value
869
- when String then value
870
- when nil then raise ArgumentError, "missing required option :bucket_name"
871
- else
872
- msg = "expected :bucket_name to be a String, got #{value.class}"
873
- raise ArgumentError, msg
874
- end
887
+ def yield_waiter_and_warn(waiter, &block)
888
+ if !@waiter_block_warned
889
+ msg = "pass options to configure the waiter; "
890
+ msg << "yielding the waiter is deprecated"
891
+ warn(msg)
892
+ @waiter_block_warned = true
875
893
  end
894
+ yield(waiter.waiter)
895
+ end
876
896
 
877
- def extract_key(args, options)
878
- value = args[1] || options.delete(:key)
879
- case value
880
- when String then value
881
- when nil then raise ArgumentError, "missing required option :key"
897
+ def separate_params_and_options(options)
898
+ opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
899
+ waiter_opts = {}
900
+ waiter_params = {}
901
+ options.each_pair do |key, value|
902
+ if opts.include?(key)
903
+ waiter_opts[key] = value
882
904
  else
883
- msg = "expected :key to be a String, got #{value.class}"
884
- raise ArgumentError, msg
905
+ waiter_params[key] = value
885
906
  end
886
907
  end
908
+ waiter_opts[:client] ||= @client
909
+ [waiter_opts, waiter_params]
910
+ end
887
911
 
888
- def yield_waiter_and_warn(waiter, &block)
889
- if !@waiter_block_warned
890
- msg = "pass options to configure the waiter; "
891
- msg << "yielding the waiter is deprecated"
892
- warn(msg)
893
- @waiter_block_warned = true
894
- end
895
- yield(waiter.waiter)
896
- end
912
+ class Collection < Aws::Resources::Collection
897
913
 
898
- def separate_params_and_options(options)
899
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
900
- waiter_opts = {}
901
- waiter_params = {}
902
- options.each_pair do |key, value|
903
- if opts.include?(key)
904
- waiter_opts[key] = value
905
- else
906
- waiter_params[key] = value
907
- end
908
- end
909
- waiter_opts[:client] ||= @client
910
- [waiter_opts, waiter_params]
911
- end
914
+ # @!group Batch Actions
912
915
 
913
- class Collection < Aws::Resources::Collection
914
-
915
- # @!group Batch Actions
916
-
917
- # @example Request syntax with placeholder values
918
- #
919
- # object.batch_delete!({
920
- # mfa: "MFA",
921
- # request_payer: "requester", # accepts requester
922
- # })
923
- # @param options ({})
924
- # @option options [String] :mfa
925
- # The concatenation of the authentication device's serial number, a
926
- # space, and the value that is displayed on your authentication device.
927
- # @option options [String] :request_payer
928
- # Confirms that the requester knows that she or he will be charged for
929
- # the request. Bucket owners need not specify this parameter in their
930
- # requests. Documentation on downloading objects from requester pays
931
- # buckets can be found at
932
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
933
- # @return [void]
934
- def batch_delete!(options = {})
935
- batch_enum.each do |batch|
936
- params = Aws::Util.copy_hash(options)
937
- params[:bucket] = batch[0].bucket_name
938
- params[:delete] ||= {}
939
- params[:delete][:objects] ||= []
940
- batch.each do |item|
941
- params[:delete][:objects] << {
942
- key: item.key
943
- }
944
- end
945
- batch[0].client.delete_objects(params)
916
+ # @example Request syntax with placeholder values
917
+ #
918
+ # object.batch_delete!({
919
+ # mfa: "MFA",
920
+ # request_payer: "requester", # accepts requester
921
+ # })
922
+ # @param options ({})
923
+ # @option options [String] :mfa
924
+ # The concatenation of the authentication device's serial number, a
925
+ # space, and the value that is displayed on your authentication device.
926
+ # @option options [String] :request_payer
927
+ # Confirms that the requester knows that she or he will be charged for
928
+ # the request. Bucket owners need not specify this parameter in their
929
+ # requests. Documentation on downloading objects from requester pays
930
+ # buckets can be found at
931
+ # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
932
+ # @return [void]
933
+ def batch_delete!(options = {})
934
+ batch_enum.each do |batch|
935
+ params = Aws::Util.copy_hash(options)
936
+ params[:bucket] = batch[0].bucket_name
937
+ params[:delete] ||= {}
938
+ params[:delete][:objects] ||= []
939
+ batch.each do |item|
940
+ params[:delete][:objects] << {
941
+ key: item.key
942
+ }
946
943
  end
947
- nil
944
+ batch[0].client.delete_objects(params)
948
945
  end
946
+ nil
947
+ end
949
948
 
950
- # @!endgroup
949
+ # @!endgroup
951
950
 
952
- end
953
951
  end
954
952
  end
955
953
  end