aws-sdk-resources 2.0.48 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-resources.rb +1 -1
- data/lib/aws-sdk-resources/builder.rb +3 -2
- data/lib/aws-sdk-resources/definition.rb +17 -12
- data/lib/aws-sdk-resources/documenter.rb +17 -14
- data/lib/aws-sdk-resources/documenter/base_operation_documenter.rb +66 -59
- data/lib/aws-sdk-resources/documenter/data_operation_documenter.rb +5 -27
- data/lib/aws-sdk-resources/documenter/has_many_operation_documenter.rb +16 -20
- data/lib/aws-sdk-resources/documenter/has_operation_documenter.rb +5 -46
- data/lib/aws-sdk-resources/documenter/operation_documenter.rb +5 -28
- data/lib/aws-sdk-resources/documenter/resource_operation_documenter.rb +12 -24
- data/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb +4 -8
- data/lib/aws-sdk-resources/services/s3/encryption/client.rb +3 -3
- data/lib/aws-sdk-resources/services/s3/encryption/decrypt_handler.rb +2 -2
- data/lib/aws-sdk-resources/services/s3/encryption/encrypt_handler.rb +1 -1
- data/lib/aws-sdk-resources/services/s3/encryption/materials.rb +2 -2
- data/lib/aws-sdk-resources/services/s3/presigned_post.rb +2 -3
- data/lib/aws-sdk-resources/services/sns/message_verifier.rb +1 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1961d384b58666ed95adab0542f240ea34e90283
|
4
|
+
data.tar.gz: 6234d8d83737d79295e3087eca3faa2abe78e4bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db807796aa9afb541ec253832c20564e83065bce6491b00c455bd8b16200cd99b699197efc5392d0bf2251849b905dc82a5bdbe60b525aaa5bb94fe3410a85b
|
7
|
+
data.tar.gz: 0149d9727b8a9ed429c3abbdff040378732dd421a974d5028fda419027a3a20c219778b7fb12a502a117ff27704a62db8a2ec9a551c2a33089cf73ef008433e8
|
data/lib/aws-sdk-resources.rb
CHANGED
@@ -26,7 +26,7 @@ module Aws
|
|
26
26
|
when Resources::Definition then definition
|
27
27
|
when Hash then Resources::Definition.new(definition)
|
28
28
|
when String
|
29
|
-
Resources::Definition.new(
|
29
|
+
Resources::Definition.new(Json.load_file(definition), source_path: definition)
|
30
30
|
else raise ArgumentError, "invalid resource definition #{definition}"
|
31
31
|
end
|
32
32
|
definition.apply(svc_module)
|
@@ -47,10 +47,11 @@ module Aws
|
|
47
47
|
|
48
48
|
def build_batch(identifier_map, options, &block)
|
49
49
|
resources = (0...resource_count(identifier_map)).collect do |n|
|
50
|
-
identifiers = @sources.
|
50
|
+
identifiers = @sources.inject({}) do |hash, source|
|
51
51
|
value = identifier_map[source.target]
|
52
52
|
value = value[n] if source.plural?
|
53
|
-
|
53
|
+
hash[source.target] = value
|
54
|
+
hash
|
54
55
|
end
|
55
56
|
resource = build_one(identifiers, options)
|
56
57
|
yield(resource) if block_given?
|
@@ -58,16 +58,17 @@ module Aws
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def define_data_attributes(namespace, resource, definition)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
if shape_name = definition['shape']
|
62
|
+
shape = resource.client_class.api.metadata['shapes'][shape_name]
|
63
|
+
shape.member_names.each do |member_name|
|
64
|
+
if
|
65
|
+
resource.instance_methods.include?(member_name) ||
|
66
|
+
data_attribute_is_an_identifier?(member_name, resource, definition)
|
67
|
+
then
|
68
|
+
next # some data attributes are duplicates to identifiers
|
69
|
+
else
|
70
|
+
resource.add_data_attribute(member_name)
|
71
|
+
end
|
71
72
|
end
|
72
73
|
end
|
73
74
|
end
|
@@ -155,8 +156,12 @@ module Aws
|
|
155
156
|
|
156
157
|
def limit_key(resource, definition)
|
157
158
|
operation_name = definition['request']['operation']
|
158
|
-
|
159
|
-
|
159
|
+
operation = resource.client_class.api.operation(underscore(operation_name))
|
160
|
+
if operation[:pager]
|
161
|
+
operation[:pager].limit_key
|
162
|
+
else
|
163
|
+
nil
|
164
|
+
end
|
160
165
|
end
|
161
166
|
|
162
167
|
def define_request(definition)
|
@@ -13,6 +13,8 @@ module Aws
|
|
13
13
|
|
14
14
|
class << self
|
15
15
|
|
16
|
+
include Seahorse::Model::Shapes
|
17
|
+
|
16
18
|
def apply_customizations
|
17
19
|
document_s3_object_upload_file_additional_options
|
18
20
|
end
|
@@ -21,23 +23,24 @@ module Aws
|
|
21
23
|
|
22
24
|
def document_s3_object_upload_file_additional_options
|
23
25
|
input = Aws::S3::Client.api.operation(:create_multipart_upload).input
|
24
|
-
opts = input.member_names - [:bucket, :key]
|
26
|
+
opts = input.shape.member_names - [:bucket, :key]
|
25
27
|
tags = opts.map do |opt|
|
26
|
-
|
27
|
-
type = case shape
|
28
|
-
when
|
29
|
-
when
|
30
|
-
when
|
31
|
-
when
|
32
|
-
when
|
33
|
-
when
|
34
|
-
when
|
35
|
-
when
|
36
|
-
when
|
28
|
+
ref = input.shape.member(opt)
|
29
|
+
type = case ref.shape
|
30
|
+
when StructureShape then 'Structure'
|
31
|
+
when ListShape then 'Array'
|
32
|
+
when MapShape then 'Hash'
|
33
|
+
when StringShape then 'String'
|
34
|
+
when IntegerShape then 'Integer'
|
35
|
+
when FloatShape then 'Float'
|
36
|
+
when BooleanShape then 'Boolean'
|
37
|
+
when TimestampShape then 'Time'
|
38
|
+
when BlobShape then 'IO'
|
37
39
|
else
|
38
|
-
raise "unhandled shape class `#{shape.class.name}'"
|
40
|
+
raise "unhandled shape class `#{ref.shape.class.name}'"
|
39
41
|
end
|
40
|
-
|
42
|
+
docs = ref.documentation || ref.shape.documentation
|
43
|
+
"@option options [#{type}] :#{opt} #{docs}"
|
41
44
|
end
|
42
45
|
tags = YARD::DocstringParser.new.parse(tags).to_docstring.tags
|
43
46
|
m = YARD::Registry['Aws::S3::Object#upload_file']
|
@@ -1,8 +1,13 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
1
3
|
module Aws
|
2
4
|
module Resources
|
3
5
|
class Documenter
|
4
6
|
class BaseOperationDocumenter
|
5
7
|
|
8
|
+
include Api::Docs::Utils
|
9
|
+
include Seahorse::Model::Shapes
|
10
|
+
|
6
11
|
def initialize(yard_class, resource_class, operation_name, operation)
|
7
12
|
@yard_class = yard_class
|
8
13
|
@resource_class = resource_class
|
@@ -16,6 +21,8 @@ module Aws
|
|
16
21
|
@api_request_params = @operation.request.params
|
17
22
|
@request_operation_name = @operation.request.method_name.to_s
|
18
23
|
@called_operation = "Client##{@api_request_name}"
|
24
|
+
@yard_client_operation = YARD::Registry["#{@resource_class.client_class.name}##{api_request_name}"]
|
25
|
+
|
19
26
|
end
|
20
27
|
if @operation.respond_to?(:builder)
|
21
28
|
@builder = @operation.builder
|
@@ -125,30 +132,49 @@ module Aws
|
|
125
132
|
# to the method code object.
|
126
133
|
# @return [Array<YARD::Tag>]
|
127
134
|
def example_tags
|
128
|
-
|
135
|
+
if api_request && api_request.input
|
136
|
+
[request_syntax_example_tag]
|
137
|
+
else
|
138
|
+
[]
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
def request_syntax_example_tag
|
143
|
+
input = operation_input_ref(api_request, without: fixed_param_names)
|
144
|
+
params = Api::Docs::ParamFormatter.new(input).format
|
145
|
+
example = "#{variable_name}.#{operation_name}(#{params})"
|
146
|
+
example = "@example Request syntax example with placeholder values" +
|
147
|
+
"\n\n " + example.lines.join(' ')
|
148
|
+
tag(example)
|
129
149
|
end
|
130
150
|
|
131
151
|
def option_tags
|
132
152
|
if api_request && api_request.input
|
153
|
+
skip = fixed_param_names
|
133
154
|
tags = []
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
if api_request_params.any? { |p| p.target.match(/^#{member_name}\b/) }
|
139
|
-
next
|
155
|
+
@yard_client_operation.tags.each do |tag|
|
156
|
+
if YARD::Tags::OptionTag === tag
|
157
|
+
next if skip.include?(tag.pair.name[1..-1]) # remove `:` prefix
|
158
|
+
tags << tag
|
140
159
|
end
|
141
|
-
docstring = member_shape.documentation
|
142
|
-
req = ' **`required`** — ' if required.include?(member_name)
|
143
|
-
tags << "@option options [#{param_type(member_shape)}] :#{member_name} #{req}#{docstring}"
|
144
160
|
end
|
145
|
-
tags
|
146
|
-
YARD::DocstringParser.new.parse(tags).to_docstring.tags
|
161
|
+
tags
|
147
162
|
else
|
148
163
|
[]
|
149
164
|
end
|
150
165
|
end
|
151
166
|
|
167
|
+
# Returns a set of root input params that are provided by default
|
168
|
+
# by this operation. These params should not be documented in syntax
|
169
|
+
# examples or in option tags.
|
170
|
+
def fixed_param_names
|
171
|
+
if api_request_params
|
172
|
+
Set.new(api_request_params.map { |p| p.target.split(/\b/).first })
|
173
|
+
else
|
174
|
+
Set.new
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
152
178
|
# If this operation makes an API request, then a `@see` tag is
|
153
179
|
# returned that references the client API operation.
|
154
180
|
# @return [Array<YARD::Tag>]
|
@@ -178,26 +204,6 @@ module Aws
|
|
178
204
|
YARD::DocstringParser.new.parse(tags.sort.join("\n")).to_docstring.tags
|
179
205
|
end
|
180
206
|
|
181
|
-
def return_tag
|
182
|
-
if return_type == ['void'] && return_message.strip.empty?
|
183
|
-
nil
|
184
|
-
else
|
185
|
-
YARD::Tags::Tag.new(:return, return_message, return_type)
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
# The response object type for the @return tag. This must be overridden
|
190
|
-
# in sub-classes.
|
191
|
-
def return_type
|
192
|
-
raise NotImplementedError
|
193
|
-
end
|
194
|
-
|
195
|
-
# The message portion of the @return tag for this operation. This must
|
196
|
-
# be overridden in sub-classes.
|
197
|
-
def return_message
|
198
|
-
raise NotImplementedError
|
199
|
-
end
|
200
|
-
|
201
207
|
# Returns a suitable variable name for the resource class being
|
202
208
|
# documented:
|
203
209
|
#
|
@@ -211,15 +217,15 @@ module Aws
|
|
211
217
|
|
212
218
|
def path_type
|
213
219
|
case path_shape
|
214
|
-
when
|
215
|
-
when
|
216
|
-
when
|
217
|
-
when
|
218
|
-
when
|
219
|
-
when
|
220
|
-
when
|
221
|
-
when
|
222
|
-
when
|
220
|
+
when StructureShape then 'Structure'
|
221
|
+
when ListShape then 'Array'
|
222
|
+
when MapShape then 'Hash'
|
223
|
+
when StringShape then 'String'
|
224
|
+
when IntegerShape then 'Integer'
|
225
|
+
when FloatShape then 'Float'
|
226
|
+
when BooleanShape then 'Boolean'
|
227
|
+
when TimestampShape then 'Time'
|
228
|
+
when BlobShape then 'IO'
|
223
229
|
else
|
224
230
|
raise "unhandled shape class `#{path_shape.class.name}'"
|
225
231
|
end
|
@@ -232,40 +238,41 @@ module Aws
|
|
232
238
|
# Returns the output shape for the called operation.
|
233
239
|
def response_shape
|
234
240
|
api = resource_class.client_class.api
|
235
|
-
api.operation(@operation.request.method_name).output
|
241
|
+
output = api.operation(@operation.request.method_name).output
|
242
|
+
output ? output.shape : nil
|
236
243
|
end
|
237
244
|
|
238
245
|
def resolve_shape(shape, path)
|
239
246
|
if path != '@'
|
240
247
|
shape = path.scan(/\w+|\[.*?\]/).inject(shape) do |shape, part|
|
241
248
|
if part[0] == '['
|
242
|
-
shape.member
|
249
|
+
shape.member.shape
|
243
250
|
else
|
244
|
-
shape.member(part)
|
251
|
+
shape.member(part).shape
|
245
252
|
end
|
246
253
|
end
|
247
254
|
end
|
248
255
|
end
|
249
256
|
|
250
|
-
def param_type(
|
251
|
-
case shape
|
252
|
-
when
|
253
|
-
when
|
254
|
-
when
|
255
|
-
when
|
256
|
-
when
|
257
|
-
when
|
258
|
-
when
|
259
|
-
when
|
260
|
-
when
|
261
|
-
when Seahorse::Model::Shapes::Map then 'Hash'
|
262
|
-
when Seahorse::Model::Shapes::String then 'String'
|
263
|
-
when Seahorse::Model::Shapes::Structure then 'Hash'
|
264
|
-
when Seahorse::Model::Shapes::Timestamp then 'Time'
|
257
|
+
def param_type(ref)
|
258
|
+
case ref.shape
|
259
|
+
when BlobShape then 'IO'
|
260
|
+
when BooleanShape then 'Boolean'
|
261
|
+
when FloatShape then 'Float'
|
262
|
+
when IntegerShape then 'Integer'
|
263
|
+
when ListShape then 'Array'
|
264
|
+
when MapShape then 'Hash'
|
265
|
+
when StringShape then 'String'
|
266
|
+
when StructureShape then 'Hash'
|
267
|
+
when TimestampShape then 'Time'
|
265
268
|
else raise 'unhandled type'
|
266
269
|
end
|
267
270
|
end
|
268
271
|
|
272
|
+
def docs(ref)
|
273
|
+
ref.documentation || ref.shape.documentation
|
274
|
+
end
|
275
|
+
|
269
276
|
end
|
270
277
|
end
|
271
278
|
end
|
@@ -3,44 +3,22 @@ module Aws
|
|
3
3
|
class Documenter
|
4
4
|
class DataOperationDocumenter < BaseOperationDocumenter
|
5
5
|
|
6
|
-
def
|
6
|
+
def return_type
|
7
7
|
if plural?
|
8
|
-
|
8
|
+
"Array<#{path_type}>"
|
9
9
|
else
|
10
|
-
|
10
|
+
path_type
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
"an array of {Structure structures} with the following members:\n" + data_members
|
17
|
-
elsif structure?
|
18
|
-
"a {Structure} with the following members:\n" + data_members
|
19
|
-
else
|
20
|
-
''
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def data_members
|
25
|
-
"\n" + path_shape.member_names.map{ |n| "\n* `#{n}`" }.join("\n")
|
26
|
-
end
|
27
|
-
|
28
|
-
def return_type
|
29
|
-
if plural?
|
30
|
-
["Array<#{path_type}>"]
|
31
|
-
else
|
32
|
-
[path_type]
|
33
|
-
end
|
14
|
+
def return_tag
|
15
|
+
tag("@return [#{return_type}]")
|
34
16
|
end
|
35
17
|
|
36
18
|
def plural?
|
37
19
|
!!@operation.path.match(/\[/)
|
38
20
|
end
|
39
21
|
|
40
|
-
def structure?
|
41
|
-
Seahorse::Model::Shapes::Structure === path_shape
|
42
|
-
end
|
43
|
-
|
44
22
|
end
|
45
23
|
end
|
46
24
|
end
|
@@ -8,50 +8,46 @@ module Aws
|
|
8
8
|
Returns a {Resources::Collection Collection} of {#{target_resource_class_name}}
|
9
9
|
resources. No API requests are made until you call an enumerable method on the
|
10
10
|
collection. {#{called_operation}} will be called multiple times until every
|
11
|
-
{#{target_resource_class_name}} has been yielded.
|
11
|
+
{#{target_resource_class_name}} has been yielded.
|
12
12
|
DOCSTRING
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
[
|
17
|
-
end
|
18
|
-
|
19
|
-
def return_message
|
20
|
-
"a {Aws::Resources::Collection Collection} of {#{target_resource_class_name}} resource objects."
|
15
|
+
def return_tag
|
16
|
+
tag("@return [Collection<#{target_resource_class_name}>]")
|
21
17
|
end
|
22
18
|
|
23
19
|
def example_tags
|
24
|
-
tags =
|
25
|
-
tags <<
|
26
|
-
tags <<
|
27
|
-
tags <<
|
28
|
-
|
20
|
+
tags = super
|
21
|
+
tags << enumerate_example_tag
|
22
|
+
tags << enumerate_with_limit_example_tag
|
23
|
+
tags << batch_examples_tag if target_resource_batches?
|
24
|
+
tags
|
29
25
|
end
|
30
26
|
|
31
|
-
def
|
32
|
-
|
27
|
+
def enumerate_example_tag
|
28
|
+
tag(<<-EXAMPLE.strip)
|
33
29
|
@example Enumerating {#{target_resource_class_name}} resources.
|
34
30
|
#{variable_name}.#{@operation_name}.each do |#{target_resource_class_name.downcase}|
|
35
31
|
# yields each #{target_resource_class_name.downcase}
|
36
32
|
end
|
37
|
-
EXAMPLE
|
33
|
+
EXAMPLE
|
38
34
|
end
|
39
35
|
|
40
|
-
def
|
41
|
-
|
36
|
+
def enumerate_with_limit_example_tag
|
37
|
+
tag(<<-EXAMPLE.strip)
|
42
38
|
@example Enumerating {#{target_resource_class_name}} resources with a limit.
|
43
39
|
#{variable_name}.#{@operation_name}.limit(10).each do |#{target_resource_class_name.downcase}|
|
44
40
|
# yields at most 10 #{@operation_name}
|
45
41
|
end
|
46
|
-
EXAMPLE
|
42
|
+
EXAMPLE
|
47
43
|
end
|
48
44
|
|
49
|
-
def
|
45
|
+
def batch_examples_tag
|
50
46
|
example = "@example Batch operations callable on the returned collection"
|
51
47
|
target_resource_batch_operations.each do |name|
|
52
48
|
example << "\n #{variable_name}.#{@operation_name}.#{name}"
|
53
49
|
end
|
54
|
-
example
|
50
|
+
tag(example)
|
55
51
|
end
|
56
52
|
|
57
53
|
def target_resource_batches?
|
@@ -3,51 +3,14 @@ module Aws
|
|
3
3
|
class Documenter
|
4
4
|
class HasOperationDocumenter < BaseOperationDocumenter
|
5
5
|
|
6
|
-
def
|
7
|
-
docs = []
|
8
|
-
docs << super
|
9
|
-
|
10
|
-
if can_return_nil?
|
11
|
-
docs << return_message
|
12
|
-
elsif argument?
|
13
|
-
msg = "Returns a {#{target_resource_class}} resource with "
|
14
|
-
msg << "the given `#{argument_name}`."
|
15
|
-
docs << msg
|
16
|
-
else
|
17
|
-
docs << "Returns a {#{target_resource_class}} resource."
|
18
|
-
end
|
19
|
-
|
20
|
-
if data_member && resource_class.load_operation
|
21
|
-
load_method = resource_class.load_operation.request.method_name
|
22
|
-
msg = "Calling this method will call {Client##{load_method}} "
|
23
|
-
msg << "unless the resource is already {#data_loaded? loaded}. "
|
24
|
-
msg << "No additional API requests are made."
|
25
|
-
docs << msg
|
26
|
-
else
|
27
|
-
msg = "Calling this method will **not** make an API request."
|
28
|
-
docs << msg
|
29
|
-
end
|
30
|
-
|
31
|
-
docs.join(' ')
|
32
|
-
end
|
33
|
-
|
34
|
-
def return_type
|
6
|
+
def return_tag
|
35
7
|
if plural?
|
36
|
-
type =
|
8
|
+
type = "Array<#{target_resource_class_name}>"
|
37
9
|
else
|
38
|
-
type =
|
39
|
-
end
|
40
|
-
type << 'nil' if can_return_nil?
|
41
|
-
type
|
42
|
-
end
|
43
|
-
|
44
|
-
def return_message
|
45
|
-
if can_return_nil?
|
46
|
-
"Returns a {#{target_resource_class_name}} resource, or `nil` " +
|
47
|
-
"if `#data.#{data_member_source}` is `nil`."
|
48
|
-
else
|
49
|
-
"Returns a {#{target_resource_class_name}} resource."
|
10
|
+
type = target_resource_class_name
|
50
11
|
end
|
12
|
+
type += ',nil' if can_return_nil?
|
13
|
+
tag("@return [#{type}]")
|
51
14
|
end
|
52
15
|
|
53
16
|
def parameters
|
@@ -85,10 +48,6 @@ module Aws
|
|
85
48
|
builder.sources.find { |s| BuilderSources::DataMember === s }
|
86
49
|
end
|
87
50
|
|
88
|
-
def data_member_source
|
89
|
-
data_member.source
|
90
|
-
end
|
91
|
-
|
92
51
|
def argument_name
|
93
52
|
argument = builder.sources.find do |source|
|
94
53
|
BuilderSources::Argument === source
|
@@ -4,37 +4,14 @@ module Aws
|
|
4
4
|
class OperationDocumenter < BaseOperationDocumenter
|
5
5
|
|
6
6
|
def docstring
|
7
|
-
|
7
|
+
@api_request.documentation
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
|
12
|
-
|
13
|
-
else
|
14
|
-
['void']
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def return_message
|
19
|
-
"#{return_base_message} #{returns_data_members}"
|
20
|
-
end
|
21
|
-
|
22
|
-
def return_base_message
|
23
|
-
if returns_data_members
|
24
|
-
"Calls {#{called_operation}}, returning its response."
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def returns_data_members
|
29
|
-
if response_shape && response_shape.member_names.count > 0
|
30
|
-
msg = "The response data has following properties:\n"
|
31
|
-
response_shape.member_names.each do |name|
|
32
|
-
msg << "\n* `#{name}`"
|
33
|
-
end
|
34
|
-
msg
|
35
|
-
else
|
36
|
-
nil
|
10
|
+
def return_tag
|
11
|
+
@yard_client_operation.tags.each do |tag|
|
12
|
+
return tag if tag.tag_name == 'return'
|
37
13
|
end
|
14
|
+
nil
|
38
15
|
end
|
39
16
|
|
40
17
|
end
|
@@ -8,47 +8,35 @@ module Aws
|
|
8
8
|
@plural = @operation.builder.plural?
|
9
9
|
end
|
10
10
|
|
11
|
-
# @return [Boolean] Returns `true` if this operation returns an
|
11
|
+
# @return [Boolean] Returns `true` if this operation returns an
|
12
12
|
# array of resource objects. Returns `false` if this method returns
|
13
13
|
# a single resource object.
|
14
14
|
attr_reader :plural
|
15
15
|
|
16
16
|
alias plural? plural
|
17
17
|
|
18
|
-
def
|
19
|
-
super + ' ' "#{return_message} Calls {#{called_operation}}."
|
20
|
-
end
|
21
|
-
|
22
|
-
def return_type
|
23
|
-
if plural?
|
24
|
-
["Array<#{target_resource_class_name}>"]
|
25
|
-
else
|
26
|
-
[target_resource_class_name]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def return_message
|
18
|
+
def return_tag
|
31
19
|
if plural?
|
32
|
-
"
|
20
|
+
tag("@return [Array<#{target_resource_class_name}>]")
|
33
21
|
else
|
34
|
-
"
|
22
|
+
tag("@return [#{target_resource_class_name}]")
|
35
23
|
end
|
36
24
|
end
|
37
25
|
|
38
26
|
def example_tags
|
39
27
|
id = target_resource_class.identifiers.last.to_s
|
40
28
|
idv = target_resource_class_name.downcase + '-' + id.gsub('_', '-')
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
example = []
|
30
|
+
example << "@example Basic usage"
|
31
|
+
example << " #{resp_variable} = #{variable_name}.#{operation_name}(options)"
|
44
32
|
if plural?
|
45
|
-
|
46
|
-
|
33
|
+
example << " #{resp_variable}.map(&:#{id})"
|
34
|
+
example << " #=> [#{idv.inspect}, ...]"
|
47
35
|
else
|
48
|
-
|
49
|
-
|
36
|
+
example << " #{resp_variable}.#{id}"
|
37
|
+
example << " #=> #{idv.inspect}"
|
50
38
|
end
|
51
|
-
|
39
|
+
super + [tag(example.join("\n"))]
|
52
40
|
end
|
53
41
|
|
54
42
|
def resp_variable
|
@@ -23,8 +23,8 @@ You can modify defaults and register callbacks by passing a block argument.
|
|
23
23
|
DOCSTRING
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
27
|
-
[resource_class_name]
|
26
|
+
def return_tag
|
27
|
+
tag("@return [#{resource_class_name}] #{return_message}")
|
28
28
|
end
|
29
29
|
|
30
30
|
def return_message
|
@@ -47,10 +47,6 @@ You can modify defaults and register callbacks by passing a block argument.
|
|
47
47
|
@resource_class.client_class.api.operation(api_request_name)
|
48
48
|
end
|
49
49
|
|
50
|
-
def api_request_params
|
51
|
-
@operation.params
|
52
|
-
end
|
53
|
-
|
54
50
|
def api_request_name
|
55
51
|
waiter.poller.operation_name
|
56
52
|
end
|
@@ -60,7 +56,7 @@ You can modify defaults and register callbacks by passing a block argument.
|
|
60
56
|
end
|
61
57
|
|
62
58
|
def example_tags
|
63
|
-
|
59
|
+
example = <<-EXAMPLE.strip
|
64
60
|
@example Basic usage
|
65
61
|
#{variable_name}.#{operation_name}
|
66
62
|
|
@@ -72,7 +68,7 @@ You can modify defaults and register callbacks by passing a block argument.
|
|
72
68
|
w.before_wait do { |count, prev_resp| ... }
|
73
69
|
end
|
74
70
|
EXAMPLE
|
75
|
-
|
71
|
+
super + [tag(example)]
|
76
72
|
end
|
77
73
|
|
78
74
|
end
|
@@ -80,14 +80,14 @@ module Aws
|
|
80
80
|
# @keys = keys
|
81
81
|
# @encryption_materials = Aws::S3::Encryption::Materials.new(
|
82
82
|
# key: @keys[default_key_name],
|
83
|
-
# description:
|
83
|
+
# description: JSON.dump(key: default_key_name),
|
84
84
|
# )
|
85
85
|
# end
|
86
86
|
#
|
87
87
|
# attr_reader :encryption_materials
|
88
88
|
#
|
89
89
|
# def key_for(matdesc)
|
90
|
-
# key_name =
|
90
|
+
# key_name = JSON.load(matdesc)['key']
|
91
91
|
# if key = @keys[key_name]
|
92
92
|
# key
|
93
93
|
# else
|
@@ -159,7 +159,7 @@ module Aws
|
|
159
159
|
# * `:key_provider`
|
160
160
|
# * `:encryption_key`
|
161
161
|
#
|
162
|
-
# You may also pass any other options accepted by {S3::Client
|
162
|
+
# You may also pass any other options accepted by {S3::Client#initialize}.
|
163
163
|
#
|
164
164
|
# @option options [S3::Client] :client A basic S3 client that is used
|
165
165
|
# to make api calls. If a `:client` is not provided, a new {S3::Client}
|
@@ -66,11 +66,11 @@ module Aws
|
|
66
66
|
|
67
67
|
def envelope_from_instr_file(context)
|
68
68
|
suffix = context[:encryption][:instruction_file_suffix]
|
69
|
-
|
69
|
+
Json.load(context.client.get_object(
|
70
70
|
bucket: context.params[:bucket],
|
71
71
|
key: context.params[:key] + suffix
|
72
72
|
).body.read)
|
73
|
-
rescue S3::Errors::ServiceError,
|
73
|
+
rescue S3::Errors::ServiceError, Json::ParseError
|
74
74
|
nil
|
75
75
|
end
|
76
76
|
|
@@ -45,9 +45,9 @@ module Aws
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def validate_desc(description)
|
48
|
-
|
48
|
+
Json.load(description)
|
49
49
|
description
|
50
|
-
rescue
|
50
|
+
rescue Json::ParseError
|
51
51
|
msg = "expected description to be a valid JSON document string"
|
52
52
|
raise ArgumentError, msg
|
53
53
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'openssl'
|
2
2
|
require 'base64'
|
3
|
-
require 'multi_json'
|
4
3
|
|
5
4
|
module Aws
|
6
5
|
module S3
|
@@ -210,7 +209,7 @@ module Aws
|
|
210
209
|
# @option options [String] :server_side_encryption_customer_algorithm See {PresignedPost#server_side_encryption_customer_algorithm}.
|
211
210
|
# @option options [String] :server_side_encryption_customer_key See {PresignedPost#server_side_encryption_customer_key}.
|
212
211
|
def initialize(credentials, bucket_region, bucket_name, options = {})
|
213
|
-
@credentials = credentials
|
212
|
+
@credentials = credentials.credentials
|
214
213
|
@bucket_region = bucket_region
|
215
214
|
@bucket_name = bucket_name
|
216
215
|
@url = bucket_url
|
@@ -597,7 +596,7 @@ module Aws
|
|
597
596
|
signature_fields(datetime).each do |name, value|
|
598
597
|
policy['conditions'] << { name => value }
|
599
598
|
end
|
600
|
-
base64(
|
599
|
+
base64(Json.dump(policy))
|
601
600
|
end
|
602
601
|
|
603
602
|
def signature_fields(datetime)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'openssl'
|
3
3
|
require 'base64'
|
4
|
-
require 'multi_json'
|
5
4
|
|
6
5
|
module Aws
|
7
6
|
module SNS
|
@@ -59,7 +58,7 @@ module Aws
|
|
59
58
|
# @raise [VerificationError] Raised when the given message has failed
|
60
59
|
# verification.
|
61
60
|
def authenticate!(message_body)
|
62
|
-
msg =
|
61
|
+
msg = Json.load(message_body)
|
63
62
|
if public_key(msg).verify(sha1, signature(msg), canonical_string(msg))
|
64
63
|
true
|
65
64
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0
|
19
|
+
version: 2.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0
|
26
|
+
version: 2.1.0
|
27
27
|
description: Provides resource oriented interfaces and other higher-level abstractions
|
28
28
|
for many AWS services. This gem is part of the official AWS SDK for Ruby.
|
29
29
|
email:
|