aws-sdk-glacier 1.0.0.rc1 → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,269 +1,267 @@
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 Glacier
10
- class MultipartUpload
8
+ module Aws::Glacier
9
+ class MultipartUpload
11
10
 
12
- extend Aws::Deprecations
11
+ extend Aws::Deprecations
13
12
 
14
- # @overload def initialize(account_id, vault_name, id, options = {})
15
- # @param [String] account_id
16
- # @param [String] vault_name
17
- # @param [String] id
18
- # @option options [Client] :client
19
- # @overload def initialize(options = {})
20
- # @option options [required, String] :account_id
21
- # @option options [required, String] :vault_name
22
- # @option options [required, String] :id
23
- # @option options [Client] :client
24
- def initialize(*args)
25
- options = Hash === args.last ? args.pop.dup : {}
26
- @account_id = extract_account_id(args, options)
27
- @vault_name = extract_vault_name(args, options)
28
- @id = extract_id(args, options)
29
- @data = options.delete(:data)
30
- @client = options.delete(:client) || Client.new(options)
31
- end
13
+ # @overload def initialize(account_id, vault_name, id, options = {})
14
+ # @param [String] account_id
15
+ # @param [String] vault_name
16
+ # @param [String] id
17
+ # @option options [Client] :client
18
+ # @overload def initialize(options = {})
19
+ # @option options [required, String] :account_id
20
+ # @option options [required, String] :vault_name
21
+ # @option options [required, String] :id
22
+ # @option options [Client] :client
23
+ def initialize(*args)
24
+ options = Hash === args.last ? args.pop.dup : {}
25
+ @account_id = extract_account_id(args, options)
26
+ @vault_name = extract_vault_name(args, options)
27
+ @id = extract_id(args, options)
28
+ @data = options.delete(:data)
29
+ @client = options.delete(:client) || Client.new(options)
30
+ end
32
31
 
33
- # @!group Read-Only Attributes
32
+ # @!group Read-Only Attributes
34
33
 
35
- # @return [String]
36
- def account_id
37
- @account_id
38
- end
34
+ # @return [String]
35
+ def account_id
36
+ @account_id
37
+ end
39
38
 
40
- # @return [String]
41
- def vault_name
42
- @vault_name
43
- end
39
+ # @return [String]
40
+ def vault_name
41
+ @vault_name
42
+ end
44
43
 
45
- # @return [String]
46
- def id
47
- @id
48
- end
49
- alias :multipart_upload_id :id
44
+ # @return [String]
45
+ def id
46
+ @id
47
+ end
48
+ alias :multipart_upload_id :id
50
49
 
51
- # The Amazon Resource Name (ARN) of the vault that contains the archive.
52
- # @return [String]
53
- def vault_arn
54
- data.vault_arn
55
- end
50
+ # The Amazon Resource Name (ARN) of the vault that contains the archive.
51
+ # @return [String]
52
+ def vault_arn
53
+ data.vault_arn
54
+ end
56
55
 
57
- # The description of the archive that was specified in the Initiate
58
- # Multipart Upload request.
59
- # @return [String]
60
- def archive_description
61
- data.archive_description
62
- end
56
+ # The description of the archive that was specified in the Initiate
57
+ # Multipart Upload request.
58
+ # @return [String]
59
+ def archive_description
60
+ data.archive_description
61
+ end
63
62
 
64
- # The part size, in bytes, specified in the Initiate Multipart Upload
65
- # request. This is the size of all the parts in the upload except the
66
- # last part, which may be smaller than this size.
67
- # @return [Integer]
68
- def part_size_in_bytes
69
- data.part_size_in_bytes
70
- end
63
+ # The part size, in bytes, specified in the Initiate Multipart Upload
64
+ # request. This is the size of all the parts in the upload except the
65
+ # last part, which may be smaller than this size.
66
+ # @return [Integer]
67
+ def part_size_in_bytes
68
+ data.part_size_in_bytes
69
+ end
71
70
 
72
- # The UTC time at which the multipart upload was initiated.
73
- # @return [Time]
74
- def creation_date
75
- data.creation_date
76
- end
71
+ # The UTC time at which the multipart upload was initiated.
72
+ # @return [Time]
73
+ def creation_date
74
+ data.creation_date
75
+ end
77
76
 
78
- # @!endgroup
77
+ # @!endgroup
79
78
 
80
- # @return [Client]
81
- def client
82
- @client
83
- end
79
+ # @return [Client]
80
+ def client
81
+ @client
82
+ end
84
83
 
85
- # @raise [Errors::ResourceNotLoadable]
86
- # @api private
87
- def load
88
- msg = "#load is not implemented, data only available via enumeration"
89
- raise Errors::ResourceNotLoadable, msg
90
- end
91
- alias :reload :load
84
+ # @raise [NotImplementedError]
85
+ # @api private
86
+ def load
87
+ msg = "#load is not implemented, data only available via enumeration"
88
+ raise NotImplementedError, msg
89
+ end
90
+ alias :reload :load
92
91
 
93
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
94
- # @return [Types::UploadListElement]
95
- # Returns the data for this {MultipartUpload}.
96
- def data
97
- load unless @data
98
- @data
99
- end
92
+ # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
93
+ # @return [Types::UploadListElement]
94
+ # Returns the data for this {MultipartUpload}.
95
+ def data
96
+ load unless @data
97
+ @data
98
+ end
100
99
 
101
- # @return [Boolean]
102
- # Returns `true` if this resource is loaded. Accessing attributes or
103
- # {#data} on an unloaded resource will trigger a call to {#load}.
104
- def data_loaded?
105
- !!@data
106
- end
100
+ # @return [Boolean]
101
+ # Returns `true` if this resource is loaded. Accessing attributes or
102
+ # {#data} on an unloaded resource will trigger a call to {#load}.
103
+ def data_loaded?
104
+ !!@data
105
+ end
107
106
 
108
- # @!group Actions
107
+ # @!group Actions
109
108
 
110
- # @example Request syntax with placeholder values
111
- #
112
- # multipart_upload.abort()
113
- # @param [Hash] options ({})
114
- # @return [EmptyStructure]
115
- def abort(options = {})
116
- options = options.merge(
117
- account_id: @account_id,
118
- vault_name: @vault_name,
119
- upload_id: @id
120
- )
121
- resp = @client.abort_multipart_upload(options)
122
- resp.data
123
- end
109
+ # @example Request syntax with placeholder values
110
+ #
111
+ # multipart_upload.abort()
112
+ # @param [Hash] options ({})
113
+ # @return [EmptyStructure]
114
+ def abort(options = {})
115
+ options = options.merge(
116
+ account_id: @account_id,
117
+ vault_name: @vault_name,
118
+ upload_id: @id
119
+ )
120
+ resp = @client.abort_multipart_upload(options)
121
+ resp.data
122
+ end
124
123
 
125
- # @example Request syntax with placeholder values
126
- #
127
- # multipart_upload.complete({
128
- # archive_size: 1,
129
- # checksum: "string",
130
- # })
131
- # @param [Hash] options ({})
132
- # @option options [Integer] :archive_size
133
- # The total size, in bytes, of the entire archive. This value should be
134
- # the sum of all the sizes of the individual parts that you uploaded.
135
- # @option options [String] :checksum
136
- # The SHA256 tree hash of the entire archive. It is the tree hash of
137
- # SHA256 tree hash of the individual parts. If the value you specify in
138
- # the request does not match the SHA256 tree hash of the final assembled
139
- # archive as computed by Amazon Glacier, Amazon Glacier returns an error
140
- # and the request fails.
141
- # @return [Types::ArchiveCreationOutput]
142
- def complete(options = {})
143
- options = options.merge(
144
- account_id: @account_id,
145
- vault_name: @vault_name,
146
- upload_id: @id
147
- )
148
- resp = @client.complete_multipart_upload(options)
149
- resp.data
150
- end
124
+ # @example Request syntax with placeholder values
125
+ #
126
+ # multipart_upload.complete({
127
+ # archive_size: 1,
128
+ # checksum: "string",
129
+ # })
130
+ # @param [Hash] options ({})
131
+ # @option options [Integer] :archive_size
132
+ # The total size, in bytes, of the entire archive. This value should be
133
+ # the sum of all the sizes of the individual parts that you uploaded.
134
+ # @option options [String] :checksum
135
+ # The SHA256 tree hash of the entire archive. It is the tree hash of
136
+ # SHA256 tree hash of the individual parts. If the value you specify in
137
+ # the request does not match the SHA256 tree hash of the final assembled
138
+ # archive as computed by Amazon Glacier, Amazon Glacier returns an error
139
+ # and the request fails.
140
+ # @return [Types::ArchiveCreationOutput]
141
+ def complete(options = {})
142
+ options = options.merge(
143
+ account_id: @account_id,
144
+ vault_name: @vault_name,
145
+ upload_id: @id
146
+ )
147
+ resp = @client.complete_multipart_upload(options)
148
+ resp.data
149
+ end
151
150
 
152
- # @example Request syntax with placeholder values
153
- #
154
- # multipart_upload.parts({
155
- # marker: "string",
156
- # limit: 1,
157
- # })
158
- # @param [Hash] options ({})
159
- # @option options [String] :marker
160
- # An opaque string used for pagination. This value specifies the part at
161
- # which the listing of parts should begin. Get the marker value from the
162
- # response of a previous List Parts response. You need only include the
163
- # marker if you are continuing the pagination of results started in a
164
- # previous List Parts request.
165
- # @option options [Integer] :limit
166
- # The maximum number of parts to be returned. The default limit is 1000.
167
- # The number of parts returned might be fewer than the specified limit,
168
- # but the number of returned parts never exceeds the limit.
169
- # @return [Types::ListPartsOutput]
170
- def parts(options = {})
171
- options = options.merge(
172
- account_id: @account_id,
173
- vault_name: @vault_name,
174
- upload_id: @id
175
- )
176
- resp = @client.list_parts(options)
177
- resp.data
178
- end
151
+ # @example Request syntax with placeholder values
152
+ #
153
+ # multipart_upload.parts({
154
+ # marker: "string",
155
+ # limit: 1,
156
+ # })
157
+ # @param [Hash] options ({})
158
+ # @option options [String] :marker
159
+ # An opaque string used for pagination. This value specifies the part at
160
+ # which the listing of parts should begin. Get the marker value from the
161
+ # response of a previous List Parts response. You need only include the
162
+ # marker if you are continuing the pagination of results started in a
163
+ # previous List Parts request.
164
+ # @option options [Integer] :limit
165
+ # The maximum number of parts to be returned. The default limit is 1000.
166
+ # The number of parts returned might be fewer than the specified limit,
167
+ # but the number of returned parts never exceeds the limit.
168
+ # @return [Types::ListPartsOutput]
169
+ def parts(options = {})
170
+ options = options.merge(
171
+ account_id: @account_id,
172
+ vault_name: @vault_name,
173
+ upload_id: @id
174
+ )
175
+ resp = @client.list_parts(options)
176
+ resp.data
177
+ end
179
178
 
180
- # @example Request syntax with placeholder values
181
- #
182
- # multipart_upload.upload_part({
183
- # checksum: "string",
184
- # range: "string",
185
- # body: "data",
186
- # })
187
- # @param [Hash] options ({})
188
- # @option options [String] :checksum
189
- # The SHA256 tree hash of the data being uploaded.
190
- # @option options [String] :range
191
- # Identifies the range of bytes in the assembled archive that will be
192
- # uploaded in this part. Amazon Glacier uses this information to
193
- # assemble the archive in the proper sequence. The format of this header
194
- # follows RFC 2616. An example header is Content-Range:bytes
195
- # 0-4194303/*.
196
- # @option options [String, IO] :body
197
- # The data to upload.
198
- # @return [Types::UploadMultipartPartOutput]
199
- def upload_part(options = {})
200
- options = options.merge(
201
- account_id: @account_id,
202
- vault_name: @vault_name,
203
- upload_id: @id
204
- )
205
- resp = @client.upload_multipart_part(options)
206
- resp.data
207
- end
179
+ # @example Request syntax with placeholder values
180
+ #
181
+ # multipart_upload.upload_part({
182
+ # checksum: "string",
183
+ # range: "string",
184
+ # body: "data",
185
+ # })
186
+ # @param [Hash] options ({})
187
+ # @option options [String] :checksum
188
+ # The SHA256 tree hash of the data being uploaded.
189
+ # @option options [String] :range
190
+ # Identifies the range of bytes in the assembled archive that will be
191
+ # uploaded in this part. Amazon Glacier uses this information to
192
+ # assemble the archive in the proper sequence. The format of this header
193
+ # follows RFC 2616. An example header is Content-Range:bytes
194
+ # 0-4194303/*.
195
+ # @option options [String, IO] :body
196
+ # The data to upload.
197
+ # @return [Types::UploadMultipartPartOutput]
198
+ def upload_part(options = {})
199
+ options = options.merge(
200
+ account_id: @account_id,
201
+ vault_name: @vault_name,
202
+ upload_id: @id
203
+ )
204
+ resp = @client.upload_multipart_part(options)
205
+ resp.data
206
+ end
208
207
 
209
- # @!group Associations
208
+ # @!group Associations
210
209
 
211
- # @return [Vault]
212
- def vault
213
- Vault.new(
214
- account_id: @account_id,
215
- name: @vault_name,
216
- client: @client
217
- )
218
- end
210
+ # @return [Vault]
211
+ def vault
212
+ Vault.new(
213
+ account_id: @account_id,
214
+ name: @vault_name,
215
+ client: @client
216
+ )
217
+ end
219
218
 
220
- # @deprecated
221
- # @api private
222
- def identifiers
223
- {
224
- account_id: @account_id,
225
- vault_name: @vault_name,
226
- id: @id
227
- }
228
- end
229
- deprecated(:identifiers)
219
+ # @deprecated
220
+ # @api private
221
+ def identifiers
222
+ {
223
+ account_id: @account_id,
224
+ vault_name: @vault_name,
225
+ id: @id
226
+ }
227
+ end
228
+ deprecated(:identifiers)
230
229
 
231
- private
230
+ private
232
231
 
233
- def extract_account_id(args, options)
234
- value = args[0] || options.delete(:account_id)
235
- case value
236
- when String then value
237
- when nil then raise ArgumentError, "missing required option :account_id"
238
- else
239
- msg = "expected :account_id to be a String, got #{value.class}"
240
- raise ArgumentError, msg
241
- end
232
+ def extract_account_id(args, options)
233
+ value = args[0] || options.delete(:account_id)
234
+ case value
235
+ when String then value
236
+ when nil then raise ArgumentError, "missing required option :account_id"
237
+ else
238
+ msg = "expected :account_id to be a String, got #{value.class}"
239
+ raise ArgumentError, msg
242
240
  end
241
+ end
243
242
 
244
- def extract_vault_name(args, options)
245
- value = args[1] || options.delete(:vault_name)
246
- case value
247
- when String then value
248
- when nil then raise ArgumentError, "missing required option :vault_name"
249
- else
250
- msg = "expected :vault_name to be a String, got #{value.class}"
251
- raise ArgumentError, msg
252
- end
243
+ def extract_vault_name(args, options)
244
+ value = args[1] || options.delete(:vault_name)
245
+ case value
246
+ when String then value
247
+ when nil then raise ArgumentError, "missing required option :vault_name"
248
+ else
249
+ msg = "expected :vault_name to be a String, got #{value.class}"
250
+ raise ArgumentError, msg
253
251
  end
252
+ end
254
253
 
255
- def extract_id(args, options)
256
- value = args[2] || options.delete(:id)
257
- case value
258
- when String then value
259
- when nil then raise ArgumentError, "missing required option :id"
260
- else
261
- msg = "expected :id to be a String, got #{value.class}"
262
- raise ArgumentError, msg
263
- end
254
+ def extract_id(args, options)
255
+ value = args[2] || options.delete(:id)
256
+ case value
257
+ when String then value
258
+ when nil then raise ArgumentError, "missing required option :id"
259
+ else
260
+ msg = "expected :id to be a String, got #{value.class}"
261
+ raise ArgumentError, msg
264
262
  end
265
-
266
- class Collection < Aws::Resources::Collection; end
267
263
  end
264
+
265
+ class Collection < Aws::Resources::Collection; end
268
266
  end
269
267
  end