aws-sdk-core 2.6.9 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. checksums.yaml +4 -4
  2. data/apis/acm/2015-12-08/api-2.json +34 -3
  3. data/apis/acm/2015-12-08/paginators-1.json +2 -2
  4. data/apis/apigateway/2015-07-09/api-2.json +625 -17
  5. data/apis/application-autoscaling/2016-02-06/api-2.json +5 -2
  6. data/apis/appstream/2016-12-01/api-2.json +820 -0
  7. data/apis/appstream/2016-12-01/examples-1.json +5 -0
  8. data/apis/appstream/2016-12-01/waiters-2.json +55 -0
  9. data/apis/autoscaling/2011-01-01/api-2.json +1 -0
  10. data/apis/autoscaling/2011-01-01/resources-1.json +12 -1
  11. data/apis/batch/2016-08-10/api-2.json +885 -0
  12. data/apis/batch/2016-08-10/examples-1.json +589 -0
  13. data/apis/budgets/2016-10-20/api-2.json +696 -0
  14. data/apis/budgets/2016-10-20/examples-1.json +5 -0
  15. data/apis/cloudformation/2010-05-15/api-2.json +126 -11
  16. data/apis/cloudformation/2010-05-15/examples-1.json +153 -0
  17. data/apis/cloudformation/2010-05-15/resources-1.json +10 -1
  18. data/apis/cloudformation/2010-05-15/waiters-2.json +18 -96
  19. data/apis/cloudfront/2016-01-28/api-2.json +1 -0
  20. data/apis/cloudfront/2016-08-01/api-2.json +1 -0
  21. data/apis/cloudfront/2016-08-20/api-2.json +1 -0
  22. data/apis/cloudfront/2016-09-07/api-2.json +1 -0
  23. data/apis/cloudfront/2016-09-29/api-2.json +2599 -0
  24. data/apis/cloudfront/2016-09-29/examples-1.json +5 -0
  25. data/apis/cloudfront/2016-09-29/paginators-1.json +32 -0
  26. data/apis/cloudfront/2016-09-29/waiters-2.json +47 -0
  27. data/apis/cloudfront/2016-11-25/api-2.json +2665 -0
  28. data/apis/cloudfront/2016-11-25/examples-1.json +5 -0
  29. data/apis/cloudfront/2016-11-25/paginators-1.json +32 -0
  30. data/apis/cloudfront/2016-11-25/waiters-2.json +47 -0
  31. data/apis/cloudhsm/2014-05-30/api-2.json +2 -1
  32. data/apis/cloudsearch/2013-01-01/api-2.json +2 -1
  33. data/apis/cloudsearchdomain/2013-01-01/api-2.json +2 -1
  34. data/apis/cloudtrail/2013-11-01/api-2.json +109 -3
  35. data/apis/cloudtrail/2013-11-01/paginators-1.json +6 -0
  36. data/apis/codebuild/2016-10-06/api-2.json +702 -0
  37. data/apis/codebuild/2016-10-06/examples-1.json +5 -0
  38. data/apis/codecommit/2015-04-13/api-2.json +2 -1
  39. data/apis/codedeploy/2014-10-06/api-2.json +35 -6
  40. data/apis/codepipeline/2015-07-09/api-2.json +3 -2
  41. data/apis/cognito-identity/2014-06-30/api-2.json +84 -5
  42. data/apis/cognito-idp/2016-04-18/api-2.json +368 -5
  43. data/apis/cognito-sync/2014-06-30/api-2.json +2 -1
  44. data/apis/config/2014-11-12/api-2.json +40 -9
  45. data/apis/config/2014-11-12/paginators-1.json +2 -2
  46. data/apis/cur/2017-01-06/api-2.json +226 -0
  47. data/apis/cur/2017-01-06/examples-1.json +5 -0
  48. data/apis/cur/2017-01-06/paginators-1.json +9 -0
  49. data/apis/datapipeline/2012-10-29/api-2.json +2 -1
  50. data/apis/devicefarm/2015-06-23/api-2.json +2 -1
  51. data/apis/directconnect/2012-10-25/api-2.json +257 -10
  52. data/apis/discovery/2015-11-01/api-2.json +316 -5
  53. data/apis/dms/2016-01-01/api-2.json +45 -9
  54. data/apis/ds/2015-04-16/api-2.json +144 -1
  55. data/apis/dynamodb/2011-12-05/api-2.json +802 -0
  56. data/apis/dynamodb/2011-12-05/examples-1.json +5 -0
  57. data/apis/dynamodb/2011-12-05/paginators-1.json +26 -0
  58. data/apis/dynamodb/2011-12-05/waiters-2.json +35 -0
  59. data/apis/dynamodb/2012-08-10/api-2.json +115 -1
  60. data/apis/dynamodb/2012-08-10/examples-1.json +623 -0
  61. data/apis/dynamodb/2012-08-10/paginators-1.json +4 -4
  62. data/apis/ec2/2015-10-01/api-2.json +1 -0
  63. data/apis/ec2/2016-04-01/api-2.json +1 -0
  64. data/apis/ec2/2016-09-15/api-2.json +1 -0
  65. data/apis/ec2/2016-11-15/api-2.json +15037 -0
  66. data/apis/ec2/2016-11-15/examples-1.json +3740 -0
  67. data/apis/ec2/2016-11-15/paginators-1.json +138 -0
  68. data/apis/ec2/2016-11-15/resources-1.json +2582 -0
  69. data/apis/ec2/2016-11-15/waiters-2.json +593 -0
  70. data/apis/ecr/2015-09-21/api-2.json +17 -3
  71. data/apis/ecr/2015-09-21/paginators-1.json +12 -6
  72. data/apis/ecs/2014-11-13/api-2.json +183 -9
  73. data/apis/elasticache/2015-02-02/api-2.json +5 -2
  74. data/apis/elasticache/2015-02-02/examples-1.json +2963 -0
  75. data/apis/elasticbeanstalk/2010-12-01/api-2.json +123 -6
  76. data/apis/elasticfilesystem/2015-02-01/api-2.json +2 -1
  77. data/apis/elasticfilesystem/2015-02-01/examples-1.json +217 -0
  78. data/apis/elasticloadbalancing/2012-06-01/api-2.json +1 -0
  79. data/apis/elasticloadbalancingv2/2015-12-01/api-2.json +1 -0
  80. data/apis/elasticmapreduce/2009-03-31/api-2.json +322 -5
  81. data/apis/elastictranscoder/2012-09-25/api-2.json +44 -13
  82. data/apis/elastictranscoder/2012-09-25/examples-1.json +5 -0
  83. data/apis/email/2010-12-01/api-2.json +425 -4
  84. data/apis/es/2015-01-01/api-2.json +1 -0
  85. data/apis/events/2015-10-07/api-2.json +1 -0
  86. data/apis/firehose/2015-08-04/api-2.json +151 -4
  87. data/apis/firehose/2015-08-04/examples-1.json +5 -0
  88. data/apis/gamelift/2015-10-01/api-2.json +59 -1
  89. data/apis/glacier/2012-06-01/api-2.json +369 -779
  90. data/apis/glacier/2012-06-01/examples-1.json +806 -0
  91. data/apis/glacier/2012-06-01/paginators-1.json +5 -5
  92. data/apis/health/2016-08-04/api-2.json +547 -0
  93. data/apis/health/2016-08-04/examples-1.json +5 -0
  94. data/apis/health/2016-08-04/paginators-1.json +31 -0
  95. data/apis/iam/2010-05-08/api-2.json +209 -0
  96. data/apis/iam/2010-05-08/examples-1.json +1186 -0
  97. data/apis/importexport/2010-06-01/api-2.json +1 -0
  98. data/apis/inspector/2016-02-16/api-2.json +2 -1
  99. data/apis/inspector/2016-02-16/examples-1.json +1135 -0
  100. data/apis/iot-data/2015-05-28/api-2.json +1 -0
  101. data/apis/iot/2015-05-28/api-2.json +16 -0
  102. data/apis/kinesis/2013-12-02/api-2.json +80 -12
  103. data/apis/kinesisanalytics/2015-08-14/api-2.json +7 -2
  104. data/apis/kms/2014-11-01/api-2.json +2 -1
  105. data/apis/kms/2014-11-01/examples-1.json +810 -0
  106. data/apis/lambda/2014-11-11/api-2.json +1 -0
  107. data/apis/lambda/2015-03-31/api-2.json +162 -9
  108. data/apis/lambda/2015-03-31/examples-1.json +609 -0
  109. data/apis/lightsail/2016-11-28/api-2.json +2137 -0
  110. data/apis/lightsail/2016-11-28/examples-1.json +5 -0
  111. data/apis/logs/2014-03-28/api-2.json +113 -6
  112. data/apis/machinelearning/2014-12-12/api-2.json +1 -0
  113. data/apis/marketplacecommerceanalytics/2015-07-01/api-2.json +5 -2
  114. data/apis/meteringmarketplace/2016-01-14/api-2.json +136 -0
  115. data/apis/monitoring/2010-08-01/api-2.json +27 -6
  116. data/apis/opsworks/2013-02-18/api-2.json +1 -0
  117. data/apis/opsworkscm/2016-11-01/api-2.json +712 -0
  118. data/apis/opsworkscm/2016-11-01/examples-1.json +5 -0
  119. data/apis/pinpoint/2016-12-01/api-2.json +2753 -0
  120. data/apis/pinpoint/2016-12-01/examples-1.json +5 -0
  121. data/apis/polly/2016-06-10/api-2.json +504 -0
  122. data/apis/polly/2016-06-10/examples-1.json +171 -0
  123. data/apis/rds/2013-01-10/api-2.json +2902 -0
  124. data/apis/rds/2013-01-10/examples-1.json +5 -0
  125. data/apis/rds/2013-01-10/paginators-1.json +97 -0
  126. data/apis/rds/2013-02-12/api-2.json +3058 -0
  127. data/apis/rds/2013-02-12/examples-1.json +5 -0
  128. data/apis/rds/2013-02-12/paginators-1.json +110 -0
  129. data/apis/rds/2013-09-09/api-2.json +3159 -0
  130. data/apis/rds/2013-09-09/examples-1.json +5 -0
  131. data/apis/rds/2013-09-09/paginators-1.json +110 -0
  132. data/apis/rds/2013-09-09/waiters-2.json +97 -0
  133. data/apis/rds/2014-09-01/api-2.json +3272 -0
  134. data/apis/rds/2014-09-01/examples-1.json +5 -0
  135. data/apis/rds/2014-09-01/paginators-1.json +4 -0
  136. data/apis/rds/2014-10-31/api-2.json +121 -6
  137. data/apis/rds/2014-10-31/examples-1.json +0 -444
  138. data/apis/rds/2014-10-31/paginators-1.json +18 -18
  139. data/apis/rds/2014-10-31/resources-1.json +1 -1
  140. data/apis/redshift/2012-12-01/api-2.json +1 -0
  141. data/apis/rekognition/2016-06-27/api-2.json +836 -0
  142. data/apis/rekognition/2016-06-27/examples-1.json +651 -0
  143. data/apis/rekognition/2016-06-27/paginators-1.json +16 -0
  144. data/apis/route53/2013-04-01/api-2.json +186 -219
  145. data/apis/route53/2013-04-01/paginators-1.json +9 -9
  146. data/apis/route53domains/2014-05-15/api-2.json +1 -0
  147. data/apis/s3/2006-03-01/api-2.json +843 -23
  148. data/apis/sdb/2009-04-15/api-2.json +1 -0
  149. data/apis/servicecatalog/2015-12-10/api-2.json +1214 -29
  150. data/apis/shield/2016-06-02/api-2.json +494 -0
  151. data/apis/shield/2016-06-02/examples-1.json +5 -0
  152. data/apis/sms/2016-10-24/api-2.json +612 -0
  153. data/apis/sms/2016-10-24/examples-1.json +5 -0
  154. data/apis/sms/2016-10-24/paginators-1.json +28 -0
  155. data/apis/snowball/2016-06-30/api-2.json +283 -11
  156. data/apis/snowball/2016-06-30/examples-1.json +437 -0
  157. data/apis/sns/2010-03-31/api-2.json +1 -0
  158. data/apis/sqs/2012-11-05/api-2.json +74 -38
  159. data/apis/sqs/2012-11-05/examples-1.json +0 -613
  160. data/apis/sqs/2012-11-05/resources-1.json +232 -0
  161. data/apis/ssm/2014-11-06/api-2.json +4036 -536
  162. data/apis/states/2016-11-23/api-2.json +1021 -0
  163. data/apis/states/2016-11-23/examples-1.json +5 -0
  164. data/apis/states/2016-11-23/paginators-1.json +28 -0
  165. data/apis/storagegateway/2013-06-30/api-2.json +269 -6
  166. data/apis/storagegateway/2013-06-30/examples-1.json +1376 -0
  167. data/apis/streams.dynamodb/2012-08-10/api-2.json +2 -1
  168. data/apis/streams.dynamodb/2012-08-10/examples-1.json +207 -0
  169. data/apis/sts/2011-06-15/api-2.json +1 -0
  170. data/apis/sts/2011-06-15/examples-1.json +201 -0
  171. data/apis/support/2013-04-15/api-2.json +1 -0
  172. data/apis/swf/2012-01-25/api-2.json +1 -0
  173. data/apis/waf-regional/2016-11-28/api-2.json +2090 -0
  174. data/apis/waf-regional/2016-11-28/examples-1.json +1017 -0
  175. data/apis/waf/2015-08-24/api-2.json +3 -1
  176. data/apis/waf/2015-08-24/examples-1.json +1012 -0
  177. data/apis/workspaces/2015-04-08/api-2.json +1 -0
  178. data/apis/xray/2016-04-12/api-2.json +491 -0
  179. data/apis/xray/2016-04-12/examples-1.json +5 -0
  180. data/endpoints.json +781 -392
  181. data/lib/aws-sdk-core.rb +20 -0
  182. data/lib/aws-sdk-core/api/customizations.rb +16 -0
  183. data/lib/aws-sdk-core/api/docs/builder.rb +2 -1
  184. data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +9 -0
  185. data/lib/aws-sdk-core/api/docs/crosslink.rb +43 -0
  186. data/lib/aws-sdk-core/api/docs/operation_documenter.rb +11 -2
  187. data/lib/aws-sdk-core/appstream.rb +6 -0
  188. data/lib/aws-sdk-core/batch.rb +5 -0
  189. data/lib/aws-sdk-core/budgets.rb +5 -0
  190. data/lib/aws-sdk-core/client.rb +1 -0
  191. data/lib/aws-sdk-core/client_waiters.rb +5 -5
  192. data/lib/aws-sdk-core/cloudfront.rb +5 -5
  193. data/lib/aws-sdk-core/cloudfront/url_signer.rb +1 -1
  194. data/lib/aws-sdk-core/codebuild.rb +5 -0
  195. data/lib/aws-sdk-core/costandusagereportservice.rb +6 -0
  196. data/lib/aws-sdk-core/credential_provider_chain.rb +3 -3
  197. data/lib/aws-sdk-core/cur.rb +6 -0
  198. data/lib/aws-sdk-core/ec2.rb +6 -6
  199. data/lib/aws-sdk-core/elastictranscoder.rb +1 -0
  200. data/lib/aws-sdk-core/firehose.rb +1 -0
  201. data/lib/aws-sdk-core/glacier.rb +1 -0
  202. data/lib/aws-sdk-core/health.rb +6 -0
  203. data/lib/aws-sdk-core/lightsail.rb +5 -0
  204. data/lib/aws-sdk-core/opsworkscm.rb +5 -0
  205. data/lib/aws-sdk-core/partitions/region.rb +0 -12
  206. data/lib/aws-sdk-core/partitions/service.rb +1 -11
  207. data/lib/aws-sdk-core/pinpoint.rb +5 -0
  208. data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +24 -55
  209. data/lib/aws-sdk-core/plugins/idempotency_token.rb +37 -0
  210. data/lib/aws-sdk-core/plugins/rds_cross_region_copying.rb +64 -0
  211. data/lib/aws-sdk-core/plugins/request_signer.rb +4 -0
  212. data/lib/aws-sdk-core/plugins/retry_errors.rb +1 -0
  213. data/lib/aws-sdk-core/plugins/s3_bucket_dns.rb +1 -1
  214. data/lib/aws-sdk-core/plugins/sqs_md5s.rb +1 -1
  215. data/lib/aws-sdk-core/polly.rb +13 -0
  216. data/lib/aws-sdk-core/polly/presigner.rb +70 -0
  217. data/lib/aws-sdk-core/rekognition.rb +6 -0
  218. data/lib/aws-sdk-core/rest/request/endpoint.rb +11 -66
  219. data/lib/aws-sdk-core/rest/request/querystring_builder.rb +90 -0
  220. data/lib/aws-sdk-core/shield.rb +5 -0
  221. data/lib/aws-sdk-core/signers/v4.rb +2 -1
  222. data/lib/aws-sdk-core/sms.rb +6 -0
  223. data/lib/aws-sdk-core/sqs.rb +1 -0
  224. data/lib/aws-sdk-core/states.rb +6 -0
  225. data/lib/aws-sdk-core/version.rb +1 -1
  226. data/lib/aws-sdk-core/wafregional.rb +5 -0
  227. data/lib/aws-sdk-core/xray.rb +5 -0
  228. data/lib/seahorse/client/net_http/connection_pool.rb +11 -7
  229. data/lib/seahorse/client/net_http/handler.rb +5 -2
  230. data/lib/seahorse/client/plugin_list.rb +3 -1
  231. data/lib/seahorse/client/response.rb +9 -20
  232. data/service-models.json +66 -2
  233. metadata +110 -2
@@ -0,0 +1,5 @@
1
+ Aws.add_service(:Pinpoint, {
2
+ api: "#{Aws::API_DIR}/pinpoint/2016-12-01/api-2.json",
3
+ docs: "#{Aws::API_DIR}/pinpoint/2016-12-01/docs-2.json",
4
+ examples: "#{Aws::API_DIR}/pinpoint/2016-12-01/examples-1.json",
5
+ })
@@ -1,3 +1,5 @@
1
+ require 'aws-sigv4'
2
+
1
3
  module Aws
2
4
  module Plugins
3
5
 
@@ -16,66 +18,33 @@ module Aws
16
18
  def call(context)
17
19
  params = context.params
18
20
  params[:destination_region] = context.config.region
19
- params[:presigned_url] = presigned_url(context.client, params)
21
+ params[:presigned_url] = presigned_url(context, params)
20
22
  @handler.call(context)
21
23
  end
22
24
 
23
25
  private
24
26
 
25
- def presigned_url(client, params)
26
- client = source_region_client(client, params)
27
- client.handle(PresignHandler, step: :build, priority: 0)
28
- client.handlers.remove(Handler)
29
- client.copy_snapshot(params).data # presigned url
30
- end
31
-
32
- def source_region_client(client, params)
33
- EC2::Client.new({
34
- region: params[:source_region] || 'region',
35
- credentials: client.config.credentials,
36
- })
37
- end
38
-
39
- end
40
-
41
- # This handler intentionally does NOT call the next handler in
42
- # the stack. It generates a presigned url from the request
43
- # and returns it as the response data.
44
- #
45
- # Before signing:
46
- #
47
- # * The HTTP method is changed from POST to GET
48
- # * The url-encoded body is moved to the querystring
49
- #
50
- # @api private
51
- class PresignHandler < Seahorse::Client::Handler
52
-
53
- def call(context)
54
- convert_post_2_get(context)
55
- Seahorse::Client::Response.new(
56
- context: context,
57
- data: presigned_url(context.http_request, context.config))
58
- end
59
-
60
- private
61
-
62
- def convert_post_2_get(context)
63
- context.http_request.http_method = 'GET'
64
- context.http_request.endpoint = new_endpoint(context)
65
- context.http_request.body = ''
66
- context.http_request.headers.delete('Content-Type')
67
- end
68
-
69
- def new_endpoint(context)
70
- body = context.http_request.body_contents
71
- endpoint = context.http_request.endpoint
72
- endpoint.query = body
73
- endpoint
74
- end
75
-
76
- def presigned_url(http_request, config)
77
- signer = Signers::V4.new(config.credentials, 'ec2', config.region)
78
- signer.presigned_url(http_request, expires_in: 3600)
27
+ def presigned_url(context, params)
28
+ param_list = Aws::Query::ParamList.new
29
+ param_list.set('Action', 'CopySnapshot')
30
+ param_list.set('DestinationRegion', context.config.region)
31
+ param_list.set('Version', context.config.api.metadata['apiVersion'])
32
+ Aws::Query::EC2ParamBuilder.new(param_list).apply(context.operation.input, params)
33
+
34
+ signer = Aws::Sigv4::Signer.new(
35
+ service: 'ec2',
36
+ region: params[:source_region],
37
+ credentials_provider: context.config.credentials
38
+ )
39
+ url = Aws::EndpointProvider.resolve(signer.region, 'ec2')
40
+ url += "?#{param_list.to_s}"
41
+
42
+ signer.presign_url(
43
+ http_method: 'GET',
44
+ url: url,
45
+ body: '',
46
+ expires_in: 3600
47
+ ).to_s
79
48
  end
80
49
 
81
50
  end
@@ -0,0 +1,37 @@
1
+ require 'securerandom'
2
+
3
+ module Aws
4
+ module Plugins
5
+
6
+ # Provides support for auto filling operation parameters
7
+ # that enabled with `idempotencyToken` trait with random UUID v4
8
+ # when no value is provided
9
+ class IdempotencyToken < Seahorse::Client::Plugin
10
+
11
+ # @api private
12
+ class Handler < Seahorse::Client::Handler
13
+
14
+ # @param [RequestContext] context
15
+ # @param [Response]
16
+ def call(context)
17
+ auto_fill(context.params, context.operation.input)
18
+ @handler.call(context)
19
+ end
20
+
21
+ private
22
+
23
+ def auto_fill(params, ref)
24
+ ref.shape.members.each do |name, member_ref|
25
+ if member_ref['idempotencyToken']
26
+ params[name] ||= SecureRandom.uuid
27
+ end
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ handler(Handler, step: :initialize)
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,64 @@
1
+ require 'aws-sigv4'
2
+
3
+ module Aws
4
+ module Plugins
5
+
6
+ # This plugin populates the `:pre_signed_url` request param for the
7
+ # CopyDBSnapshot API.
8
+ #
9
+ # This parameter is required by RDS when copying an encrypted snapshot
10
+ # across regions. This plugin will be skipped if the `:pre_signed_url`
11
+ # parameter is provided by the user.
12
+ #
13
+ # @seahorse.client.option [String] :source_region The region which you are
14
+ # copying an encrypted snapshot from. This parameter must be present to
15
+ # have the plugin compute a presigned URL on your behalf.
16
+ class RDSCrossRegionCopying < Seahorse::Client::Plugin
17
+
18
+ # @api private
19
+ class Handler < Seahorse::Client::Handler
20
+
21
+ def call(context)
22
+ params = context.params
23
+ if params[:source_region] && !params[:pre_signed_url]
24
+ params[:pre_signed_url] = presigned_url(context, params)
25
+ params[:destination_region] = context.config.region
26
+ end
27
+ @handler.call(context)
28
+ end
29
+
30
+ private
31
+ def presigned_url(context, params)
32
+ # :source_region is not modeled in the api
33
+ source_region = params.delete(:source_region)
34
+ param_list = Aws::Query::ParamList.new
35
+ param_list.set('Action', context.operation.name)
36
+ param_list.set('DestinationRegion', context.config.region)
37
+ param_list.set('Version', context.config.api.metadata['apiVersion'])
38
+ Aws::Query::ParamBuilder.new(param_list).apply(
39
+ context.operation.input,
40
+ params
41
+ )
42
+ signer = Aws::Sigv4::Signer.new(
43
+ service: 'rds',
44
+ region: source_region,
45
+ credentials_provider: context.config.credentials
46
+ )
47
+ url = Aws::EndpointProvider.resolve(signer.region, 'rds')
48
+ url += "?#{param_list.to_s}"
49
+ signer.presign_url(
50
+ http_method: 'GET',
51
+ url: url,
52
+ body: '',
53
+ expires_in: 3600
54
+ ).to_s
55
+ end
56
+ end
57
+ handler(
58
+ Handler,
59
+ step: :initialize,
60
+ operations: [:copy_db_snapshot]
61
+ )
62
+ end
63
+ end
64
+ end
@@ -37,6 +37,10 @@ module Aws
37
37
  CredentialProviderChain.new(config).resolve
38
38
  end
39
39
 
40
+ option(:instance_profile_credentials_retries, 0)
41
+
42
+ option(:instance_profile_credentials_timeout, 1)
43
+
40
44
  # Intentionally not documented - this should go away when all
41
45
  # services support signature version 4 in every region.
42
46
  option(:signature_version) do |cfg|
@@ -32,6 +32,7 @@ module Aws
32
32
  'ProvisionedThroughputExceededException', # dynamodb
33
33
  'RequestLimitExceeded', # ec2
34
34
  'BandwidthLimitExceeded', # cloud search
35
+ 'LimitExceededException', # kinesis
35
36
  ])
36
37
 
37
38
  CHECKSUM_ERRORS = Set.new([
@@ -39,7 +39,7 @@ module Aws
39
39
  if
40
40
  bucket_name &&
41
41
  S3BucketDns.dns_compatible?(bucket_name, https?(endpoint)) &&
42
- context.operation_name != 'get_bucket_location'
42
+ context.operation_name.to_s != 'get_bucket_location'
43
43
  then
44
44
  move_bucket_to_subdomain(bucket_name, endpoint)
45
45
  end
@@ -77,7 +77,7 @@ module Aws
77
77
  returned_md5 = response.md5_of_message_attributes
78
78
  if returned_md5 != calculated_md5
79
79
  error_message = mismatch_error_message(
80
- 'message atributes',
80
+ 'message attributes',
81
81
  calculated_md5,
82
82
  returned_md5,
83
83
  response)
@@ -0,0 +1,13 @@
1
+ Aws.add_service(:Polly, {
2
+ api: "#{Aws::API_DIR}/polly/2016-06-10/api-2.json",
3
+ docs: "#{Aws::API_DIR}/polly/2016-06-10/docs-2.json",
4
+ examples: "#{Aws::API_DIR}/polly/2016-06-10/examples-1.json",
5
+ })
6
+
7
+ module Aws
8
+ module Polly
9
+
10
+ autoload :Presigner, 'aws-sdk-core/polly/presigner'
11
+
12
+ end
13
+ end
@@ -0,0 +1,70 @@
1
+ require 'aws-sigv4'
2
+
3
+ module Aws
4
+ module Polly
5
+
6
+ # Allows you to create presigned URLs for `synthesize_speech`
7
+ #
8
+ # Example Use:
9
+ #
10
+ # signer = Aws::Polly::Presigner.new
11
+ # url = signer.synthesize_speech_presigned_url(
12
+ # output_format: 'mp3',
13
+ # text: 'Hello World',
14
+ # voice_id: 'Ewa'
15
+ # )
16
+ #
17
+ class Presigner
18
+
19
+ # @option options [required, Credentials] :credentials
20
+ # You need provide an object that responds to `#credentials`
21
+ # returning another object that responds to `#access_key_id`, `#secret_access_key`,
22
+ # and `#session_token`.
23
+ #
24
+ # For example, you could provide an instance of following classes:
25
+ # * `Aws::Credentials`
26
+ # * `Aws::SharedCredentials`
27
+ # * `Aws::InstanceProfileCredentials`
28
+ # * `Aws::AssumeRoleCredentials`
29
+ # * `Aws::ECSCredentials`
30
+ #
31
+ # @option options [required, string] :region
32
+ # The region name, e.g. 'us-west-2'
33
+ def initialize(options = {})
34
+ @credentials = options.fetch(:credentials)
35
+ @region = options.fetch(:region)
36
+ end
37
+
38
+ # @param [Hash] params parameter inputs for synthesize_speech operation
39
+ def synthesize_speech_presigned_url(params = {})
40
+ input_shape = Client.api.operation(:synthesize_speech).input.shape
41
+ sign_but_dont_send(input_shape, params)
42
+ end
43
+
44
+ private
45
+
46
+ def sign_but_dont_send(input_shape, params)
47
+ parts = []
48
+ input_shape.members.each do |name, ref|
49
+ parts << [ ref, params[name] ] unless params[name].nil?
50
+ end
51
+ query = Aws::Rest::Request::QuerystringBuilder.new.build(parts)
52
+
53
+ signer = Aws::Sigv4::Signer.new(
54
+ service: 'polly',
55
+ region: @region,
56
+ credentials_provider: @credentials
57
+ )
58
+ url = Aws::EndpointProvider.resolve(signer.region, 'polly')
59
+ url += "/v1/speech?#{query}"
60
+ pre_signed_url = signer.presign_url(
61
+ http_method: 'GET',
62
+ url: url,
63
+ body: '',
64
+ expires_in: 900
65
+ ).to_s
66
+ end
67
+ end
68
+
69
+ end
70
+ end
@@ -0,0 +1,6 @@
1
+ Aws.add_service(:Rekognition, {
2
+ api: "#{Aws::API_DIR}/rekognition/2016-06-27/api-2.json",
3
+ docs: "#{Aws::API_DIR}/rekognition/2016-06-27/docs-2.json",
4
+ examples: "#{Aws::API_DIR}/rekognition/2016-06-27/examples-1.json",
5
+ paginators: "#{Aws::API_DIR}/rekognition/2016-06-27/paginators-1.json",
6
+ })
@@ -5,15 +5,13 @@ module Aws
5
5
  module Request
6
6
  class Endpoint
7
7
 
8
- include Seahorse::Model::Shapes
9
-
10
8
  # @param [Seahorse::Model::Shapes::ShapeRef] rules
11
9
  # @param [String] request_uri_pattern
12
10
  def initialize(rules, request_uri_pattern)
13
11
  @rules = rules
14
12
  request_uri_pattern.split('?').tap do |path_part, query_part|
15
13
  @path_pattern = path_part
16
- @query_pattern = query_part
14
+ @query_prefix = query_part
17
15
  end
18
16
  end
19
17
 
@@ -31,7 +29,7 @@ module Aws
31
29
 
32
30
  def apply_path_params(uri, params)
33
31
  path = uri.path.sub(/\/$/, '') + @path_pattern.split('?')[0]
34
- uri.path = path.gsub(/{\w+\+?}/) do |placeholder|
32
+ uri.path = path.gsub(/{.+?}/) do |placeholder|
35
33
  param_value_for_placeholder(placeholder, params)
36
34
  end
37
35
  end
@@ -50,70 +48,17 @@ module Aws
50
48
  end
51
49
 
52
50
  def apply_querystring_params(uri, params)
53
- parts = []
54
- parts << @query_pattern if @query_pattern
55
- @rules.shape.members.each do |member_name, member|
56
- if member.location == 'querystring' && !params[member_name].nil?
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
- when ListShape
77
- if StringShape === member.shape.member.shape
78
- parts += list_of_strings(member.location_name, params[member_name])
79
- else
80
- msg = "Only list of strings supported, got "
81
- msg << member.shape.member.shape.class.name
82
- raise NotImplementedError, msg
83
- end
84
-
85
- # unsupported querystring shape
86
- else
87
- raise NotImplementedError
88
- end
89
-
90
- end
91
- end
92
- uri.query = parts.empty? ? nil : parts.join('&')
93
- end
94
-
95
- def query_map_of_string(hash)
96
- list = []
97
- hash.each_pair do |key, value|
98
- list << "#{escape(key)}=#{escape(value)}"
99
- end
100
- list
101
- end
102
-
103
- def query_map_of_string_list(hash)
104
- list = []
105
- hash.each_pair do |key, values|
106
- values.each do |value|
107
- list << "#{escape(key)}=#{escape(value)}"
51
+ # collect params that are supposed to be part of the query string
52
+ parts = @rules.shape.members.inject([]) do |parts, (member_name, member_ref)|
53
+ if member_ref.location == 'querystring' && !params[member_name].nil?
54
+ parts << [member_ref, params[member_name]]
108
55
  end
56
+ parts
109
57
  end
110
- list
111
- end
112
-
113
- def list_of_strings(name, values)
114
- values.map do |value|
115
- "#{name}=#{escape(value)}"
116
- end
58
+ querystring = QuerystringBuilder.new.build(parts)
59
+ querystring = [@query_prefix, querystring == '' ? nil : querystring].compact.join('&')
60
+ querystring = nil if querystring == ''
61
+ uri.query = querystring
117
62
  end
118
63
 
119
64
  def escape(string)
@@ -0,0 +1,90 @@
1
+ module Aws
2
+ module Rest
3
+ module Request
4
+ class QuerystringBuilder
5
+
6
+ include Seahorse::Model::Shapes
7
+
8
+ # Provide shape references and param values:
9
+ #
10
+ # [
11
+ # [shape_ref1, 123],
12
+ # [shape_ref2, "text"]
13
+ # ]
14
+ #
15
+ # Returns a querystring:
16
+ #
17
+ # "Count=123&Words=text"
18
+ #
19
+ # @param [Array<Array<Seahorse::Model::ShapeRef, Object>>] params An array of
20
+ # model shape references and request parameter value pairs.
21
+ #
22
+ # @return [String] Returns a built querystring
23
+ def build(params)
24
+ params.map do |(shape_ref, param_value)|
25
+ build_part(shape_ref, param_value)
26
+ end.join('&')
27
+ end
28
+
29
+ private
30
+
31
+ def build_part(shape_ref, param_value)
32
+ case shape_ref.shape
33
+ # supported scalar types
34
+ when StringShape, BooleanShape, FloatShape, IntegerShape, StringShape
35
+ param_name = shape_ref.location_name
36
+ "#{param_name}=#{escape(param_value.to_s)}"
37
+ when MapShape
38
+ if StringShape === shape_ref.shape.value.shape
39
+ query_map_of_string(param_value)
40
+ elsif ListShape === shape_ref.shape.value.shape
41
+ query_map_of_string_list(param_value)
42
+ else
43
+ msg = "only map of string and string list supported"
44
+ raise NotImplementedError, msg
45
+ end
46
+ when ListShape
47
+ if StringShape === shape_ref.shape.member.shape
48
+ list_of_strings(shape_ref.location_name, param_value)
49
+ else
50
+ msg = "Only list of strings supported, got "
51
+ msg << shape_ref.shape.member.shape.class.name
52
+ raise NotImplementedError, msg
53
+ end
54
+ else
55
+ raise NotImplementedError
56
+ end
57
+ end
58
+
59
+ def query_map_of_string(hash)
60
+ list = []
61
+ hash.each_pair do |key, value|
62
+ list << "#{escape(key)}=#{escape(value)}"
63
+ end
64
+ list
65
+ end
66
+
67
+ def query_map_of_string_list(hash)
68
+ list = []
69
+ hash.each_pair do |key, values|
70
+ values.each do |value|
71
+ list << "#{escape(key)}=#{escape(value)}"
72
+ end
73
+ end
74
+ list
75
+ end
76
+
77
+ def list_of_strings(name, values)
78
+ values.map do |value|
79
+ "#{name}=#{escape(value)}"
80
+ end
81
+ end
82
+
83
+ def escape(string)
84
+ Seahorse::Util.uri_escape(string)
85
+ end
86
+
87
+ end
88
+ end
89
+ end
90
+ end