aws-sdk-core 2.1.31 → 2.1.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@ module Aws
19
19
  # @api private
20
20
  # services
21
21
  SERVICE_MODULE_NAMES = %w(
22
+ APIGateway
22
23
  AutoScaling
23
24
  CloudFormation
24
25
  CloudFront
@@ -141,6 +142,7 @@ module Aws
141
142
  end
142
143
 
143
144
  module Plugins
145
+ autoload :APIGatewayHeader, 'aws-sdk-core/plugins/api_gateway_header'
144
146
  autoload :CSDConditionalSigning, 'aws-sdk-core/plugins/csd_conditional_signing'
145
147
  autoload :DynamoDBExtendedRetries, 'aws-sdk-core/plugins/dynamodb_extended_retries'
146
148
  autoload :DynamoDBSimpleAttributes, 'aws-sdk-core/plugins/dynamodb_simple_attributes'
@@ -44,6 +44,10 @@ module Aws
44
44
 
45
45
  end
46
46
 
47
+ plugins('apigateway',
48
+ add: %w(Aws::Plugins::APIGatewayHeader),
49
+ )
50
+
47
51
  api('cloudfront') do |api|
48
52
 
49
53
  api['shapes'].each do |_, shape|
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:APIGateway, {
2
+ api: "#{Aws::API_DIR}/apigateway/2015-07-09/api-2.json",
3
+ docs: "#{Aws::API_DIR}/apigateway/2015-07-09/docs-2.json",
4
+ paginators: "#{Aws::API_DIR}/apigateway/2015-07-09/paginators-1.json",
5
+ })
@@ -0,0 +1,19 @@
1
+ module Aws
2
+ module Plugins
3
+ # @api private
4
+ class APIGatewayHeader < Seahorse::Client::Plugin
5
+
6
+ class Handler < Seahorse::Client::Handler
7
+
8
+ def call(context)
9
+ context.http_request.headers['Accept'] = 'application/json'
10
+ @handler.call(context)
11
+ end
12
+
13
+ end
14
+
15
+ handler(Handler)
16
+
17
+ end
18
+ end
19
+ end
@@ -5,6 +5,8 @@ module Aws
5
5
  module Request
6
6
  class Endpoint
7
7
 
8
+ include Seahorse::Model::Shapes
9
+
8
10
  # @param [Seahorse::Model::Shapes::ShapeRef] rules
9
11
  # @param [String] request_uri_pattern
10
12
  def initialize(rules, request_uri_pattern)
@@ -52,14 +54,58 @@ module Aws
52
54
  parts << @query_pattern if @query_pattern
53
55
  @rules.shape.members.each do |member_name, member|
54
56
  if member.location == 'querystring' && !params[member_name].nil?
55
- param_name = member.location_name
56
- param_value = params[member_name]
57
- parts << "#{param_name}=#{escape(param_value.to_s)}"
57
+ case member.shape
58
+
59
+ # supported scalar types
60
+ when StringShape, BooleanShape, FloatShape, IntegerShape, StringShape
61
+ param_name = member.location_name
62
+ param_value = params[member_name]
63
+ parts << "#{param_name}=#{escape(param_value.to_s)}"
64
+
65
+ # map of strings or map of string-list
66
+ when MapShape
67
+ if StringShape === member.shape.value.shape
68
+ parts += query_map_of_string(params[member_name])
69
+ elsif ListShape === member.shape.value.shape
70
+ parts += query_map_of_string_list(params[member_name])
71
+ else
72
+ msg = "only map of string and string list supported"
73
+ raise NotImplementedError, msg
74
+ end
75
+
76
+ # unsupported querystring shape
77
+ else
78
+ raise NotImplementedError
79
+ end
80
+
58
81
  end
59
82
  end
60
83
  uri.query = parts.empty? ? nil : parts.join('&')
61
84
  end
62
85
 
86
+ def query_map_of_string(hash)
87
+ list = []
88
+ hash.each_pair do |key, value|
89
+ list << "#{escape(key)}=#{escape(value)}"
90
+ end
91
+ list
92
+ end
93
+
94
+ def query_map_of_string_list(hash)
95
+ list = []
96
+ hash.each_pair do |key, values|
97
+ values.each do |value|
98
+ list << "#{escape(key)}=#{escape(value)}"
99
+ end
100
+ end
101
+ list
102
+ end
103
+
104
+ def querystring_param(key, value)
105
+ param_name = member.location_name
106
+ param_value = params[member_name]
107
+ end
108
+
63
109
  def escape(string)
64
110
  Seahorse::Util.uri_escape(string)
65
111
  end
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.1.31'
2
+ VERSION = '2.1.32'
3
3
  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.1.31
4
+ version: 2.1.32
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-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath
@@ -33,6 +33,8 @@ executables:
33
33
  extensions: []
34
34
  extra_rdoc_files: []
35
35
  files:
36
+ - apis/apigateway/2015-07-09/api-2.json
37
+ - apis/apigateway/2015-07-09/paginators-1.json
36
38
  - apis/autoscaling/2011-01-01/api-2.json
37
39
  - apis/autoscaling/2011-01-01/paginators-1.json
38
40
  - apis/cloudformation/2010-05-15/api-2.json
@@ -178,6 +180,7 @@ files:
178
180
  - lib/aws-sdk-core/api/docs/shared_example.rb
179
181
  - lib/aws-sdk-core/api/docs/utils.rb
180
182
  - lib/aws-sdk-core/api/shape_map.rb
183
+ - lib/aws-sdk-core/apigateway.rb
181
184
  - lib/aws-sdk-core/assume_role_credentials.rb
182
185
  - lib/aws-sdk-core/autoscaling.rb
183
186
  - lib/aws-sdk-core/client.rb
@@ -251,6 +254,7 @@ files:
251
254
  - lib/aws-sdk-core/pager.rb
252
255
  - lib/aws-sdk-core/param_converter.rb
253
256
  - lib/aws-sdk-core/param_validator.rb
257
+ - lib/aws-sdk-core/plugins/api_gateway_header.rb
254
258
  - lib/aws-sdk-core/plugins/csd_conditional_signing.rb
255
259
  - lib/aws-sdk-core/plugins/dynamodb_crc32_validation.rb
256
260
  - lib/aws-sdk-core/plugins/dynamodb_extended_retries.rb
@@ -419,7 +423,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
419
423
  version: '0'
420
424
  requirements: []
421
425
  rubyforge_project:
422
- rubygems_version: 2.4.6
426
+ rubygems_version: 2.4.5
423
427
  signing_key:
424
428
  specification_version: 4
425
429
  summary: AWS SDK for Ruby - Core