aws-sdk-core 2.2.10 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ {
2
+ "version":"1.0",
3
+ "examples":{
4
+ }
5
+ }
@@ -28,6 +28,7 @@ module Aws
28
28
  CloudSearchDomain
29
29
  CloudTrail
30
30
  CloudWatch
31
+ CloudWatchEvents
31
32
  CloudWatchLogs
32
33
  CodeCommit
33
34
  CodeDeploy
@@ -1,7 +1,7 @@
1
1
  Aws.add_service(:CloudFront, {
2
- api: "#{Aws::API_DIR}/cloudfront/2015-09-17/api-2.json",
3
- docs: "#{Aws::API_DIR}/cloudfront/2015-09-17/docs-2.json",
4
- examples: "#{Aws::API_DIR}/cloudfront/2015-09-17/examples-1.json",
5
- paginators: "#{Aws::API_DIR}/cloudfront/2015-09-17/paginators-1.json",
6
- waiters: "#{Aws::API_DIR}/cloudfront/2015-09-17/waiters-2.json",
2
+ api: "#{Aws::API_DIR}/cloudfront/2016-01-13/api-2.json",
3
+ docs: "#{Aws::API_DIR}/cloudfront/2016-01-13/docs-2.json",
4
+ examples: "#{Aws::API_DIR}/cloudfront/2016-01-13/examples-1.json",
5
+ paginators: "#{Aws::API_DIR}/cloudfront/2016-01-13/paginators-1.json",
6
+ waiters: "#{Aws::API_DIR}/cloudfront/2016-01-13/waiters-2.json",
7
7
  })
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:CloudWatchEvents, {
2
+ api: "#{Aws::API_DIR}/events/2014-02-03/api-2.json",
3
+ docs: "#{Aws::API_DIR}/events/2014-02-03/docs-2.json",
4
+ examples: "#{Aws::API_DIR}/events/2014-02-03/examples-1.json",
5
+ })
@@ -11,8 +11,11 @@ module Aws
11
11
 
12
12
  def parse_xml(context)
13
13
  if rules = context.operation.output
14
- data = Xml::Parser.new(rules).parse(xml(context)) do |h|
15
- context.metadata[:request_id] = h['requestId']
14
+ parser = Xml::Parser.new(rules)
15
+ data = parser.parse(xml(context)) do |path, value|
16
+ if path.size == 2 && path.last == 'requestId'
17
+ context.metadata[:request_id] = value
18
+ end
16
19
  end
17
20
  data
18
21
  else
@@ -101,11 +101,6 @@ module Aws
101
101
  list
102
102
  end
103
103
 
104
- def querystring_param(key, value)
105
- param_name = member.location_name
106
- param_value = params[member_name]
107
- end
108
-
109
104
  def escape(string)
110
105
  Seahorse::Util.uri_escape(string)
111
106
  end
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.2.10'
2
+ VERSION = '2.2.11'
3
3
  end
@@ -20,12 +20,27 @@ module Aws
20
20
  @engine = options[:engine] || self.class.engine
21
21
  end
22
22
 
23
+ # Parses the XML document, returning a parsed structure.
24
+ #
25
+ # If you pass a block, this will yield for XML
26
+ # elements that are not modeled in the rules given
27
+ # to the constructor.
28
+ #
29
+ # parser.parse(xml) do |path, value|
30
+ # puts "uhandled: #{path.join('/')} - #{value}"
31
+ # end
32
+ #
33
+ # The purpose of the unhandled callback block is to
34
+ # allow callers to access values such as the EC2
35
+ # request ID that are part of the XML body but not
36
+ # part of the operation result.
37
+ #
23
38
  # @param [String] xml An XML document string to parse.
24
39
  # @param [Structure] target (nil)
25
40
  # @return [Structure]
26
- def parse(xml, target = nil)
41
+ def parse(xml, target = nil, &unhandled_callback)
27
42
  xml = '<xml/>' if xml.nil? or xml.empty?
28
- stack = Stack.new(@rules, target)
43
+ stack = Stack.new(@rules, target, &unhandled_callback)
29
44
  @engine.new(stack).parse(xml.to_s)
30
45
  stack.result
31
46
  end
@@ -10,10 +10,10 @@ module Aws
10
10
 
11
11
  class << self
12
12
 
13
- def new(parent, ref, result = nil)
13
+ def new(path, parent, ref, result = nil)
14
14
  if self == Frame
15
15
  frame = frame_class(ref).allocate
16
- frame.send(:initialize, parent, ref, result)
16
+ frame.send(:initialize, path, parent, ref, result)
17
17
  frame
18
18
  else
19
19
  super
@@ -35,7 +35,8 @@ module Aws
35
35
 
36
36
  end
37
37
 
38
- def initialize(parent, ref, result = nil)
38
+ def initialize(path, parent, ref, result)
39
+ @path = path
39
40
  @parent = parent
40
41
  @ref = ref
41
42
  @result = result
@@ -53,16 +54,30 @@ module Aws
53
54
  end
54
55
 
55
56
  def child_frame(xml_name)
56
- NullFrame.new(self)
57
+ NullFrame.new(xml_name, self)
57
58
  end
58
59
 
59
60
  def consume_child_frame(child); end
60
61
 
62
+ # @api private
63
+ def path
64
+ if Stack === parent
65
+ [@path]
66
+ else
67
+ parent.path + [@path]
68
+ end
69
+ end
70
+
71
+ # @api private
72
+ def yield_unhandled_value(path, value)
73
+ parent.yield_unhandled_value(path, value)
74
+ end
75
+
61
76
  end
62
77
 
63
78
  class StructureFrame < Frame
64
79
 
65
- def initialize(parent, ref, result = nil)
80
+ def initialize(xml_name, parent, ref, result = nil)
66
81
  super
67
82
  @result ||= ref[:struct_class].new
68
83
  @members = {}
@@ -77,9 +92,9 @@ module Aws
77
92
 
78
93
  def child_frame(xml_name)
79
94
  if @member = @members[xml_name]
80
- Frame.new(self, @member[:ref])
95
+ Frame.new(xml_name, self, @member[:ref])
81
96
  else
82
- NullFrame.new(self)
97
+ NullFrame.new(xml_name, self)
83
98
  end
84
99
  end
85
100
 
@@ -128,7 +143,7 @@ module Aws
128
143
 
129
144
  def child_frame(xml_name)
130
145
  if xml_name == @member_xml_name
131
- Frame.new(self, @ref.shape.member)
146
+ Frame.new(xml_name, self, @ref.shape.member)
132
147
  else
133
148
  raise NotImplementedError
134
149
  end
@@ -142,9 +157,9 @@ module Aws
142
157
 
143
158
  class FlatListFrame < Frame
144
159
 
145
- def initialize(*args)
160
+ def initialize(xml_name, *args)
146
161
  super
147
- @member = Frame.new(self, @ref.shape.member)
162
+ @member = Frame.new(xml_name, self, @ref.shape.member)
148
163
  end
149
164
 
150
165
  def result
@@ -174,7 +189,7 @@ module Aws
174
189
 
175
190
  def child_frame(xml_name)
176
191
  if xml_name == 'entry'
177
- MapEntryFrame.new(self, @ref)
192
+ MapEntryFrame.new(xml_name, self, @ref)
178
193
  else
179
194
  raise NotImplementedError
180
195
  end
@@ -188,12 +203,12 @@ module Aws
188
203
 
189
204
  class MapEntryFrame < Frame
190
205
 
191
- def initialize(*args)
206
+ def initialize(xml_name, *args)
192
207
  super
193
208
  @key_name = @ref.shape.key.location_name || 'key'
194
- @key = Frame.new(self, @ref.shape.key)
209
+ @key = Frame.new(xml_name, self, @ref.shape.key)
195
210
  @value_name = @ref.shape.value.location_name || 'value'
196
- @value = Frame.new(self, @ref.shape.value)
211
+ @value = Frame.new(xml_name, self, @ref.shape.value)
197
212
  end
198
213
 
199
214
  # @return [StringFrame]
@@ -208,15 +223,20 @@ module Aws
208
223
  elsif @value_name == xml_name
209
224
  @value
210
225
  else
211
- NullFrame.new(self)
226
+ NullFrame.new(xml_name, self)
212
227
  end
213
228
  end
214
229
 
215
230
  end
216
231
 
217
232
  class NullFrame < Frame
218
- def self.new(parent)
219
- super(parent, nil)
233
+ def self.new(xml_name, parent)
234
+ super(xml_name, parent, nil, nil)
235
+ end
236
+
237
+ def set_text(value)
238
+ yield_unhandled_value(path, value)
239
+ super
220
240
  end
221
241
  end
222
242
 
@@ -3,10 +3,11 @@ module Aws
3
3
  class Parser
4
4
  class Stack
5
5
 
6
- def initialize(ref, result = nil)
6
+ def initialize(ref, result = nil, &unhandled_callback)
7
7
  @ref = ref
8
8
  @frame = self
9
9
  @result = result
10
+ @unhandled_callback = unhandled_callback
10
11
  end
11
12
 
12
13
  attr_reader :frame
@@ -19,7 +20,7 @@ module Aws
19
20
 
20
21
  def attr(name, value)
21
22
  if name.to_s == 'encoding' && value.to_s == 'base64'
22
- @frame = BlobFrame.new(@frame.parent, @frame.ref)
23
+ @frame = BlobFrame.new(name, @frame.parent, @frame.ref)
23
24
  else
24
25
  start_element(name)
25
26
  text(value)
@@ -45,13 +46,20 @@ module Aws
45
46
  end
46
47
 
47
48
  def child_frame(name)
48
- Frame.new(self, @ref, @result)
49
+ Frame.new(name, self, @ref, @result)
49
50
  end
50
51
 
51
52
  def consume_child_frame(frame)
52
53
  @result = frame.result
53
54
  end
54
55
 
56
+ # @api private
57
+ def yield_unhandled_value(path, value)
58
+ if @unhandled_callback
59
+ @unhandled_callback.call(path, value)
60
+ end
61
+ end
62
+
55
63
  end
56
64
  end
57
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.10
4
+ version: 2.2.11
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: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -42,10 +42,10 @@ files:
42
42
  - apis/cloudformation/2010-05-15/paginators-1.json
43
43
  - apis/cloudformation/2010-05-15/resources-1.json
44
44
  - apis/cloudformation/2010-05-15/waiters-2.json
45
- - apis/cloudfront/2015-09-17/api-2.json
46
- - apis/cloudfront/2015-09-17/examples-1.json
47
- - apis/cloudfront/2015-09-17/paginators-1.json
48
- - apis/cloudfront/2015-09-17/waiters-2.json
45
+ - apis/cloudfront/2016-01-13/api-2.json
46
+ - apis/cloudfront/2016-01-13/examples-1.json
47
+ - apis/cloudfront/2016-01-13/paginators-1.json
48
+ - apis/cloudfront/2016-01-13/waiters-2.json
49
49
  - apis/cloudhsm/2014-05-30/api-2.json
50
50
  - apis/cloudsearch/2013-01-01/api-2.json
51
51
  - apis/cloudsearch/2013-01-01/paginators-1.json
@@ -109,6 +109,8 @@ files:
109
109
  - apis/email/2010-12-01/paginators-1.json
110
110
  - apis/email/2010-12-01/waiters-2.json
111
111
  - apis/es/2015-01-01/api-2.json
112
+ - apis/events/2014-02-03/api-2.json
113
+ - apis/events/2014-02-03/examples-1.json
112
114
  - apis/firehose/2015-08-04/api-2.json
113
115
  - apis/glacier/2012-06-01/api-2.json
114
116
  - apis/glacier/2012-06-01/paginators-1.json
@@ -214,6 +216,7 @@ files:
214
216
  - lib/aws-sdk-core/cloudsearchdomain.rb
215
217
  - lib/aws-sdk-core/cloudtrail.rb
216
218
  - lib/aws-sdk-core/cloudwatch.rb
219
+ - lib/aws-sdk-core/cloudwatchevents.rb
217
220
  - lib/aws-sdk-core/cloudwatchlogs.rb
218
221
  - lib/aws-sdk-core/codecommit.rb
219
222
  - lib/aws-sdk-core/codedeploy.rb