aws-sdk 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aws/api_config/AutoScaling-2011-01-01.yml +1 -0
- data/lib/aws/api_config/CloudFormation-2010-05-15.yml +1 -0
- data/lib/aws/api_config/CloudFront-2012-05-05.yml +2137 -0
- data/lib/aws/api_config/CloudWatch-2010-08-01.yml +9 -0
- data/lib/aws/api_config/DynamoDB-2011-12-05.yml +616 -0
- data/lib/aws/api_config/EC2-2012-07-20.yml +1 -0
- data/lib/aws/api_config/ELB-2012-06-01.yml +1 -0
- data/lib/aws/api_config/EMR-2009-03-31.yml +1 -0
- data/lib/aws/api_config/IAM-2010-05-08.yml +1 -0
- data/lib/aws/api_config/Route53-2012-02-29.yml +350 -349
- data/lib/aws/api_config/SNS-2010-03-31.yml +1 -0
- data/lib/aws/api_config/SQS-2011-10-01.yml +1 -0
- data/lib/aws/api_config/STS-2011-06-15.yml +1 -0
- data/lib/aws/api_config/SimpleDB-2009-04-15.yml +1 -0
- data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +62 -0
- data/lib/aws/api_config/SimpleWorkflow-2012-01-25.yml +1637 -0
- data/lib/aws/auto_scaling/client.rb +2 -37
- data/lib/aws/cloud_formation/client.rb +2 -17
- data/lib/aws/cloud_watch/client.rb +2 -15
- data/lib/aws/core.rb +24 -4
- data/lib/aws/core/client.rb +115 -46
- data/lib/aws/core/configuration.rb +6 -0
- data/lib/aws/core/credential_providers.rb +1 -0
- data/lib/aws/core/http/curb_handler.rb +3 -3
- data/lib/aws/core/http/httparty_handler.rb +15 -15
- data/lib/aws/core/json_client.rb +19 -77
- data/lib/aws/core/json_error_parser.rb +25 -0
- data/lib/aws/core/json_request_builder.rb +34 -0
- data/lib/aws/core/json_response_parser.rb +81 -0
- data/lib/aws/core/log_formatter.rb +25 -25
- data/lib/aws/core/option_grammar.rb +123 -115
- data/lib/aws/core/options/xml_serializer.rb +13 -9
- data/lib/aws/core/query_client.rb +13 -104
- data/lib/aws/core/query_error_parser.rb +24 -0
- data/lib/aws/core/query_request_builder.rb +47 -0
- data/lib/aws/core/query_response_parser.rb +35 -0
- data/lib/aws/core/rest_client.rb +13 -62
- data/lib/aws/core/rest_error_parser.rb +24 -0
- data/lib/aws/core/rest_request_builder.rb +124 -0
- data/lib/aws/core/rest_response_parser.rb +48 -0
- data/lib/aws/core/xml/parser.rb +2 -2
- data/lib/aws/core/xml/root_frame.rb +1 -1
- data/lib/aws/dynamo_db.rb +10 -9
- data/lib/aws/dynamo_db/binary.rb +35 -0
- data/lib/aws/dynamo_db/client.rb +103 -20
- data/lib/aws/dynamo_db/config.rb +2 -0
- data/lib/aws/dynamo_db/item.rb +3 -0
- data/lib/aws/dynamo_db/primary_key_element.rb +2 -1
- data/lib/aws/dynamo_db/table.rb +32 -36
- data/lib/aws/dynamo_db/table_collection.rb +13 -13
- data/lib/aws/dynamo_db/types.rb +34 -9
- data/lib/aws/ec2/client.rb +884 -344
- data/lib/aws/ec2/filtered_collection.rb +2 -3
- data/lib/aws/elb/client.rb +59 -45
- data/lib/aws/emr/client.rb +2 -11
- data/lib/aws/iam/client.rb +9 -80
- data/lib/aws/record/hash_model/attributes.rb +28 -13
- data/lib/aws/route_53/client.rb +6 -16
- data/lib/aws/s3/client.rb +2 -1
- data/lib/aws/s3/encryption_utils.rb +2 -7
- data/lib/aws/s3/s3_object.rb +5 -0
- data/lib/aws/simple_db/client.rb +2 -14
- data/lib/aws/simple_email_service/client.rb +35 -19
- data/lib/aws/simple_email_service/identity.rb +49 -10
- data/lib/aws/simple_email_service/identity_collection.rb +4 -4
- data/lib/aws/simple_workflow/client.rb +2 -38
- data/lib/aws/sns/client.rb +2 -19
- data/lib/aws/sqs/client.rb +2 -19
- data/lib/aws/sqs/errors.rb +5 -5
- data/lib/aws/sts/client.rb +2 -6
- metadata +14 -5
- data/lib/aws/core/rest_client/input_handler.rb +0 -145
- data/lib/aws/core/rest_client/output_handler.rb +0 -53
data/lib/aws/sqs/client.rb
CHANGED
@@ -15,11 +15,9 @@ module AWS
|
|
15
15
|
class SQS
|
16
16
|
|
17
17
|
# Client class for Amazon Simple Queue Service (SQS).
|
18
|
-
class Client < Core::
|
18
|
+
class Client < Core::QueryClient
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
extend Core::QueryClient
|
20
|
+
define_client_methods('2011-10-01')
|
23
21
|
|
24
22
|
# @private
|
25
23
|
CACHEABLE_REQUESTS = Set[]
|
@@ -42,7 +40,6 @@ module AWS
|
|
42
40
|
# * +:actions+ - *required* - (Array<String>) The action the client
|
43
41
|
# wants to allow for the specified principal.
|
44
42
|
# @return [Core::Response]
|
45
|
-
define_client_method :add_permission, 'AddPermission'
|
46
43
|
|
47
44
|
# Calls the ChangeMessageVisibility API operation.
|
48
45
|
# @method change_message_visibility(options = {})
|
@@ -55,7 +52,6 @@ module AWS
|
|
55
52
|
# * +:visibility_timeout+ - *required* - (Integer) The new value (in
|
56
53
|
# seconds) for the message's visibility timeout.
|
57
54
|
# @return [Core::Response]
|
58
|
-
define_client_method :change_message_visibility, 'ChangeMessageVisibility'
|
59
55
|
|
60
56
|
# Calls the ChangeMessageVisibilityBatch API operation.
|
61
57
|
# @method change_message_visibility_batch(options = {})
|
@@ -80,7 +76,6 @@ module AWS
|
|
80
76
|
# * +:sender_fault+ - (Boolean)
|
81
77
|
# * +:code+ - (String)
|
82
78
|
# * +:message+ - (String)
|
83
|
-
define_client_method :change_message_visibility_batch, 'ChangeMessageVisibilityBatch'
|
84
79
|
|
85
80
|
# Calls the CreateQueue API operation.
|
86
81
|
# @method create_queue(options = {})
|
@@ -93,7 +88,6 @@ module AWS
|
|
93
88
|
# The #data method of the response object returns
|
94
89
|
# a hash with the following structure:
|
95
90
|
# * +:queue_url+ - (String)
|
96
|
-
define_client_method :create_queue, 'CreateQueue'
|
97
91
|
|
98
92
|
# Calls the DeleteMessage API operation.
|
99
93
|
# @method delete_message(options = {})
|
@@ -103,7 +97,6 @@ module AWS
|
|
103
97
|
# * +:receipt_handle+ - *required* - (String) The receipt handle
|
104
98
|
# associated with the message to delete.
|
105
99
|
# @return [Core::Response]
|
106
|
-
define_client_method :delete_message, 'DeleteMessage'
|
107
100
|
|
108
101
|
# Calls the DeleteMessageBatch API operation.
|
109
102
|
# @method delete_message_batch(options = {})
|
@@ -126,7 +119,6 @@ module AWS
|
|
126
119
|
# * +:sender_fault+ - (Boolean)
|
127
120
|
# * +:code+ - (String)
|
128
121
|
# * +:message+ - (String)
|
129
|
-
define_client_method :delete_message_batch, 'DeleteMessageBatch'
|
130
122
|
|
131
123
|
# Calls the DeleteQueue API operation.
|
132
124
|
# @method delete_queue(options = {})
|
@@ -134,7 +126,6 @@ module AWS
|
|
134
126
|
# * +:queue_url+ - *required* - (String) The URL of the SQS queue to
|
135
127
|
# take action on.
|
136
128
|
# @return [Core::Response]
|
137
|
-
define_client_method :delete_queue, 'DeleteQueue'
|
138
129
|
|
139
130
|
# Calls the GetQueueAttributes API operation.
|
140
131
|
# @method get_queue_attributes(options = {})
|
@@ -147,7 +138,6 @@ module AWS
|
|
147
138
|
# The #data method of the response object returns
|
148
139
|
# a hash with the following structure:
|
149
140
|
# * +:attributes+ - (Hash<String,String>)
|
150
|
-
define_client_method :get_queue_attributes, 'GetQueueAttributes'
|
151
141
|
|
152
142
|
# Calls the GetQueueUrl API operation.
|
153
143
|
# @method get_queue_url(options = {})
|
@@ -160,7 +150,6 @@ module AWS
|
|
160
150
|
# The #data method of the response object returns
|
161
151
|
# a hash with the following structure:
|
162
152
|
# * +:queue_url+ - (String)
|
163
|
-
define_client_method :get_queue_url, 'GetQueueUrl'
|
164
153
|
|
165
154
|
# Calls the ListQueues API operation.
|
166
155
|
# @method list_queues(options = {})
|
@@ -172,7 +161,6 @@ module AWS
|
|
172
161
|
# The #data method of the response object returns
|
173
162
|
# a hash with the following structure:
|
174
163
|
# * +:queue_urls+ - (Array<String>)
|
175
|
-
define_client_method :list_queues, 'ListQueues'
|
176
164
|
|
177
165
|
# Calls the ReceiveMessage API operation.
|
178
166
|
# @method receive_message(options = {})
|
@@ -197,7 +185,6 @@ module AWS
|
|
197
185
|
# * +:md5_of_body+ - (String)
|
198
186
|
# * +:body+ - (String)
|
199
187
|
# * +:attributes+ - (Hash<String,String>)
|
200
|
-
define_client_method :receive_message, 'ReceiveMessage'
|
201
188
|
|
202
189
|
# Calls the RemovePermission API operation.
|
203
190
|
# @method remove_permission(options = {})
|
@@ -208,7 +195,6 @@ module AWS
|
|
208
195
|
# permission to remove. This is the label added with the
|
209
196
|
# AddPermission operation.
|
210
197
|
# @return [Core::Response]
|
211
|
-
define_client_method :remove_permission, 'RemovePermission'
|
212
198
|
|
213
199
|
# Calls the SendMessage API operation.
|
214
200
|
# @method send_message(options = {})
|
@@ -223,7 +209,6 @@ module AWS
|
|
223
209
|
# a hash with the following structure:
|
224
210
|
# * +:md5_of_message_body+ - (String)
|
225
211
|
# * +:message_id+ - (String)
|
226
|
-
define_client_method :send_message, 'SendMessage'
|
227
212
|
|
228
213
|
# Calls the SendMessageBatch API operation.
|
229
214
|
# @method send_message_batch(options = {})
|
@@ -250,7 +235,6 @@ module AWS
|
|
250
235
|
# * +:sender_fault+ - (Boolean)
|
251
236
|
# * +:code+ - (String)
|
252
237
|
# * +:message+ - (String)
|
253
|
-
define_client_method :send_message_batch, 'SendMessageBatch'
|
254
238
|
|
255
239
|
# Calls the SetQueueAttributes API operation.
|
256
240
|
# @method set_queue_attributes(options = {})
|
@@ -260,7 +244,6 @@ module AWS
|
|
260
244
|
# * +:attributes+ - *required* - (Hash<String,String>) A map of
|
261
245
|
# attributes to set.
|
262
246
|
# @return [Core::Response]
|
263
|
-
define_client_method :set_queue_attributes, 'SetQueueAttributes'
|
264
247
|
|
265
248
|
## end client methods ##
|
266
249
|
|
data/lib/aws/sqs/errors.rb
CHANGED
@@ -22,13 +22,13 @@ module AWS
|
|
22
22
|
super(code.sub(/^AWS\.SimpleQueueService\./, ''))
|
23
23
|
end
|
24
24
|
|
25
|
-
# Raised when one or more messages fail to delete during a
|
26
|
-
# batch delete operation.
|
25
|
+
# Raised when one or more messages fail to delete during a
|
26
|
+
# batch delete operation.
|
27
27
|
#
|
28
28
|
# See {#failures} for a complete list of failures.
|
29
29
|
#
|
30
30
|
class BatchDeleteError < StandardError
|
31
|
-
|
31
|
+
|
32
32
|
def initialize failures
|
33
33
|
@failures = failures
|
34
34
|
super("Failed to delete #{failures.size} messages")
|
@@ -53,7 +53,7 @@ module AWS
|
|
53
53
|
# See {#failures} for a complete list of failures.
|
54
54
|
#
|
55
55
|
class BatchChangeVisibilityError < StandardError
|
56
|
-
|
56
|
+
|
57
57
|
def initialize failures
|
58
58
|
@failures = failures
|
59
59
|
super("Failed to change visibility for #{failures.size} messages")
|
@@ -80,7 +80,7 @@ module AWS
|
|
80
80
|
super("Failed to send #{failures.size} messages")
|
81
81
|
end
|
82
82
|
|
83
|
-
# @return [Array<Queue::SentMessage>] Returns a list of
|
83
|
+
# @return [Array<Queue::SentMessage>] Returns a list of
|
84
84
|
# {Queue::SentMessage} objects.
|
85
85
|
attr_reader :sent
|
86
86
|
|
data/lib/aws/sts/client.rb
CHANGED
@@ -15,11 +15,9 @@ module AWS
|
|
15
15
|
class STS
|
16
16
|
|
17
17
|
# Client class for AWS Security Token Service (STS).
|
18
|
-
class Client < Core::
|
18
|
+
class Client < Core::QueryClient
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
extend Core::QueryClient
|
20
|
+
define_client_methods('2011-06-15')
|
23
21
|
|
24
22
|
REGION_US_E1 = 'sts.amazonaws.com'
|
25
23
|
|
@@ -67,7 +65,6 @@ module AWS
|
|
67
65
|
# * +:federated_user_id+ - (String)
|
68
66
|
# * +:arn+ - (String)
|
69
67
|
# * +:packed_policy_size+ - (Integer)
|
70
|
-
define_client_method :get_federation_token, 'GetFederationToken'
|
71
68
|
|
72
69
|
# Calls the GetSessionToken API operation.
|
73
70
|
# @method get_session_token(options = {})
|
@@ -101,7 +98,6 @@ module AWS
|
|
101
98
|
# * +:secret_access_key+ - (String)
|
102
99
|
# * +:session_token+ - (String)
|
103
100
|
# * +:expiration+ - (Time)
|
104
|
-
define_client_method :get_session_token, 'GetSessionToken'
|
105
101
|
|
106
102
|
## end client methods ##
|
107
103
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuidtools
|
@@ -154,6 +154,9 @@ files:
|
|
154
154
|
- lib/aws/core/indifferent_hash.rb
|
155
155
|
- lib/aws/core/inflection.rb
|
156
156
|
- lib/aws/core/json_client.rb
|
157
|
+
- lib/aws/core/json_error_parser.rb
|
158
|
+
- lib/aws/core/json_request_builder.rb
|
159
|
+
- lib/aws/core/json_response_parser.rb
|
157
160
|
- lib/aws/core/lazy_error_classes.rb
|
158
161
|
- lib/aws/core/log_formatter.rb
|
159
162
|
- lib/aws/core/meta_utils.rb
|
@@ -165,13 +168,17 @@ files:
|
|
165
168
|
- lib/aws/core/page_result.rb
|
166
169
|
- lib/aws/core/policy.rb
|
167
170
|
- lib/aws/core/query_client.rb
|
171
|
+
- lib/aws/core/query_error_parser.rb
|
172
|
+
- lib/aws/core/query_request_builder.rb
|
173
|
+
- lib/aws/core/query_response_parser.rb
|
168
174
|
- lib/aws/core/resource.rb
|
169
175
|
- lib/aws/core/resource_cache.rb
|
170
176
|
- lib/aws/core/response.rb
|
171
177
|
- lib/aws/core/response_cache.rb
|
172
|
-
- lib/aws/core/rest_client/input_handler.rb
|
173
|
-
- lib/aws/core/rest_client/output_handler.rb
|
174
178
|
- lib/aws/core/rest_client.rb
|
179
|
+
- lib/aws/core/rest_error_parser.rb
|
180
|
+
- lib/aws/core/rest_request_builder.rb
|
181
|
+
- lib/aws/core/rest_response_parser.rb
|
175
182
|
- lib/aws/core/service_interface.rb
|
176
183
|
- lib/aws/core/signature/version_2.rb
|
177
184
|
- lib/aws/core/signature/version_3.rb
|
@@ -193,6 +200,7 @@ files:
|
|
193
200
|
- lib/aws/dynamo_db/attribute_collection.rb
|
194
201
|
- lib/aws/dynamo_db/batch_get.rb
|
195
202
|
- lib/aws/dynamo_db/batch_write.rb
|
203
|
+
- lib/aws/dynamo_db/binary.rb
|
196
204
|
- lib/aws/dynamo_db/client.rb
|
197
205
|
- lib/aws/dynamo_db/config.rb
|
198
206
|
- lib/aws/dynamo_db/errors.rb
|
@@ -498,6 +506,7 @@ files:
|
|
498
506
|
- lib/user.rb
|
499
507
|
- lib/aws/api_config/AutoScaling-2011-01-01.yml
|
500
508
|
- lib/aws/api_config/CloudFormation-2010-05-15.yml
|
509
|
+
- lib/aws/api_config/CloudFront-2012-05-05.yml
|
501
510
|
- lib/aws/api_config/CloudWatch-2010-08-01.yml
|
502
511
|
- lib/aws/api_config/DynamoDB-2011-12-05.yml
|
503
512
|
- lib/aws/api_config/EC2-2012-07-20.yml
|
@@ -531,7 +540,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
531
540
|
version: '0'
|
532
541
|
segments:
|
533
542
|
- 0
|
534
|
-
hash:
|
543
|
+
hash: 339006987852134461
|
535
544
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
536
545
|
none: false
|
537
546
|
requirements:
|
@@ -1,145 +0,0 @@
|
|
1
|
-
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
-
# may not use this file except in compliance with the License. A copy of
|
5
|
-
# the License is located at
|
6
|
-
#
|
7
|
-
# http://aws.amazon.com/apache2.0/
|
8
|
-
#
|
9
|
-
# or in the "license" file accompanying this file. This file is
|
10
|
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
-
# ANY KIND, either express or implied. See the License for the specific
|
12
|
-
# language governing permissions and limitations under the License.
|
13
|
-
|
14
|
-
require 'builder'
|
15
|
-
|
16
|
-
module AWS
|
17
|
-
module Core
|
18
|
-
module RESTClient
|
19
|
-
|
20
|
-
# Given a hash of request options, a REST::RequestHandler can
|
21
|
-
# populate a Core::Http::Request object.
|
22
|
-
class InputHandler
|
23
|
-
|
24
|
-
# @param [String] namespace
|
25
|
-
# @param [Hash] configuration
|
26
|
-
# @option operation [required,Hash] :http REST traits.
|
27
|
-
# @option operation [required,Hash] :inputs Rules for serializing
|
28
|
-
# request options.
|
29
|
-
# @private
|
30
|
-
def initialize namespace, configuration
|
31
|
-
@namespace = namespace
|
32
|
-
@operation_name = configuration[:name]
|
33
|
-
@http = configuration[:http]
|
34
|
-
@rules = configuration[:inputs]
|
35
|
-
end
|
36
|
-
|
37
|
-
# @return [String]
|
38
|
-
attr_reader :namespace
|
39
|
-
|
40
|
-
# @return [String]
|
41
|
-
attr_reader :operation_name
|
42
|
-
|
43
|
-
# @return [Hash] A hash of http rules.
|
44
|
-
attr_reader :http
|
45
|
-
|
46
|
-
# @return [Hash] A hash of rules for where to place request options
|
47
|
-
# in the HTTP request (e.g. uri, querystring, header, body, etc).
|
48
|
-
# Also contains type information for each request option.
|
49
|
-
attr_reader :rules
|
50
|
-
|
51
|
-
# Populates an http request object with params in the uri, headers,
|
52
|
-
# and body.
|
53
|
-
# @param [Http::Request] request
|
54
|
-
# @param [Hash] request_options A hash of options to send with
|
55
|
-
# the request.
|
56
|
-
# @raise [ArgumentError] Raises ArgumentError when any of the
|
57
|
-
# request options are invalid (wrong type, missing, unknown, etc).
|
58
|
-
# @return [Http::Request]
|
59
|
-
def populate_request request, request_options
|
60
|
-
|
61
|
-
params = Options::Validator.new(rules).validate!(request_options)
|
62
|
-
|
63
|
-
request.http_method = http[:verb]
|
64
|
-
request.uri = extract_uri(params)
|
65
|
-
extract_headers(params).each_pair do |header_name, header_value|
|
66
|
-
request.headers[header_name] = header_value
|
67
|
-
end
|
68
|
-
request.body = build_body(params)
|
69
|
-
request
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
protected
|
74
|
-
|
75
|
-
# @param [Hash] params
|
76
|
-
# @return [String]
|
77
|
-
def extract_uri params
|
78
|
-
|
79
|
-
path, querystring = http[:uri].split(/\?/)
|
80
|
-
|
81
|
-
uri = path.gsub(/:\w+/) do |param_name|
|
82
|
-
unless param = params.delete(param_name[1..-1].to_sym)
|
83
|
-
msg = "missing required uri argument :#{param_name[1..-1]}"
|
84
|
-
raise ArgumentError, msg
|
85
|
-
end
|
86
|
-
UriEscape.escape(param)
|
87
|
-
end
|
88
|
-
|
89
|
-
querystring_parts = []
|
90
|
-
querystring.to_s.split(/&/).each do |part|
|
91
|
-
param_name = part.match(/:(\w+)/)[1]
|
92
|
-
if param = params.delete(param_name.to_sym)
|
93
|
-
param = UriEscape.escape(param)
|
94
|
-
querystring_parts << part.sub(/:#{param_name}/, param)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
unless querystring_parts.empty?
|
99
|
-
uri << "?#{querystring_parts.join('&')}"
|
100
|
-
end
|
101
|
-
|
102
|
-
uri
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
# @param [Hash] params
|
107
|
-
# @return [Hash]
|
108
|
-
def extract_headers params
|
109
|
-
headers = {}
|
110
|
-
(http[:request_headers] || {}).each_pair do |param_name,header_name|
|
111
|
-
if param_value = params.delete(param_name)
|
112
|
-
headers[header_name] = param_value
|
113
|
-
end
|
114
|
-
end
|
115
|
-
headers
|
116
|
-
end
|
117
|
-
|
118
|
-
# @param [Hash] params
|
119
|
-
# @return [String,nil]
|
120
|
-
def build_body params
|
121
|
-
if params.empty?
|
122
|
-
nil
|
123
|
-
else
|
124
|
-
if
|
125
|
-
payload = http[:request_payload] and
|
126
|
-
rules[payload][:type] != :hash
|
127
|
-
then
|
128
|
-
params[payload]
|
129
|
-
else
|
130
|
-
params_to_xml(params)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
# @param [Hash] params
|
136
|
-
# @return [String] Returns xml.
|
137
|
-
def params_to_xml params
|
138
|
-
Options::XMLSerializer.new(namespace, operation_name, rules).serialize(params)
|
139
|
-
end
|
140
|
-
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4
|
-
# may not use this file except in compliance with the License. A copy of
|
5
|
-
# the License is located at
|
6
|
-
#
|
7
|
-
# http://aws.amazon.com/apache2.0/
|
8
|
-
#
|
9
|
-
# or in the "license" file accompanying this file. This file is
|
10
|
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11
|
-
# ANY KIND, either express or implied. See the License for the specific
|
12
|
-
# language governing permissions and limitations under the License.
|
13
|
-
|
14
|
-
module AWS
|
15
|
-
module Core
|
16
|
-
module RESTClient
|
17
|
-
|
18
|
-
# Given a hash of request options, a REST::RequestHandler can
|
19
|
-
# populate a Core::Http::Request object.
|
20
|
-
class OutputHandler
|
21
|
-
|
22
|
-
# @param [Hash] operation
|
23
|
-
# @option operation [required,Hash] :http REST traits.
|
24
|
-
# @option operation [required,Hash] :outputs XML parsing rules.
|
25
|
-
# @private
|
26
|
-
def initialize operation
|
27
|
-
@http = operation[:http]
|
28
|
-
@parser = XML::Parser.new(operation[:outputs])
|
29
|
-
end
|
30
|
-
|
31
|
-
# Given a response object, this method extract and returns a
|
32
|
-
# hash of response data.
|
33
|
-
# @param [Response] response
|
34
|
-
# @return [Hash]
|
35
|
-
def extract_data response
|
36
|
-
|
37
|
-
# parse the response XML body
|
38
|
-
data = @parser.parse(response.http_response.body)
|
39
|
-
|
40
|
-
# extract headers and insert into response
|
41
|
-
(@http[:response_headers] || {}).each_pair do |name,header_name|
|
42
|
-
data[name] = response.http_response.headers[header_name]
|
43
|
-
end
|
44
|
-
|
45
|
-
data
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|