aws-sdk-s3 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-s3.rb +1 -1
- data/lib/aws-sdk-s3/bucket.rb +540 -542
- data/lib/aws-sdk-s3/bucket_acl.rb +144 -146
- data/lib/aws-sdk-s3/bucket_cors.rb +122 -124
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +140 -142
- data/lib/aws-sdk-s3/bucket_logging.rb +119 -121
- data/lib/aws-sdk-s3/bucket_notification.rb +162 -164
- data/lib/aws-sdk-s3/bucket_policy.rb +114 -116
- data/lib/aws-sdk-s3/bucket_request_payment.rb +105 -107
- data/lib/aws-sdk-s3/bucket_tagging.rb +119 -121
- data/lib/aws-sdk-s3/bucket_versioning.rb +162 -164
- data/lib/aws-sdk-s3/bucket_website.rb +150 -152
- data/lib/aws-sdk-s3/client.rb +4380 -3611
- data/lib/aws-sdk-s3/client_api.rb +2343 -2345
- data/lib/aws-sdk-s3/customizations/object.rb +3 -2
- data/lib/aws-sdk-s3/errors.rb +4 -13
- data/lib/aws-sdk-s3/multipart_upload.rb +240 -242
- data/lib/aws-sdk-s3/multipart_upload_part.rb +273 -275
- data/lib/aws-sdk-s3/object.rb +879 -881
- data/lib/aws-sdk-s3/object_acl.rb +186 -188
- data/lib/aws-sdk-s3/object_summary.rb +751 -753
- data/lib/aws-sdk-s3/object_version.rb +356 -358
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +1 -1
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +1 -1
- data/lib/aws-sdk-s3/presigner.rb +6 -2
- data/lib/aws-sdk-s3/resource.rb +79 -78
- data/lib/aws-sdk-s3/types.rb +7678 -6939
- data/lib/aws-sdk-s3/waiters.rb +150 -151
- metadata +4 -4
@@ -1,314 +1,312 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
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
|
-
|
10
|
-
class MultipartUploadPart
|
8
|
+
module Aws::S3
|
9
|
+
class MultipartUploadPart
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
13
|
+
# @overload def initialize(bucket_name, object_key, multipart_upload_id, part_number, options = {})
|
14
|
+
# @param [String] bucket_name
|
15
|
+
# @param [String] object_key
|
16
|
+
# @param [String] multipart_upload_id
|
17
|
+
# @param [Integer] part_number
|
18
|
+
# @option options [Client] :client
|
19
|
+
# @overload def initialize(options = {})
|
20
|
+
# @option options [required, String] :bucket_name
|
21
|
+
# @option options [required, String] :object_key
|
22
|
+
# @option options [required, String] :multipart_upload_id
|
23
|
+
# @option options [required, Integer] :part_number
|
24
|
+
# @option options [Client] :client
|
25
|
+
def initialize(*args)
|
26
|
+
options = Hash === args.last ? args.pop.dup : {}
|
27
|
+
@bucket_name = extract_bucket_name(args, options)
|
28
|
+
@object_key = extract_object_key(args, options)
|
29
|
+
@multipart_upload_id = extract_multipart_upload_id(args, options)
|
30
|
+
@part_number = extract_part_number(args, options)
|
31
|
+
@data = options.delete(:data)
|
32
|
+
@client = options.delete(:client) || Client.new(options)
|
33
|
+
end
|
35
34
|
|
36
|
-
|
35
|
+
# @!group Read-Only Attributes
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
# @return [String]
|
38
|
+
def bucket_name
|
39
|
+
@bucket_name
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
# @return [String]
|
43
|
+
def object_key
|
44
|
+
@object_key
|
45
|
+
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
# @return [String]
|
48
|
+
def multipart_upload_id
|
49
|
+
@multipart_upload_id
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
# @return [Integer]
|
53
|
+
def part_number
|
54
|
+
@part_number
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
# Date and time at which the part was uploaded.
|
58
|
+
# @return [Time]
|
59
|
+
def last_modified
|
60
|
+
data.last_modified
|
61
|
+
end
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
# Entity tag returned when the part was uploaded.
|
64
|
+
# @return [String]
|
65
|
+
def etag
|
66
|
+
data.etag
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
# Size of the uploaded part data.
|
70
|
+
# @return [Integer]
|
71
|
+
def size
|
72
|
+
data.size
|
73
|
+
end
|
75
74
|
|
76
|
-
|
75
|
+
# @!endgroup
|
77
76
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
77
|
+
# @return [Client]
|
78
|
+
def client
|
79
|
+
@client
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
82
|
+
# @raise [NotImplementedError]
|
83
|
+
# @api private
|
84
|
+
def load
|
85
|
+
msg = "#load is not implemented, data only available via enumeration"
|
86
|
+
raise NotImplementedError, msg
|
87
|
+
end
|
88
|
+
alias :reload :load
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
# @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
|
91
|
+
# @return [Types::Part]
|
92
|
+
# Returns the data for this {MultipartUploadPart}.
|
93
|
+
def data
|
94
|
+
load unless @data
|
95
|
+
@data
|
96
|
+
end
|
98
97
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
98
|
+
# @return [Boolean]
|
99
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
100
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
101
|
+
def data_loaded?
|
102
|
+
!!@data
|
103
|
+
end
|
105
104
|
|
106
|
-
|
105
|
+
# @!group Actions
|
107
106
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
107
|
+
# @example Request syntax with placeholder values
|
108
|
+
#
|
109
|
+
# multipart_upload_part.copy_from({
|
110
|
+
# copy_source: "CopySource", # required
|
111
|
+
# copy_source_if_match: "CopySourceIfMatch",
|
112
|
+
# copy_source_if_modified_since: Time.now,
|
113
|
+
# copy_source_if_none_match: "CopySourceIfNoneMatch",
|
114
|
+
# copy_source_if_unmodified_since: Time.now,
|
115
|
+
# copy_source_range: "CopySourceRange",
|
116
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
117
|
+
# sse_customer_key: "SSECustomerKey",
|
118
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
119
|
+
# copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
|
120
|
+
# copy_source_sse_customer_key: "CopySourceSSECustomerKey",
|
121
|
+
# copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
|
122
|
+
# request_payer: "requester", # accepts requester
|
123
|
+
# })
|
124
|
+
# @param [Hash] options ({})
|
125
|
+
# @option options [required, String] :copy_source
|
126
|
+
# The name of the source bucket and key name of the source object,
|
127
|
+
# separated by a slash (/). Must be URL-encoded.
|
128
|
+
# @option options [String] :copy_source_if_match
|
129
|
+
# Copies the object if its entity tag (ETag) matches the specified tag.
|
130
|
+
# @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
|
131
|
+
# Copies the object if it has been modified since the specified time.
|
132
|
+
# @option options [String] :copy_source_if_none_match
|
133
|
+
# Copies the object if its entity tag (ETag) is different than the
|
134
|
+
# specified ETag.
|
135
|
+
# @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since
|
136
|
+
# Copies the object if it hasn't been modified since the specified
|
137
|
+
# time.
|
138
|
+
# @option options [String] :copy_source_range
|
139
|
+
# The range of bytes to copy from the source object. The range value
|
140
|
+
# must use the form bytes=first-last, where the first and last are the
|
141
|
+
# zero-based byte offsets to copy. For example, bytes=0-9 indicates that
|
142
|
+
# you want to copy the first ten bytes of the source. You can copy a
|
143
|
+
# range only if the source object is greater than 5 GB.
|
144
|
+
# @option options [String] :sse_customer_algorithm
|
145
|
+
# Specifies the algorithm to use to when encrypting the object (e.g.,
|
146
|
+
# AES256).
|
147
|
+
# @option options [String] :sse_customer_key
|
148
|
+
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
149
|
+
# encrypting data. This value is used to store the object and then it is
|
150
|
+
# discarded; Amazon does not store the encryption key. The key must be
|
151
|
+
# appropriate for use with the algorithm specified in the
|
152
|
+
# x-amz-server-side-encryption-customer-algorithm header. This must be
|
153
|
+
# the same encryption key specified in the initiate multipart upload
|
154
|
+
# request.
|
155
|
+
# @option options [String] :sse_customer_key_md5
|
156
|
+
# Specifies the 128-bit MD5 digest of the encryption key according to
|
157
|
+
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
158
|
+
# ensure the encryption key was transmitted without error.
|
159
|
+
# @option options [String] :copy_source_sse_customer_algorithm
|
160
|
+
# Specifies the algorithm to use when decrypting the source object
|
161
|
+
# (e.g., AES256).
|
162
|
+
# @option options [String] :copy_source_sse_customer_key
|
163
|
+
# Specifies the customer-provided encryption key for Amazon S3 to use to
|
164
|
+
# decrypt the source object. The encryption key provided in this header
|
165
|
+
# must be one that was used when the source object was created.
|
166
|
+
# @option options [String] :copy_source_sse_customer_key_md5
|
167
|
+
# Specifies the 128-bit MD5 digest of the encryption key according to
|
168
|
+
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
169
|
+
# ensure the encryption key was transmitted without error.
|
170
|
+
# @option options [String] :request_payer
|
171
|
+
# Confirms that the requester knows that she or he will be charged for
|
172
|
+
# the request. Bucket owners need not specify this parameter in their
|
173
|
+
# requests. Documentation on downloading objects from requester pays
|
174
|
+
# buckets can be found at
|
175
|
+
# http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
176
|
+
# @return [Types::UploadPartCopyOutput]
|
177
|
+
def copy_from(options = {})
|
178
|
+
options = options.merge(
|
179
|
+
bucket: @bucket_name,
|
180
|
+
key: @object_key,
|
181
|
+
upload_id: @multipart_upload_id,
|
182
|
+
part_number: @part_number
|
183
|
+
)
|
184
|
+
resp = @client.upload_part_copy(options)
|
185
|
+
resp.data
|
186
|
+
end
|
188
187
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
188
|
+
# @example Request syntax with placeholder values
|
189
|
+
#
|
190
|
+
# multipart_upload_part.upload({
|
191
|
+
# body: source_file,
|
192
|
+
# content_length: 1,
|
193
|
+
# content_md5: "ContentMD5",
|
194
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
195
|
+
# sse_customer_key: "SSECustomerKey",
|
196
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
197
|
+
# request_payer: "requester", # accepts requester
|
198
|
+
# })
|
199
|
+
# @param [Hash] options ({})
|
200
|
+
# @option options [String, IO] :body
|
201
|
+
# Object data.
|
202
|
+
# @option options [Integer] :content_length
|
203
|
+
# Size of the body in bytes. This parameter is useful when the size of
|
204
|
+
# the body cannot be determined automatically.
|
205
|
+
# @option options [String] :content_md5
|
206
|
+
# The base64-encoded 128-bit MD5 digest of the part data.
|
207
|
+
# @option options [String] :sse_customer_algorithm
|
208
|
+
# Specifies the algorithm to use to when encrypting the object (e.g.,
|
209
|
+
# AES256).
|
210
|
+
# @option options [String] :sse_customer_key
|
211
|
+
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
212
|
+
# encrypting data. This value is used to store the object and then it is
|
213
|
+
# discarded; Amazon does not store the encryption key. The key must be
|
214
|
+
# appropriate for use with the algorithm specified in the
|
215
|
+
# x-amz-server-side-encryption-customer-algorithm header. This must be
|
216
|
+
# the same encryption key specified in the initiate multipart upload
|
217
|
+
# request.
|
218
|
+
# @option options [String] :sse_customer_key_md5
|
219
|
+
# Specifies the 128-bit MD5 digest of the encryption key according to
|
220
|
+
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
221
|
+
# ensure the encryption key was transmitted without error.
|
222
|
+
# @option options [String] :request_payer
|
223
|
+
# Confirms that the requester knows that she or he will be charged for
|
224
|
+
# the request. Bucket owners need not specify this parameter in their
|
225
|
+
# requests. Documentation on downloading objects from requester pays
|
226
|
+
# buckets can be found at
|
227
|
+
# http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
228
|
+
# @return [Types::UploadPartOutput]
|
229
|
+
def upload(options = {})
|
230
|
+
options = options.merge(
|
231
|
+
bucket: @bucket_name,
|
232
|
+
key: @object_key,
|
233
|
+
upload_id: @multipart_upload_id,
|
234
|
+
part_number: @part_number
|
235
|
+
)
|
236
|
+
resp = @client.upload_part(options)
|
237
|
+
resp.data
|
238
|
+
end
|
240
239
|
|
241
|
-
|
240
|
+
# @!group Associations
|
242
241
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
242
|
+
# @return [MultipartUpload]
|
243
|
+
def multipart_upload
|
244
|
+
MultipartUpload.new(
|
245
|
+
bucket_name: @bucket_name,
|
246
|
+
object_key: @object_key,
|
247
|
+
id: @multipart_upload_id,
|
248
|
+
client: @client
|
249
|
+
)
|
250
|
+
end
|
252
251
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
252
|
+
# @deprecated
|
253
|
+
# @api private
|
254
|
+
def identifiers
|
255
|
+
{
|
256
|
+
bucket_name: @bucket_name,
|
257
|
+
object_key: @object_key,
|
258
|
+
multipart_upload_id: @multipart_upload_id,
|
259
|
+
part_number: @part_number
|
260
|
+
}
|
261
|
+
end
|
262
|
+
deprecated(:identifiers)
|
264
263
|
|
265
|
-
|
264
|
+
private
|
266
265
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
end
|
266
|
+
def extract_bucket_name(args, options)
|
267
|
+
value = args[0] || options.delete(:bucket_name)
|
268
|
+
case value
|
269
|
+
when String then value
|
270
|
+
when nil then raise ArgumentError, "missing required option :bucket_name"
|
271
|
+
else
|
272
|
+
msg = "expected :bucket_name to be a String, got #{value.class}"
|
273
|
+
raise ArgumentError, msg
|
276
274
|
end
|
275
|
+
end
|
277
276
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
end
|
277
|
+
def extract_object_key(args, options)
|
278
|
+
value = args[1] || options.delete(:object_key)
|
279
|
+
case value
|
280
|
+
when String then value
|
281
|
+
when nil then raise ArgumentError, "missing required option :object_key"
|
282
|
+
else
|
283
|
+
msg = "expected :object_key to be a String, got #{value.class}"
|
284
|
+
raise ArgumentError, msg
|
287
285
|
end
|
286
|
+
end
|
288
287
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
end
|
288
|
+
def extract_multipart_upload_id(args, options)
|
289
|
+
value = args[2] || options.delete(:multipart_upload_id)
|
290
|
+
case value
|
291
|
+
when String then value
|
292
|
+
when nil then raise ArgumentError, "missing required option :multipart_upload_id"
|
293
|
+
else
|
294
|
+
msg = "expected :multipart_upload_id to be a String, got #{value.class}"
|
295
|
+
raise ArgumentError, msg
|
298
296
|
end
|
297
|
+
end
|
299
298
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
end
|
299
|
+
def extract_part_number(args, options)
|
300
|
+
value = args[3] || options.delete(:part_number)
|
301
|
+
case value
|
302
|
+
when Integer then value
|
303
|
+
when nil then raise ArgumentError, "missing required option :part_number"
|
304
|
+
else
|
305
|
+
msg = "expected :part_number to be a Integer, got #{value.class}"
|
306
|
+
raise ArgumentError, msg
|
309
307
|
end
|
310
|
-
|
311
|
-
class Collection < Aws::Resources::Collection; end
|
312
308
|
end
|
309
|
+
|
310
|
+
class Collection < Aws::Resources::Collection; end
|
313
311
|
end
|
314
312
|
end
|