aws-sdk-core 2.6.1 → 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.
- checksums.yaml +4 -4
- data/apis/acm/2015-12-08/api-2.json +93 -4
- data/apis/acm/2015-12-08/paginators-1.json +2 -2
- data/apis/apigateway/2015-07-09/api-2.json +640 -30
- data/apis/application-autoscaling/2016-02-06/api-2.json +5 -2
- data/apis/appstream/2016-12-01/api-2.json +820 -0
- data/apis/appstream/2016-12-01/examples-1.json +5 -0
- data/apis/appstream/2016-12-01/waiters-2.json +55 -0
- data/apis/autoscaling/2011-01-01/api-2.json +1 -0
- data/apis/autoscaling/2011-01-01/resources-1.json +12 -1
- data/apis/batch/2016-08-10/api-2.json +885 -0
- data/apis/batch/2016-08-10/examples-1.json +589 -0
- data/apis/budgets/2016-10-20/api-2.json +696 -0
- data/apis/budgets/2016-10-20/examples-1.json +5 -0
- data/apis/cloudformation/2010-05-15/api-2.json +138 -12
- data/apis/cloudformation/2010-05-15/examples-1.json +153 -0
- data/apis/cloudformation/2010-05-15/resources-1.json +10 -1
- data/apis/cloudformation/2010-05-15/waiters-2.json +18 -96
- data/apis/cloudfront/2016-01-28/api-2.json +1 -0
- data/apis/cloudfront/2016-08-01/api-2.json +1 -0
- data/apis/cloudfront/2016-08-20/api-2.json +1 -0
- data/apis/cloudfront/2016-09-07/api-2.json +1 -0
- data/apis/cloudfront/2016-09-29/api-2.json +2599 -0
- data/apis/cloudfront/2016-09-29/examples-1.json +5 -0
- data/apis/cloudfront/2016-09-29/paginators-1.json +32 -0
- data/apis/cloudfront/2016-09-29/waiters-2.json +47 -0
- data/apis/cloudfront/2016-11-25/api-2.json +2665 -0
- data/apis/cloudfront/2016-11-25/examples-1.json +5 -0
- data/apis/cloudfront/2016-11-25/paginators-1.json +32 -0
- data/apis/cloudfront/2016-11-25/waiters-2.json +47 -0
- data/apis/cloudhsm/2014-05-30/api-2.json +2 -1
- data/apis/cloudsearch/2013-01-01/api-2.json +2 -1
- data/apis/cloudsearchdomain/2013-01-01/api-2.json +2 -1
- data/apis/cloudtrail/2013-11-01/api-2.json +109 -3
- data/apis/cloudtrail/2013-11-01/paginators-1.json +6 -0
- data/apis/codebuild/2016-10-06/api-2.json +702 -0
- data/apis/codebuild/2016-10-06/examples-1.json +5 -0
- data/apis/codecommit/2015-04-13/api-2.json +2 -1
- data/apis/codedeploy/2014-10-06/api-2.json +138 -17
- data/apis/codepipeline/2015-07-09/api-2.json +3 -2
- data/apis/cognito-identity/2014-06-30/api-2.json +84 -5
- data/apis/cognito-idp/2016-04-18/api-2.json +472 -10
- data/apis/cognito-sync/2014-06-30/api-2.json +2 -1
- data/apis/config/2014-11-12/api-2.json +40 -9
- data/apis/config/2014-11-12/paginators-1.json +2 -2
- data/apis/cur/2017-01-06/api-2.json +226 -0
- data/apis/cur/2017-01-06/examples-1.json +5 -0
- data/apis/cur/2017-01-06/paginators-1.json +9 -0
- data/apis/datapipeline/2012-10-29/api-2.json +2 -1
- data/apis/devicefarm/2015-06-23/api-2.json +2 -1
- data/apis/devicefarm/2015-06-23/examples-1.json +1237 -0
- data/apis/directconnect/2012-10-25/api-2.json +257 -10
- data/apis/discovery/2015-11-01/api-2.json +316 -5
- data/apis/dms/2016-01-01/api-2.json +45 -9
- data/apis/ds/2015-04-16/api-2.json +144 -1
- data/apis/dynamodb/2011-12-05/api-2.json +802 -0
- data/apis/dynamodb/2011-12-05/examples-1.json +5 -0
- data/apis/dynamodb/2011-12-05/paginators-1.json +26 -0
- data/apis/dynamodb/2011-12-05/waiters-2.json +35 -0
- data/apis/dynamodb/2012-08-10/api-2.json +115 -1
- data/apis/dynamodb/2012-08-10/examples-1.json +623 -0
- data/apis/dynamodb/2012-08-10/paginators-1.json +4 -4
- data/apis/ec2/2015-10-01/api-2.json +1 -0
- data/apis/ec2/2016-04-01/api-2.json +1 -0
- data/apis/ec2/2016-09-15/api-2.json +14415 -0
- data/apis/ec2/2016-09-15/examples-1.json +3740 -0
- data/apis/ec2/2016-09-15/paginators-1.json +138 -0
- data/apis/ec2/2016-09-15/resources-1.json +2582 -0
- data/apis/ec2/2016-09-15/waiters-2.json +593 -0
- data/apis/ec2/2016-11-15/api-2.json +15037 -0
- data/apis/ec2/2016-11-15/examples-1.json +3740 -0
- data/apis/ec2/2016-11-15/paginators-1.json +138 -0
- data/apis/ec2/2016-11-15/resources-1.json +2582 -0
- data/apis/ec2/2016-11-15/waiters-2.json +593 -0
- data/apis/ecr/2015-09-21/api-2.json +88 -4
- data/apis/ecr/2015-09-21/paginators-1.json +12 -6
- data/apis/ecs/2014-11-13/api-2.json +183 -9
- data/apis/elasticache/2015-02-02/api-2.json +57 -9
- data/apis/elasticache/2015-02-02/examples-1.json +2963 -0
- data/apis/elasticbeanstalk/2010-12-01/api-2.json +155 -6
- data/apis/elasticfilesystem/2015-02-01/api-2.json +2 -1
- data/apis/elasticfilesystem/2015-02-01/examples-1.json +217 -0
- data/apis/elasticloadbalancing/2012-06-01/api-2.json +1 -0
- data/apis/elasticloadbalancingv2/2015-12-01/api-2.json +1 -0
- data/apis/elasticmapreduce/2009-03-31/api-2.json +449 -5
- data/apis/elastictranscoder/2012-09-25/api-2.json +44 -13
- data/apis/elastictranscoder/2012-09-25/examples-1.json +5 -0
- data/apis/email/2010-12-01/api-2.json +425 -4
- data/apis/es/2015-01-01/api-2.json +1 -0
- data/apis/events/2015-10-07/api-2.json +1 -0
- data/apis/firehose/2015-08-04/api-2.json +151 -4
- data/apis/firehose/2015-08-04/examples-1.json +5 -0
- data/apis/gamelift/2015-10-01/api-2.json +367 -787
- data/apis/gamelift/2015-10-01/examples-1.json +2 -2
- data/apis/glacier/2012-06-01/api-2.json +369 -779
- data/apis/glacier/2012-06-01/examples-1.json +806 -0
- data/apis/glacier/2012-06-01/paginators-1.json +5 -5
- data/apis/health/2016-08-04/api-2.json +547 -0
- data/apis/health/2016-08-04/examples-1.json +5 -0
- data/apis/health/2016-08-04/paginators-1.json +31 -0
- data/apis/iam/2010-05-08/api-2.json +209 -0
- data/apis/iam/2010-05-08/examples-1.json +1186 -0
- data/apis/importexport/2010-06-01/api-2.json +1 -0
- data/apis/inspector/2016-02-16/api-2.json +2 -1
- data/apis/inspector/2016-02-16/examples-1.json +1135 -0
- data/apis/iot/2015-05-28/api-2.json +16 -0
- data/apis/iot-data/2015-05-28/api-2.json +1 -0
- data/apis/kinesis/2013-12-02/api-2.json +80 -12
- data/apis/kinesisanalytics/2015-08-14/api-2.json +7 -2
- data/apis/kms/2014-11-01/api-2.json +4 -2
- data/apis/kms/2014-11-01/examples-1.json +810 -0
- data/apis/lambda/2014-11-11/api-2.json +1 -0
- data/apis/lambda/2015-03-31/api-2.json +162 -9
- data/apis/lambda/2015-03-31/examples-1.json +609 -0
- data/apis/lightsail/2016-11-28/api-2.json +2137 -0
- data/apis/lightsail/2016-11-28/examples-1.json +5 -0
- data/apis/logs/2014-03-28/api-2.json +113 -6
- data/apis/machinelearning/2014-12-12/api-2.json +1 -0
- data/apis/marketplacecommerceanalytics/2015-07-01/api-2.json +5 -2
- data/apis/meteringmarketplace/2016-01-14/api-2.json +136 -0
- data/apis/monitoring/2010-08-01/api-2.json +27 -6
- data/apis/opsworks/2013-02-18/api-2.json +1 -0
- data/apis/opsworkscm/2016-11-01/api-2.json +712 -0
- data/apis/opsworkscm/2016-11-01/examples-1.json +5 -0
- data/apis/pinpoint/2016-12-01/api-2.json +2753 -0
- data/apis/pinpoint/2016-12-01/examples-1.json +5 -0
- data/apis/polly/2016-06-10/api-2.json +504 -0
- data/apis/polly/2016-06-10/examples-1.json +171 -0
- data/apis/rds/2013-01-10/api-2.json +2902 -0
- data/apis/rds/2013-01-10/examples-1.json +5 -0
- data/apis/rds/2013-01-10/paginators-1.json +97 -0
- data/apis/rds/2013-02-12/api-2.json +3058 -0
- data/apis/rds/2013-02-12/examples-1.json +5 -0
- data/apis/rds/2013-02-12/paginators-1.json +110 -0
- data/apis/rds/2013-09-09/api-2.json +3159 -0
- data/apis/rds/2013-09-09/examples-1.json +5 -0
- data/apis/rds/2013-09-09/paginators-1.json +110 -0
- data/apis/rds/2013-09-09/waiters-2.json +97 -0
- data/apis/rds/2014-09-01/api-2.json +3272 -0
- data/apis/rds/2014-09-01/examples-1.json +5 -0
- data/apis/rds/2014-09-01/paginators-1.json +4 -0
- data/apis/rds/2014-10-31/api-2.json +144 -11
- data/apis/rds/2014-10-31/examples-1.json +332 -4
- data/apis/rds/2014-10-31/paginators-1.json +18 -18
- data/apis/rds/2014-10-31/resources-1.json +1 -1
- data/apis/redshift/2012-12-01/api-2.json +10 -3
- data/apis/rekognition/2016-06-27/api-2.json +836 -0
- data/apis/rekognition/2016-06-27/examples-1.json +651 -0
- data/apis/rekognition/2016-06-27/paginators-1.json +16 -0
- data/apis/route53/2013-04-01/api-2.json +186 -219
- data/apis/route53/2013-04-01/paginators-1.json +9 -9
- data/apis/route53domains/2014-05-15/api-2.json +1 -0
- data/apis/s3/2006-03-01/api-2.json +871 -20
- data/apis/sdb/2009-04-15/api-2.json +1 -0
- data/apis/servicecatalog/2015-12-10/api-2.json +1214 -29
- data/apis/shield/2016-06-02/api-2.json +494 -0
- data/apis/shield/2016-06-02/examples-1.json +5 -0
- data/apis/sms/2016-10-24/api-2.json +612 -0
- data/apis/sms/2016-10-24/examples-1.json +5 -0
- data/apis/sms/2016-10-24/paginators-1.json +28 -0
- data/apis/snowball/2016-06-30/api-2.json +283 -11
- data/apis/snowball/2016-06-30/examples-1.json +437 -0
- data/apis/sns/2010-03-31/api-2.json +1 -0
- data/apis/sqs/2012-11-05/api-2.json +74 -38
- data/apis/sqs/2012-11-05/examples-1.json +0 -39
- data/apis/sqs/2012-11-05/resources-1.json +232 -0
- data/apis/ssm/2014-11-06/api-2.json +4036 -536
- data/apis/states/2016-11-23/api-2.json +1021 -0
- data/apis/states/2016-11-23/examples-1.json +5 -0
- data/apis/states/2016-11-23/paginators-1.json +28 -0
- data/apis/storagegateway/2013-06-30/api-2.json +269 -6
- data/apis/storagegateway/2013-06-30/examples-1.json +1376 -0
- data/apis/streams.dynamodb/2012-08-10/api-2.json +2 -1
- data/apis/streams.dynamodb/2012-08-10/examples-1.json +207 -0
- data/apis/sts/2011-06-15/api-2.json +1 -0
- data/apis/sts/2011-06-15/examples-1.json +201 -0
- data/apis/support/2013-04-15/api-2.json +1 -0
- data/apis/swf/2012-01-25/api-2.json +1 -0
- data/apis/waf/2015-08-24/api-2.json +12 -11
- data/apis/waf/2015-08-24/examples-1.json +1012 -0
- data/apis/waf-regional/2016-11-28/api-2.json +2090 -0
- data/apis/waf-regional/2016-11-28/examples-1.json +1017 -0
- data/apis/workspaces/2015-04-08/api-2.json +1 -0
- data/apis/xray/2016-04-12/api-2.json +491 -0
- data/apis/xray/2016-04-12/examples-1.json +5 -0
- data/endpoints.json +781 -392
- data/lib/aws-sdk-core/api/customizations.rb +16 -0
- data/lib/aws-sdk-core/api/docs/builder.rb +2 -1
- data/lib/aws-sdk-core/api/docs/client_type_documenter.rb +9 -0
- data/lib/aws-sdk-core/api/docs/crosslink.rb +43 -0
- data/lib/aws-sdk-core/api/docs/operation_documenter.rb +11 -2
- data/lib/aws-sdk-core/appstream.rb +6 -0
- data/lib/aws-sdk-core/batch.rb +5 -0
- data/lib/aws-sdk-core/budgets.rb +5 -0
- data/lib/aws-sdk-core/client.rb +1 -0
- data/lib/aws-sdk-core/client_waiters.rb +5 -5
- data/lib/aws-sdk-core/cloudfront/url_signer.rb +1 -1
- data/lib/aws-sdk-core/cloudfront.rb +5 -5
- data/lib/aws-sdk-core/codebuild.rb +5 -0
- data/lib/aws-sdk-core/costandusagereportservice.rb +6 -0
- data/lib/aws-sdk-core/credential_provider_chain.rb +3 -3
- data/lib/aws-sdk-core/cur.rb +6 -0
- data/lib/aws-sdk-core/ec2.rb +6 -6
- data/lib/aws-sdk-core/elastictranscoder.rb +1 -0
- data/lib/aws-sdk-core/firehose.rb +1 -0
- data/lib/aws-sdk-core/glacier.rb +1 -0
- data/lib/aws-sdk-core/health.rb +6 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +1 -1
- data/lib/aws-sdk-core/lightsail.rb +5 -0
- data/lib/aws-sdk-core/opsworkscm.rb +5 -0
- data/lib/aws-sdk-core/partitions/region.rb +0 -12
- data/lib/aws-sdk-core/partitions/service.rb +1 -11
- data/lib/aws-sdk-core/pinpoint.rb +5 -0
- data/lib/aws-sdk-core/plugins/ec2_copy_encrypted_snapshot.rb +24 -55
- data/lib/aws-sdk-core/plugins/idempotency_token.rb +37 -0
- data/lib/aws-sdk-core/plugins/rds_cross_region_copying.rb +64 -0
- data/lib/aws-sdk-core/plugins/request_signer.rb +4 -0
- data/lib/aws-sdk-core/plugins/retry_errors.rb +1 -0
- data/lib/aws-sdk-core/plugins/s3_accelerate.rb +18 -1
- data/lib/aws-sdk-core/plugins/s3_bucket_dns.rb +1 -1
- data/lib/aws-sdk-core/plugins/s3_dualstack.rb +6 -9
- data/lib/aws-sdk-core/plugins/sqs_md5s.rb +1 -1
- data/lib/aws-sdk-core/polly/presigner.rb +70 -0
- data/lib/aws-sdk-core/polly.rb +13 -0
- data/lib/aws-sdk-core/rekognition.rb +6 -0
- data/lib/aws-sdk-core/rest/request/endpoint.rb +11 -66
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +90 -0
- data/lib/aws-sdk-core/shield.rb +5 -0
- data/lib/aws-sdk-core/signers/v4.rb +2 -1
- data/lib/aws-sdk-core/sms.rb +6 -0
- data/lib/aws-sdk-core/sqs.rb +1 -0
- data/lib/aws-sdk-core/states.rb +6 -0
- data/lib/aws-sdk-core/version.rb +1 -1
- data/lib/aws-sdk-core/wafregional.rb +5 -0
- data/lib/aws-sdk-core/xray.rb +5 -0
- data/lib/aws-sdk-core.rb +20 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +11 -7
- data/lib/seahorse/client/net_http/handler.rb +5 -2
- data/lib/seahorse/client/plugin_list.rb +3 -1
- data/lib/seahorse/client/response.rb +9 -20
- data/service-models.json +66 -2
- metadata +115 -2
|
@@ -8,6 +8,7 @@ module Aws
|
|
|
8
8
|
class S3Dualstack < Seahorse::Client::Plugin
|
|
9
9
|
|
|
10
10
|
option(:use_dualstack_endpoint, false)
|
|
11
|
+
option(:use_accelerate_endpoint, false)
|
|
11
12
|
|
|
12
13
|
def add_handlers(handlers, config)
|
|
13
14
|
handlers.add(OptionHandler, step: :initialize)
|
|
@@ -27,12 +28,12 @@ module Aws
|
|
|
27
28
|
# @api private
|
|
28
29
|
class DualstackHandler < Seahorse::Client::Handler
|
|
29
30
|
def call(context)
|
|
30
|
-
|
|
31
|
+
apply_dualstack_endpoint(context) if use_dualstack_endpoint?(context)
|
|
31
32
|
@handler.call(context)
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
private
|
|
35
|
-
def
|
|
36
|
+
def apply_dualstack_endpoint(context)
|
|
36
37
|
bucket_name = context.params[:bucket]
|
|
37
38
|
region = context.config.region
|
|
38
39
|
force_path_style = context.config.force_path_style
|
|
@@ -55,16 +56,12 @@ module Aws
|
|
|
55
56
|
bucket_name && S3BucketDns.dns_compatible?(bucket_name, ssl) &&
|
|
56
57
|
!context.config.force_path_style
|
|
57
58
|
end
|
|
58
|
-
end
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if cfg.use_accelerate_endpoint && cfg.use_dualstack_endpoint
|
|
63
|
-
msg = "Use of the :use_accelerate_endpoint and :use_dualstack_endpoint"\
|
|
64
|
-
" options together is not currently supported."
|
|
65
|
-
raise ArgumentError, msg
|
|
60
|
+
def use_dualstack_endpoint?(context)
|
|
61
|
+
context[:use_dualstack_endpoint] && !context[:use_accelerate_endpoint]
|
|
66
62
|
end
|
|
67
63
|
end
|
|
64
|
+
|
|
68
65
|
end
|
|
69
66
|
end
|
|
70
67
|
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,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,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
|
-
@
|
|
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(/{
|
|
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
|
-
|
|
54
|
-
parts
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
data/lib/aws-sdk-core/sqs.rb
CHANGED
|
@@ -3,4 +3,5 @@ Aws.add_service(:SQS, {
|
|
|
3
3
|
docs: "#{Aws::API_DIR}/sqs/2012-11-05/docs-2.json",
|
|
4
4
|
examples: "#{Aws::API_DIR}/sqs/2012-11-05/examples-1.json",
|
|
5
5
|
paginators: "#{Aws::API_DIR}/sqs/2012-11-05/paginators-1.json",
|
|
6
|
+
resources: "#{Aws::API_DIR}/sqs/2012-11-05/resources-1.json",
|
|
6
7
|
})
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Aws.add_service(:States, {
|
|
2
|
+
api: "#{Aws::API_DIR}/states/2016-11-23/api-2.json",
|
|
3
|
+
docs: "#{Aws::API_DIR}/states/2016-11-23/docs-2.json",
|
|
4
|
+
examples: "#{Aws::API_DIR}/states/2016-11-23/examples-1.json",
|
|
5
|
+
paginators: "#{Aws::API_DIR}/states/2016-11-23/paginators-1.json",
|
|
6
|
+
})
|
data/lib/aws-sdk-core/version.rb
CHANGED
data/lib/aws-sdk-core.rb
CHANGED
|
@@ -23,7 +23,11 @@ module Aws
|
|
|
23
23
|
APIGateway
|
|
24
24
|
ApplicationAutoScaling
|
|
25
25
|
ApplicationDiscoveryService
|
|
26
|
+
AppStream
|
|
26
27
|
AutoScaling
|
|
28
|
+
Batch
|
|
29
|
+
Budgets
|
|
30
|
+
CodeBuild
|
|
27
31
|
CloudFormation
|
|
28
32
|
CloudFront
|
|
29
33
|
CloudHSM
|
|
@@ -40,6 +44,7 @@ module Aws
|
|
|
40
44
|
CognitoIdentityProvider
|
|
41
45
|
CognitoSync
|
|
42
46
|
ConfigService
|
|
47
|
+
CostandUsageReportService
|
|
43
48
|
DatabaseMigrationService
|
|
44
49
|
DataPipeline
|
|
45
50
|
DeviceFarm
|
|
@@ -61,6 +66,7 @@ module Aws
|
|
|
61
66
|
Firehose
|
|
62
67
|
GameLift
|
|
63
68
|
Glacier
|
|
69
|
+
Health
|
|
64
70
|
IAM
|
|
65
71
|
ImportExport
|
|
66
72
|
Inspector
|
|
@@ -71,28 +77,38 @@ module Aws
|
|
|
71
77
|
KMS
|
|
72
78
|
Lambda
|
|
73
79
|
LambdaPreview
|
|
80
|
+
Lightsail
|
|
74
81
|
MachineLearning
|
|
75
82
|
MarketplaceCommerceAnalytics
|
|
76
83
|
MarketplaceMetering
|
|
77
84
|
OpsWorks
|
|
85
|
+
OpsWorksCM
|
|
86
|
+
Pinpoint
|
|
87
|
+
Polly
|
|
78
88
|
RDS
|
|
89
|
+
Rekognition
|
|
79
90
|
Redshift
|
|
80
91
|
Route53
|
|
81
92
|
Route53Domains
|
|
82
93
|
S3
|
|
83
94
|
ServiceCatalog
|
|
84
95
|
SES
|
|
96
|
+
Shield
|
|
85
97
|
SimpleDB
|
|
98
|
+
SMS
|
|
86
99
|
SNS
|
|
87
100
|
Snowball
|
|
88
101
|
SQS
|
|
89
102
|
SSM
|
|
103
|
+
States
|
|
90
104
|
StorageGateway
|
|
91
105
|
STS
|
|
92
106
|
Support
|
|
93
107
|
SWF
|
|
94
108
|
WAF
|
|
109
|
+
WAFRegional
|
|
95
110
|
WorkSpaces
|
|
111
|
+
XRay
|
|
96
112
|
)
|
|
97
113
|
# end services
|
|
98
114
|
|
|
@@ -143,6 +159,7 @@ module Aws
|
|
|
143
159
|
module Docs
|
|
144
160
|
autoload :Builder, 'aws-sdk-core/api/docs/builder'
|
|
145
161
|
autoload :ClientTypeDocumenter, 'aws-sdk-core/api/docs/client_type_documenter'
|
|
162
|
+
autoload :Crosslink, 'aws-sdk-core/api/docs/crosslink'
|
|
146
163
|
autoload :DocstringProvider, 'aws-sdk-core/api/docs/docstring_provider'
|
|
147
164
|
autoload :NullDocstringProvider, 'aws-sdk-core/api/docs/docstring_provider'
|
|
148
165
|
autoload :OperationDocumenter, 'aws-sdk-core/api/docs/operation_documenter'
|
|
@@ -173,10 +190,12 @@ module Aws
|
|
|
173
190
|
autoload :GlacierChecksums, 'aws-sdk-core/plugins/glacier_checksums'
|
|
174
191
|
autoload :GlobalConfiguration, 'aws-sdk-core/plugins/global_configuration'
|
|
175
192
|
autoload :HelpfulSocketErrors, 'aws-sdk-core/plugins/helpful_socket_errors'
|
|
193
|
+
autoload :IdempotencyToken, 'aws-sdk-core/plugins/idempotency_token'
|
|
176
194
|
autoload :Logging, 'aws-sdk-core/plugins/logging'
|
|
177
195
|
autoload :MachineLearningPredictEndpoint, 'aws-sdk-core/plugins/machine_learning_predict_endpoint'
|
|
178
196
|
autoload :ParamConverter, 'aws-sdk-core/plugins/param_converter'
|
|
179
197
|
autoload :ParamValidator, 'aws-sdk-core/plugins/param_validator'
|
|
198
|
+
autoload :RDSCrossRegionCopying, 'aws-sdk-core/plugins/rds_cross_region_copying'
|
|
180
199
|
autoload :RegionalEndpoint, 'aws-sdk-core/plugins/regional_endpoint'
|
|
181
200
|
autoload :ResponsePaging, 'aws-sdk-core/plugins/response_paging'
|
|
182
201
|
autoload :RequestSigner, 'aws-sdk-core/plugins/request_signer'
|
|
@@ -228,6 +247,7 @@ module Aws
|
|
|
228
247
|
autoload :Builder, 'aws-sdk-core/rest/request/builder'
|
|
229
248
|
autoload :Endpoint, 'aws-sdk-core/rest/request/endpoint'
|
|
230
249
|
autoload :Headers, 'aws-sdk-core/rest/request/headers'
|
|
250
|
+
autoload :QuerystringBuilder, 'aws-sdk-core/rest/request/querystring_builder'
|
|
231
251
|
end
|
|
232
252
|
module Response
|
|
233
253
|
autoload :Body, 'aws-sdk-core/rest/response/body'
|
|
@@ -36,10 +36,7 @@ module Seahorse
|
|
|
36
36
|
instance_variable_set("@#{opt_name}", value)
|
|
37
37
|
end
|
|
38
38
|
@pool_mutex = Mutex.new
|
|
39
|
-
@pool =
|
|
40
|
-
pool[endpoint] = []
|
|
41
|
-
pool[endpoint]
|
|
42
|
-
end
|
|
39
|
+
@pool = {}
|
|
43
40
|
end
|
|
44
41
|
|
|
45
42
|
OPTIONS.keys.each do |attr_name|
|
|
@@ -86,7 +83,9 @@ module Seahorse
|
|
|
86
83
|
# attempt to recycle an already open session
|
|
87
84
|
@pool_mutex.synchronize do
|
|
88
85
|
_clean
|
|
89
|
-
|
|
86
|
+
if @pool.key?(endpoint)
|
|
87
|
+
session = @pool[endpoint].shift
|
|
88
|
+
end
|
|
90
89
|
end
|
|
91
90
|
|
|
92
91
|
begin
|
|
@@ -100,7 +99,10 @@ module Seahorse
|
|
|
100
99
|
raise
|
|
101
100
|
else
|
|
102
101
|
# No error raised? Good, check the session into the pool.
|
|
103
|
-
@pool_mutex.synchronize
|
|
102
|
+
@pool_mutex.synchronize do
|
|
103
|
+
@pool[endpoint] = [] unless @pool.key?(endpoint)
|
|
104
|
+
@pool[endpoint] << session
|
|
105
|
+
end
|
|
104
106
|
end
|
|
105
107
|
nil
|
|
106
108
|
end
|
|
@@ -214,7 +216,9 @@ module Seahorse
|
|
|
214
216
|
# @return [Array<ConnectionPool>] Returns a list of of the
|
|
215
217
|
# constructed connection pools.
|
|
216
218
|
def pools
|
|
217
|
-
@
|
|
219
|
+
@pools_mutex.synchronize do
|
|
220
|
+
@pools.values
|
|
221
|
+
end
|
|
218
222
|
end
|
|
219
223
|
|
|
220
224
|
private
|
|
@@ -30,7 +30,10 @@ module Seahorse
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# @api private
|
|
33
|
-
|
|
33
|
+
DNS_ERROR_MESSAGES = [
|
|
34
|
+
'getaddrinfo: nodename nor servname provided, or not known', # MacOS
|
|
35
|
+
'getaddrinfo: Name or service not known' # GNU
|
|
36
|
+
]
|
|
34
37
|
|
|
35
38
|
# Raised when a {Handler} cannot construct a `Net::HTTP::Request`
|
|
36
39
|
# from the given http verb.
|
|
@@ -52,7 +55,7 @@ module Seahorse
|
|
|
52
55
|
private
|
|
53
56
|
|
|
54
57
|
def error_message(req, error)
|
|
55
|
-
if error.is_a?(SocketError) && error.message
|
|
58
|
+
if error.is_a?(SocketError) && DNS_ERROR_MESSAGES.include?(error.message)
|
|
56
59
|
host = req.endpoint.host
|
|
57
60
|
"unable to connect to `#{host}`; SocketError: #{error.message}"
|
|
58
61
|
else
|
|
@@ -87,7 +87,9 @@ module Seahorse
|
|
|
87
87
|
@canonical_name = plugin.name || plugin.object_id
|
|
88
88
|
@plugin = plugin
|
|
89
89
|
when Symbol, String
|
|
90
|
-
|
|
90
|
+
words = plugin.to_s.split('.')
|
|
91
|
+
@canonical_name = words.pop
|
|
92
|
+
@gem_name = words.empty? ? nil : words.join('.')
|
|
91
93
|
@plugin = nil
|
|
92
94
|
else
|
|
93
95
|
@canonical_name = plugin.object_id
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
require 'delegate'
|
|
2
|
+
|
|
1
3
|
module Seahorse
|
|
2
4
|
module Client
|
|
3
|
-
class Response
|
|
5
|
+
class Response < Delegator
|
|
4
6
|
|
|
5
7
|
# @option options [RequestContext] :context (nil)
|
|
6
8
|
# @option options [Integer] :status_code (nil)
|
|
@@ -63,29 +65,16 @@ module Seahorse
|
|
|
63
65
|
self
|
|
64
66
|
end
|
|
65
67
|
|
|
68
|
+
# Necessary to define as a subclass of Delegator
|
|
66
69
|
# @api private
|
|
67
|
-
def
|
|
68
|
-
@data
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# @api private
|
|
72
|
-
def pretty_print(q)
|
|
73
|
-
@data.pretty_print(q)
|
|
70
|
+
def __getobj__
|
|
71
|
+
@data
|
|
74
72
|
end
|
|
75
73
|
|
|
74
|
+
# Necessary to define as a subclass of Delegator
|
|
76
75
|
# @api private
|
|
77
|
-
def
|
|
78
|
-
@data
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
private
|
|
82
|
-
|
|
83
|
-
def method_missing(*args, &block)
|
|
84
|
-
if @data.respond_to?(args.first, false)
|
|
85
|
-
@data.send(*args, &block)
|
|
86
|
-
else
|
|
87
|
-
super
|
|
88
|
-
end
|
|
76
|
+
def __setobj__(obj)
|
|
77
|
+
@data = obj
|
|
89
78
|
end
|
|
90
79
|
|
|
91
80
|
end
|