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