aws-sdk-core 2.0.22 → 2.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d0128d2d6580daf0b63017f7d0a98fabfb17bc2
4
- data.tar.gz: 4991ead5885cf003f9e1b3970f41406d8b1bd95a
3
+ metadata.gz: dc32a01f8117fda9f7ffeea82754555a11c38b3a
4
+ data.tar.gz: 8bc2496e3ae3bfdc8a8869142a8460d3f18541f7
5
5
  SHA512:
6
- metadata.gz: aaddabd3242cce641127251081de9d8e1488cdd4e5c4f506610d09f0da7d372368a76e879c9e0f939a82220cb19452154c8c1eae48782693cbe1adb973330c72
7
- data.tar.gz: ea0362d3dbedde1aaf61dea2c387076783efe98fa3c3535ceb1f2a73d67af6be7120363b96b67a0b1a9e2744bbd82859dc85ebe4ede21df9093baac1a474e21e
6
+ metadata.gz: 43702de1c64c7a6c2a0a0f4d90ac9ec15eb512c513188fe82b691e3b82422130a0266f89b4fcec666cd5ce2dca9d22f821d91153d7f7b7787a271e09e3fcf20f
7
+ data.tar.gz: f8a778781fad39bfdbff05f625b95489b0fe37e4726b2bb7a622eac848c5d7f9475bb4edd4c142c9bff41a55b93f84cd84ea3f0ecbc9c21b9cd5dd00a3c40630
@@ -94,7 +94,7 @@
94
94
  "type": "StackResource",
95
95
  "identifiers": [
96
96
  { "target": "StackName", "source": "identifier", "name": "Name" },
97
- { "target": "StackName", "source": "input" }
97
+ { "target": "LogicalId", "source": "input" }
98
98
  ]
99
99
  }
100
100
  }
@@ -135,8 +135,8 @@
135
135
  },
136
136
  "StackResource": {
137
137
  "identifiers": [
138
- { "name": "LogicalId" },
139
- { "name": "StackName" }
138
+ { "name": "StackName" },
139
+ { "name": "LogicalId" }
140
140
  ],
141
141
  "shape": "StackResourceDetail",
142
142
  "load": {
@@ -162,8 +162,8 @@
162
162
  },
163
163
  "StackResourceSummary": {
164
164
  "identifiers": [
165
- { "name": "LogicalId" },
166
- { "name": "StackName" }
165
+ { "name": "StackName" },
166
+ { "name": "LogicalId" }
167
167
  ],
168
168
  "shape": "StackResourceSummary",
169
169
  "has": {
@@ -1127,6 +1127,7 @@
1127
1127
  "required":["TableName"],
1128
1128
  "members":{
1129
1129
  "TableName":{"shape":"TableName"},
1130
+ "IndexName":{"shape":"IndexName"},
1130
1131
  "AttributesToGet":{"shape":"AttributeNameList"},
1131
1132
  "Limit":{"shape":"PositiveIntegerObject"},
1132
1133
  "Select":{"shape":"Select"},
@@ -71,7 +71,7 @@ module Aws
71
71
  # Yields the current and each following response to the given block.
72
72
  # @yieldparam [Response] response
73
73
  # @return [Enumerable,nil] Returns a new Enumerable if no block is given.
74
- def each_page(&block)
74
+ def each(&block)
75
75
  return enum_for(:each_page) unless block_given?
76
76
  response = self
77
77
  yield(response)
@@ -80,7 +80,7 @@ module Aws
80
80
  yield(response)
81
81
  end
82
82
  end
83
- alias each each_page
83
+ alias each_page each
84
84
 
85
85
  # @api private
86
86
  def count
@@ -69,10 +69,10 @@ module Aws
69
69
 
70
70
  def stub_http_body(resp)
71
71
  payload = resp.context.operation.output.payload
72
- body = resp.context.http_response.body
73
- body.write(resp.data[payload])
74
- body.rewind if body.respond_to?(:rewind)
75
- resp.data[payload] = body
72
+ resp.context.http_response.signal_headers(200, {})
73
+ resp.context.http_response.signal_data(resp.data[payload])
74
+ resp.context.http_response.signal_done
75
+ resp.data[payload] = resp.context.http_response.body
76
76
  end
77
77
 
78
78
  end
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.0.22'
2
+ VERSION = '2.0.23'
3
3
  end
@@ -88,11 +88,10 @@ module Aws
88
88
  def wait(options)
89
89
  catch(:success) do
90
90
  failure_msg = catch(:failure) do
91
- poll(options)
92
- return true
91
+ return poll(options)
93
92
  end
94
93
  raise Errors::WaiterFailed.new(failure_msg || 'waiter failed')
95
- end
94
+ end || true
96
95
  end
97
96
 
98
97
  private
data/lib/seahorse.rb CHANGED
@@ -48,6 +48,7 @@ module Seahorse
48
48
  autoload :ParamConversion, 'seahorse/client/plugins/param_conversion'
49
49
  autoload :ParamValidation, 'seahorse/client/plugins/param_validation'
50
50
  autoload :RaiseResponseErrors, 'seahorse/client/plugins/raise_response_errors'
51
+ autoload :ResponseTarget, 'seahorse/client/plugins/response_target'
51
52
  autoload :RestfulBindings, 'seahorse/client/plugins/restful_bindings'
52
53
  end
53
54
 
@@ -13,6 +13,7 @@ module Seahorse
13
13
  Plugins::ParamConversion,
14
14
  Plugins::ParamValidation,
15
15
  Plugins::RaiseResponseErrors,
16
+ Plugins::ResponseTarget,
16
17
  ])
17
18
 
18
19
  # @api private
@@ -0,0 +1,58 @@
1
+ module Seahorse
2
+ module Client
3
+ module Plugins
4
+ # @api private
5
+ class ResponseTarget < Plugin
6
+
7
+ # This handler is responsible for replacing the HTTP response body IO
8
+ # object with custom targets, such as a block, or a file. It is important
9
+ # to not write data to the custom target in the case of a non-success
10
+ # response. We do not want to write an XML error message to someone's
11
+ # file.
12
+ class Handler < Client::Handler
13
+
14
+ def call(context)
15
+ target = context.params.delete(:response_target)
16
+ target ||= context[:response_target]
17
+ add_event_listeners(context, target) if target
18
+ @handler.call(context)
19
+ end
20
+
21
+ private
22
+
23
+ def add_event_listeners(context, target)
24
+ handler = self
25
+ context.http_response.on_headers(200) do
26
+ context.http_response.body = handler.send(:io, target)
27
+ end
28
+
29
+ context.http_response.on_success(200) do
30
+ body = context.http_response.body
31
+ if ManagedFile === body && body.open?
32
+ body.close
33
+ end
34
+ end
35
+
36
+ context.http_response.on_error do
37
+ body = context.http_response.body
38
+ File.unlink(body) if ManagedFile === body
39
+ context.http_response.body = StringIO.new
40
+ end
41
+ end
42
+
43
+ def io(target)
44
+ case target
45
+ when Proc then BlockIO.new(&target)
46
+ when String, Pathname then ManagedFile.new(target, 'w+b')
47
+ else target
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+ handler(Handler, step: :initialize, priority: 90)
54
+
55
+ end
56
+ end
57
+ end
58
+ end
@@ -66,35 +66,8 @@ module Seahorse
66
66
  # @return [Response]
67
67
  #
68
68
  def send_request(options = {}, &block)
69
- set_response_target(options, &block)
69
+ @context[:response_target] = options[:target] || block
70
70
  @handlers.to_stack.call(@context)
71
- ensure
72
- close_managed_files
73
- end
74
-
75
- private
76
-
77
- def set_response_target(options, &block)
78
- target = options[:target]
79
- target ||= block
80
- target ||= context.params.delete(:response_target)
81
- if target
82
- @context.http_response.body =
83
- case target
84
- when Proc then BlockIO.new(&target)
85
- when String, Pathname then ManagedFile.new(target, 'w+b')
86
- else target
87
- end
88
- end
89
- end
90
-
91
- def close_managed_files
92
- [
93
- @context.http_request.body,
94
- @context.http_response.body,
95
- ].each do |io|
96
- io.close if io.is_a?(ManagedFile) && io.open?
97
- end
98
71
  end
99
72
 
100
73
  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.0.22
4
+ version: 2.0.23
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-02-05 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -341,6 +341,7 @@ files:
341
341
  - lib/seahorse/client/plugins/param_conversion.rb
342
342
  - lib/seahorse/client/plugins/param_validation.rb
343
343
  - lib/seahorse/client/plugins/raise_response_errors.rb
344
+ - lib/seahorse/client/plugins/response_target.rb
344
345
  - lib/seahorse/client/plugins/restful_bindings.rb
345
346
  - lib/seahorse/client/request.rb
346
347
  - lib/seahorse/client/request_context.rb