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,214 +1,212 @@
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 ObjectAcl
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(bucket_name, object_key, options = {})
15
- # @param [String] bucket_name
16
- # @param [String] object_key
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :bucket_name
20
- # @option options [required, String] :object_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
- @object_key = extract_object_key(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
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
- # @!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 object_key
39
- @object_key
40
- end
36
+ # @return [String]
37
+ def object_key
38
+ @object_key
39
+ end
41
40
 
42
- # @return [Types::Owner]
43
- def owner
44
- data.owner
45
- end
41
+ # @return [Types::Owner]
42
+ def owner
43
+ data.owner
44
+ end
46
45
 
47
- # A list of grants.
48
- # @return [Array<Types::Grant>]
49
- def grants
50
- data.grants
51
- end
46
+ # A list of grants.
47
+ # @return [Array<Types::Grant>]
48
+ def grants
49
+ data.grants
50
+ end
52
51
 
53
- # If present, indicates that the requester was successfully charged for
54
- # the request.
55
- # @return [String]
56
- def request_charged
57
- data.request_charged
58
- end
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
- # @!endgroup
59
+ # @!endgroup
61
60
 
62
- # @return [Client]
63
- def client
64
- @client
65
- end
61
+ # @return [Client]
62
+ def client
63
+ @client
64
+ end
66
65
 
67
- # Loads, or reloads {#data} for the current {ObjectAcl}.
68
- # Returns `self` making it possible to chain methods.
69
- #
70
- # object_acl.reload.data
71
- #
72
- # @return [self]
73
- def load
74
- resp = @client.get_object_acl(
75
- bucket: @bucket_name,
76
- key: @object_key
77
- )
78
- @data = resp.data
79
- self
80
- end
81
- alias :reload :load
82
-
83
- # @return [Types::GetObjectAclOutput]
84
- # Returns the data for this {ObjectAcl}. Calls
85
- # {Client#get_object_acl} if {#data_loaded?} is `false`.
86
- def data
87
- load unless @data
88
- @data
89
- end
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
- # @return [Boolean]
92
- # Returns `true` if this resource is loaded. Accessing attributes or
93
- # {#data} on an unloaded resource will trigger a call to {#load}.
94
- def data_loaded?
95
- !!@data
96
- end
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
- # @!group Actions
99
-
100
- # @example Request syntax with placeholder values
101
- #
102
- # object_acl.put({
103
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
104
- # access_control_policy: {
105
- # grants: [
106
- # {
107
- # grantee: {
108
- # display_name: "DisplayName",
109
- # email_address: "EmailAddress",
110
- # id: "ID",
111
- # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group
112
- # uri: "URI",
113
- # },
114
- # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP
115
- # },
116
- # ],
117
- # owner: {
118
- # display_name: "DisplayName",
119
- # id: "ID",
120
- # },
121
- # },
122
- # content_md5: "ContentMD5",
123
- # grant_full_control: "GrantFullControl",
124
- # grant_read: "GrantRead",
125
- # grant_read_acp: "GrantReadACP",
126
- # grant_write: "GrantWrite",
127
- # grant_write_acp: "GrantWriteACP",
128
- # request_payer: "requester", # accepts requester
129
- # version_id: "ObjectVersionId",
130
- # })
131
- # @param [Hash] options ({})
132
- # @option options [String] :acl
133
- # The canned ACL to apply to the object.
134
- # @option options [Types::AccessControlPolicy] :access_control_policy
135
- # @option options [String] :content_md5
136
- # @option options [String] :grant_full_control
137
- # Allows grantee the read, write, read ACP, and write ACP permissions on
138
- # the bucket.
139
- # @option options [String] :grant_read
140
- # Allows grantee to list the objects in the bucket.
141
- # @option options [String] :grant_read_acp
142
- # Allows grantee to read the bucket ACL.
143
- # @option options [String] :grant_write
144
- # Allows grantee to create, overwrite, and delete any object in the
145
- # bucket.
146
- # @option options [String] :grant_write_acp
147
- # Allows grantee to write the ACL for the applicable bucket.
148
- # @option options [String] :request_payer
149
- # Confirms that the requester knows that she or he will be charged for
150
- # the request. Bucket owners need not specify this parameter in their
151
- # requests. Documentation on downloading objects from requester pays
152
- # buckets can be found at
153
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
154
- # @option options [String] :version_id
155
- # VersionId used to reference a specific version of the object.
156
- # @return [Types::PutObjectAclOutput]
157
- def put(options = {})
158
- options = options.merge(
159
- bucket: @bucket_name,
160
- key: @object_key
161
- )
162
- resp = @client.put_object_acl(options)
163
- resp.data
164
- end
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
- # @!group Associations
165
+ # @!group Associations
167
166
 
168
- # @return [Object]
169
- def object
170
- Object.new(
171
- bucket_name: @bucket_name,
172
- key: @object_key,
173
- client: @client
174
- )
175
- end
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
- # @deprecated
178
- # @api private
179
- def identifiers
180
- {
181
- bucket_name: @bucket_name,
182
- object_key: @object_key
183
- }
184
- end
185
- deprecated(:identifiers)
186
-
187
- private
188
-
189
- def extract_bucket_name(args, options)
190
- value = args[0] || options.delete(:bucket_name)
191
- case value
192
- when String then value
193
- when nil then raise ArgumentError, "missing required option :bucket_name"
194
- else
195
- msg = "expected :bucket_name to be a String, got #{value.class}"
196
- raise ArgumentError, msg
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
- def extract_object_key(args, options)
201
- value = args[1] || options.delete(:object_key)
202
- case value
203
- when String then value
204
- when nil then raise ArgumentError, "missing required option :object_key"
205
- else
206
- msg = "expected :object_key to be a String, got #{value.class}"
207
- raise ArgumentError, msg
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 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 ObjectSummary
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 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
- # @!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
- # @return [Time]
43
- def last_modified
44
- data.last_modified
45
- end
41
+ # @return [Time]
42
+ def last_modified
43
+ data.last_modified
44
+ end
46
45
 
47
- # @return [String]
48
- def etag
49
- data.etag
50
- end
46
+ # @return [String]
47
+ def etag
48
+ data.etag
49
+ end
51
50
 
52
- # @return [Integer]
53
- def size
54
- data.size
55
- end
51
+ # @return [Integer]
52
+ def size
53
+ data.size
54
+ end
56
55
 
57
- # The class of storage used to store the object.
58
- # @return [String]
59
- def storage_class
60
- data.storage_class
61
- end
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
- # @return [Types::Owner]
64
- def owner
65
- data.owner
66
- end
62
+ # @return [Types::Owner]
63
+ def owner
64
+ data.owner
65
+ end
67
66
 
68
- # @!endgroup
67
+ # @!endgroup
69
68
 
70
- # @return [Client]
71
- def client
72
- @client
73
- end
69
+ # @return [Client]
70
+ def client
71
+ @client
72
+ end
74
73
 
75
- # @raise [Errors::ResourceNotLoadable]
76
- # @api private
77
- def load
78
- msg = "#load is not implemented, data only available via enumeration"
79
- raise Errors::ResourceNotLoadable, msg
80
- end
81
- alias :reload :load
82
-
83
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
84
- # @return [Types::Object]
85
- # Returns the data for this {ObjectSummary}.
86
- def data
87
- load unless @data
88
- @data
89
- end
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
- # @return [Boolean]
92
- # Returns `true` if this resource is loaded. Accessing attributes or
93
- # {#data} on an unloaded resource will trigger a call to {#load}.
94
- def data_loaded?
95
- !!@data
96
- end
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
- # @param [Hash] options ({})
99
- # @return [Boolean]
100
- # Returns `true` if the ObjectSummary exists.
101
- def exists?(options = {})
102
- begin
103
- wait_until_exists(options.merge(max_attempts: 1))
104
- true
105
- rescue Aws::Waiters::Errors::UnexpectedError => e
106
- raise e.error
107
- rescue Aws::Waiters::Errors::WaiterFailed
108
- false
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
- # @param [Hash] options ({})
113
- # @option options [Integer] :max_attempts (20)
114
- # @option options [Float] :delay (5)
115
- # @option options [Proc] :before_attempt
116
- # @option options [Proc] :before_wait
117
- # @return [ObjectSummary]
118
- def wait_until_exists(options = {})
119
- options, params = separate_params_and_options(options)
120
- waiter = Waiters::ObjectExists.new(options)
121
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
122
- waiter.wait(params.merge(bucket: @bucket_name,
123
- key: @key))
124
- ObjectSummary.new({
125
- bucket_name: @bucket_name,
126
- key: @key,
127
- client: @client
128
- })
129
- end
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
- # @param [Hash] options ({})
132
- # @option options [Integer] :max_attempts (20)
133
- # @option options [Float] :delay (5)
134
- # @option options [Proc] :before_attempt
135
- # @option options [Proc] :before_wait
136
- # @return [ObjectSummary]
137
- def wait_until_not_exists(options = {})
138
- options, params = separate_params_and_options(options)
139
- waiter = Waiters::ObjectNotExists.new(options)
140
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
141
- waiter.wait(params.merge(bucket: @bucket_name,
142
- key: @key))
143
- ObjectSummary.new({
144
- bucket_name: @bucket_name,
145
- key: @key,
146
- client: @client
147
- })
148
- end
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
- # @!group Actions
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
- # @example Request syntax with placeholder values
153
- #
154
- # object_summary.copy_from({
155
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
156
- # cache_control: "CacheControl",
157
- # content_disposition: "ContentDisposition",
158
- # content_encoding: "ContentEncoding",
159
- # content_language: "ContentLanguage",
160
- # content_type: "ContentType",
161
- # copy_source: "CopySource", # required
162
- # copy_source_if_match: "CopySourceIfMatch",
163
- # copy_source_if_modified_since: Time.now,
164
- # copy_source_if_none_match: "CopySourceIfNoneMatch",
165
- # copy_source_if_unmodified_since: Time.now,
166
- # expires: Time.now,
167
- # grant_full_control: "GrantFullControl",
168
- # grant_read: "GrantRead",
169
- # grant_read_acp: "GrantReadACP",
170
- # grant_write_acp: "GrantWriteACP",
171
- # metadata: {
172
- # "MetadataKey" => "MetadataValue",
173
- # },
174
- # metadata_directive: "COPY", # accepts COPY, REPLACE
175
- # tagging_directive: "COPY", # accepts COPY, REPLACE
176
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
177
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
178
- # website_redirect_location: "WebsiteRedirectLocation",
179
- # sse_customer_algorithm: "SSECustomerAlgorithm",
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
- # @example Request syntax with placeholder values
296
- #
297
- # object_summary.delete({
298
- # mfa: "MFA",
299
- # version_id: "ObjectVersionId",
300
- # request_payer: "requester", # accepts requester
301
- # })
302
- # @param [Hash] options ({})
303
- # @option options [String] :mfa
304
- # The concatenation of the authentication device's serial number, a
305
- # space, and the value that is displayed on your authentication device.
306
- # @option options [String] :version_id
307
- # VersionId used to reference a specific version of the object.
308
- # @option options [String] :request_payer
309
- # Confirms that the requester knows that she or he will be charged for
310
- # the request. Bucket owners need not specify this parameter in their
311
- # requests. Documentation on downloading objects from requester pays
312
- # buckets can be found at
313
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
314
- # @return [Types::DeleteObjectOutput]
315
- def delete(options = {})
316
- options = options.merge(
317
- bucket: @bucket_name,
318
- key: @key
319
- )
320
- resp = @client.delete_object(options)
321
- resp.data
322
- end
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
- # @example Request syntax with placeholder values
325
- #
326
- # object_summary.get({
327
- # if_match: "IfMatch",
328
- # if_modified_since: Time.now,
329
- # if_none_match: "IfNoneMatch",
330
- # if_unmodified_since: Time.now,
331
- # range: "Range",
332
- # response_cache_control: "ResponseCacheControl",
333
- # response_content_disposition: "ResponseContentDisposition",
334
- # response_content_encoding: "ResponseContentEncoding",
335
- # response_content_language: "ResponseContentLanguage",
336
- # response_content_type: "ResponseContentType",
337
- # response_expires: Time.now,
338
- # version_id: "ObjectVersionId",
339
- # sse_customer_algorithm: "SSECustomerAlgorithm",
340
- # sse_customer_key: "SSECustomerKey",
341
- # sse_customer_key_md5: "SSECustomerKeyMD5",
342
- # request_payer: "requester", # accepts requester
343
- # part_number: 1,
344
- # })
345
- # @param [Hash] options ({})
346
- # @option options [String] :if_match
347
- # Return the object only if its entity tag (ETag) is the same as the one
348
- # specified, otherwise return a 412 (precondition failed).
349
- # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
350
- # Return the object only if it has been modified since the specified
351
- # time, otherwise return a 304 (not modified).
352
- # @option options [String] :if_none_match
353
- # Return the object only if its entity tag (ETag) is different from the
354
- # one specified, otherwise return a 304 (not modified).
355
- # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
356
- # Return the object only if it has not been modified since the specified
357
- # time, otherwise return a 412 (precondition failed).
358
- # @option options [String] :range
359
- # Downloads the specified range bytes of an object. For more information
360
- # about the HTTP Range header, go to
361
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
362
- # @option options [String] :response_cache_control
363
- # Sets the Cache-Control header of the response.
364
- # @option options [String] :response_content_disposition
365
- # Sets the Content-Disposition header of the response
366
- # @option options [String] :response_content_encoding
367
- # Sets the Content-Encoding header of the response.
368
- # @option options [String] :response_content_language
369
- # Sets the Content-Language header of the response.
370
- # @option options [String] :response_content_type
371
- # Sets the Content-Type header of the response.
372
- # @option options [Time,DateTime,Date,Integer,String] :response_expires
373
- # Sets the Expires header of the response.
374
- # @option options [String] :version_id
375
- # VersionId used to reference a specific version of the object.
376
- # @option options [String] :sse_customer_algorithm
377
- # Specifies the algorithm to use to when encrypting the object (e.g.,
378
- # AES256).
379
- # @option options [String] :sse_customer_key
380
- # Specifies the customer-provided encryption key for Amazon S3 to use in
381
- # encrypting data. This value is used to store the object and then it is
382
- # discarded; Amazon does not store the encryption key. The key must be
383
- # appropriate for use with the algorithm specified in the
384
- # x-amz-server-side​-encryption​-customer-algorithm header.
385
- # @option options [String] :sse_customer_key_md5
386
- # Specifies the 128-bit MD5 digest of the encryption key according to
387
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
388
- # ensure the encryption key was transmitted without error.
389
- # @option options [String] :request_payer
390
- # Confirms that the requester knows that she or he will be charged for
391
- # the request. Bucket owners need not specify this parameter in their
392
- # requests. Documentation on downloading objects from requester pays
393
- # buckets can be found at
394
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
395
- # @option options [Integer] :part_number
396
- # Part number of the object being read. This is a positive integer
397
- # between 1 and 10,000. Effectively performs a 'ranged' GET request
398
- # for the part specified. Useful for downloading just a part of an
399
- # object.
400
- # @return [Types::GetObjectOutput]
401
- def get(options = {})
402
- options = options.merge(
403
- bucket: @bucket_name,
404
- key: @key
405
- )
406
- resp = @client.get_object(options)
407
- resp.data
408
- end
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
- # @example Request syntax with placeholder values
411
- #
412
- # multipartupload = object_summary.initiate_multipart_upload({
413
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
414
- # cache_control: "CacheControl",
415
- # content_disposition: "ContentDisposition",
416
- # content_encoding: "ContentEncoding",
417
- # content_language: "ContentLanguage",
418
- # content_type: "ContentType",
419
- # expires: Time.now,
420
- # grant_full_control: "GrantFullControl",
421
- # grant_read: "GrantRead",
422
- # grant_read_acp: "GrantReadACP",
423
- # grant_write_acp: "GrantWriteACP",
424
- # metadata: {
425
- # "MetadataKey" => "MetadataValue",
426
- # },
427
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
428
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
429
- # website_redirect_location: "WebsiteRedirectLocation",
430
- # sse_customer_algorithm: "SSECustomerAlgorithm",
431
- # sse_customer_key: "SSECustomerKey",
432
- # sse_customer_key_md5: "SSECustomerKeyMD5",
433
- # ssekms_key_id: "SSEKMSKeyId",
434
- # request_payer: "requester", # accepts requester
435
- # })
436
- # @param [Hash] options ({})
437
- # @option options [String] :acl
438
- # The canned ACL to apply to the object.
439
- # @option options [String] :cache_control
440
- # Specifies caching behavior along the request/reply chain.
441
- # @option options [String] :content_disposition
442
- # Specifies presentational information for the object.
443
- # @option options [String] :content_encoding
444
- # Specifies what content encodings have been applied to the object and
445
- # thus what decoding mechanisms must be applied to obtain the media-type
446
- # referenced by the Content-Type header field.
447
- # @option options [String] :content_language
448
- # The language the content is in.
449
- # @option options [String] :content_type
450
- # A standard MIME type describing the format of the object data.
451
- # @option options [Time,DateTime,Date,Integer,String] :expires
452
- # The date and time at which the object is no longer cacheable.
453
- # @option options [String] :grant_full_control
454
- # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
455
- # object.
456
- # @option options [String] :grant_read
457
- # Allows grantee to read the object data and its metadata.
458
- # @option options [String] :grant_read_acp
459
- # Allows grantee to read the object ACL.
460
- # @option options [String] :grant_write_acp
461
- # Allows grantee to write the ACL for the applicable object.
462
- # @option options [Hash<String,String>] :metadata
463
- # A map of metadata to store with the object in S3.
464
- # @option options [String] :server_side_encryption
465
- # The Server-side encryption algorithm used when storing this object in
466
- # S3 (e.g., AES256, aws:kms).
467
- # @option options [String] :storage_class
468
- # The type of storage to use for the object. Defaults to 'STANDARD'.
469
- # @option options [String] :website_redirect_location
470
- # If the bucket is configured as a website, redirects requests for this
471
- # object to another object in the same bucket or to an external URL.
472
- # Amazon S3 stores the value of this header in the object metadata.
473
- # @option options [String] :sse_customer_algorithm
474
- # Specifies the algorithm to use to when encrypting the object (e.g.,
475
- # AES256).
476
- # @option options [String] :sse_customer_key
477
- # Specifies the customer-provided encryption key for Amazon S3 to use in
478
- # encrypting data. This value is used to store the object and then it is
479
- # discarded; Amazon does not store the encryption key. The key must be
480
- # appropriate for use with the algorithm specified in the
481
- # x-amz-server-side​-encryption​-customer-algorithm header.
482
- # @option options [String] :sse_customer_key_md5
483
- # Specifies the 128-bit MD5 digest of the encryption key according to
484
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
485
- # ensure the encryption key was transmitted without error.
486
- # @option options [String] :ssekms_key_id
487
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
488
- # PUT requests for an object protected by AWS KMS will fail if not made
489
- # via SSL or using SigV4. Documentation on configuring any of the
490
- # officially supported AWS SDKs and CLI can be found at
491
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
492
- # @option options [String] :request_payer
493
- # Confirms that the requester knows that she or he will be charged for
494
- # the request. Bucket owners need not specify this parameter in their
495
- # requests. Documentation on downloading objects from requester pays
496
- # buckets can be found at
497
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
498
- # @return [MultipartUpload]
499
- def initiate_multipart_upload(options = {})
500
- options = options.merge(
501
- bucket: @bucket_name,
502
- key: @key
503
- )
504
- resp = @client.create_multipart_upload(options)
505
- MultipartUpload.new(
506
- bucket_name: @bucket_name,
507
- object_key: @key,
508
- id: resp.data.upload_id,
509
- client: @client
510
- )
511
- end
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
- # @example Request syntax with placeholder values
514
- #
515
- # object_summary.put({
516
- # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
517
- # body: source_file,
518
- # cache_control: "CacheControl",
519
- # content_disposition: "ContentDisposition",
520
- # content_encoding: "ContentEncoding",
521
- # content_language: "ContentLanguage",
522
- # content_length: 1,
523
- # content_md5: "ContentMD5",
524
- # content_type: "ContentType",
525
- # expires: Time.now,
526
- # grant_full_control: "GrantFullControl",
527
- # grant_read: "GrantRead",
528
- # grant_read_acp: "GrantReadACP",
529
- # grant_write_acp: "GrantWriteACP",
530
- # metadata: {
531
- # "MetadataKey" => "MetadataValue",
532
- # },
533
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
534
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA
535
- # website_redirect_location: "WebsiteRedirectLocation",
536
- # sse_customer_algorithm: "SSECustomerAlgorithm",
537
- # sse_customer_key: "SSECustomerKey",
538
- # sse_customer_key_md5: "SSECustomerKeyMD5",
539
- # ssekms_key_id: "SSEKMSKeyId",
540
- # request_payer: "requester", # accepts requester
541
- # tagging: "TaggingHeader",
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
- # @example Request syntax with placeholder values
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
- # @!group Associations
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
- # @return [ObjectAcl]
659
- def acl
660
- ObjectAcl.new(
661
- bucket_name: @bucket_name,
662
- object_key: @key,
663
- client: @client
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
- # @return [Bucket]
668
- def bucket
669
- Bucket.new(
670
- name: @bucket_name,
671
- client: @client
672
- )
673
- end
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
- # @param [String] id
676
- # @return [MultipartUpload]
677
- def multipart_upload(id)
678
- MultipartUpload.new(
679
- bucket_name: @bucket_name,
680
- object_key: @key,
681
- id: id,
682
- client: @client
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
- # @return [Object]
687
- def object
688
- Object.new(
689
- bucket_name: @bucket_name,
690
- key: @key,
691
- client: @client
692
- )
693
- end
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
- # @param [String] id
696
- # @return [ObjectVersion]
697
- def version(id)
698
- ObjectVersion.new(
699
- bucket_name: @bucket_name,
700
- object_key: @key,
701
- id: id,
702
- client: @client
703
- )
704
- end
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
- # @deprecated
707
- # @api private
708
- def identifiers
709
- {
710
- bucket_name: @bucket_name,
711
- key: @key
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
- deprecated(:identifiers)
726
+ end
715
727
 
716
- private
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
- def extract_bucket_name(args, options)
719
- value = args[0] || options.delete(:bucket_name)
720
- case value
721
- when String then value
722
- when nil then raise ArgumentError, "missing required option :bucket_name"
723
- else
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
- def extract_key(args, options)
730
- value = args[1] || options.delete(:key)
731
- case value
732
- when String then value
733
- when nil then raise ArgumentError, "missing required option :key"
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
- msg = "expected :key to be a String, got #{value.class}"
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
- def yield_waiter_and_warn(waiter, &block)
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
- def separate_params_and_options(options)
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
- class Collection < Aws::Resources::Collection
766
-
767
- # @!group Batch Actions
768
-
769
- # @example Request syntax with placeholder values
770
- #
771
- # object_summary.batch_delete!({
772
- # mfa: "MFA",
773
- # request_payer: "requester", # accepts requester
774
- # })
775
- # @param options ({})
776
- # @option options [String] :mfa
777
- # The concatenation of the authentication device's serial number, a
778
- # space, and the value that is displayed on your authentication device.
779
- # @option options [String] :request_payer
780
- # Confirms that the requester knows that she or he will be charged for
781
- # the request. Bucket owners need not specify this parameter in their
782
- # requests. Documentation on downloading objects from requester pays
783
- # buckets can be found at
784
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
785
- # @return [void]
786
- def batch_delete!(options = {})
787
- batch_enum.each do |batch|
788
- params = Aws::Util.copy_hash(options)
789
- params[:bucket] = batch[0].bucket_name
790
- params[:delete] ||= {}
791
- params[:delete][:objects] ||= []
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
- nil
796
+ batch[0].client.delete_objects(params)
800
797
  end
798
+ nil
799
+ end
801
800
 
802
- # @!endgroup
801
+ # @!endgroup
803
802
 
804
- end
805
803
  end
806
804
  end
807
805
  end