aws-sdk-core 2.0.0.rc14 → 2.0.0.rc15
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/README.md +32 -3
- data/apis/AutoScaling.api.json +1943 -0
- data/apis/{autoscaling-2011-01-01.paginators.json → AutoScaling.paginators.json} +0 -0
- data/apis/CloudFormation.api.json +785 -0
- data/apis/{cloudformation-2010-05-15.paginators.json → CloudFormation.paginators.json} +0 -0
- data/apis/CloudFront.api.json +2581 -0
- data/apis/{cloudfront-2014-05-31.paginators.json → CloudFront.paginators.json} +0 -0
- data/apis/{cloudfront-2014-01-31.waiters.json → CloudFront.waiters.json} +0 -0
- data/apis/CloudSearch.api.json +1955 -0
- data/apis/{cloudsearch-2013-01-01.paginators.json → CloudSearch.paginators.json} +0 -0
- data/apis/CloudSearchDomain.api.json +349 -0
- data/apis/CloudTrail.api.json +559 -0
- data/apis/{cloudtrail-2013-11-01.paginators.json → CloudTrail.paginators.json} +0 -0
- data/apis/CloudWatch.api.json +917 -0
- data/apis/{monitoring-2010-08-01.paginators.json → CloudWatch.paginators.json} +0 -0
- data/apis/CloudWatchLogs.api.json +816 -0
- data/apis/{logs-2014-03-28.paginators.json → CloudWatchLogs.paginators.json} +0 -0
- data/apis/CognitoIdentity.api.json +631 -0
- data/apis/CognitoSync.api.json +721 -0
- data/apis/DataPipeline.api.json +940 -0
- data/apis/{datapipeline-2012-10-29.paginators.json → DataPipeline.paginators.json} +0 -0
- data/apis/DirectConnect.api.json +833 -0
- data/apis/{directconnect-2012-10-25.paginators.json → DirectConnect.paginators.json} +0 -0
- data/apis/DynamoDB.api.json +1210 -0
- data/apis/{dynamodb-2011-12-05.paginators.json → DynamoDB.paginators.json} +0 -0
- data/apis/{dynamodb-2012-08-10.waiters.json → DynamoDB.waiters.json} +0 -0
- data/apis/EC2.api.json +9914 -0
- data/apis/{ec2-2014-06-15.paginators.json → EC2.paginators.json} +0 -0
- data/apis/{ec2-2014-06-15.resources.json → EC2.resources.json} +0 -0
- data/apis/{ec2-2014-06-15.waiters.json → EC2.waiters.json} +0 -0
- data/apis/EMR.api.json +1339 -0
- data/apis/{elasticmapreduce-2009-03-31.paginators.json → EMR.paginators.json} +0 -0
- data/apis/ElastiCache.api.json +3410 -0
- data/apis/{elasticache-2014-03-24.paginators.json → ElastiCache.paginators.json} +0 -0
- data/apis/ElasticBeanstalk.api.json +1540 -0
- data/apis/{elasticbeanstalk-2010-12-01.paginators.json → ElasticBeanstalk.paginators.json} +0 -0
- data/apis/ElasticLoadBalancing.api.json +2131 -0
- data/apis/{elasticloadbalancing-2012-06-01.paginators.json → ElasticLoadBalancing.paginators.json} +0 -0
- data/apis/ElasticTranscoder.api.json +1647 -0
- data/apis/{elastictranscoder-2012-09-25.paginators.json → ElasticTranscoder.paginators.json} +0 -0
- data/apis/Glacier.api.json +1456 -0
- data/apis/{glacier-2012-06-01.paginators.json → Glacier.paginators.json} +0 -0
- data/apis/{glacier-2012-06-01.resources.json → Glacier.resources.json} +0 -0
- data/apis/{glacier-2012-06-01.waiters.json → Glacier.waiters.json} +0 -0
- data/apis/IAM.api.json +4033 -0
- data/apis/{iam-2010-05-08.paginators.json → IAM.paginators.json} +0 -0
- data/apis/{iam-2010-05-08.resources.json → IAM.resources.json} +0 -0
- data/apis/ImportExport.api.json +515 -0
- data/apis/{importexport-2010-06-01.paginators.json → ImportExport.paginators.json} +0 -0
- data/apis/Kinesis.api.json +548 -0
- data/apis/{kinesis-2013-12-02.paginators.json → Kinesis.paginators.json} +0 -0
- data/apis/OpsWorks.api.json +2524 -0
- data/apis/{opsworks-2013-02-18.paginators.json → OpsWorks.paginators.json} +0 -0
- data/apis/RDS.api.json +4473 -0
- data/apis/{rds-2013-02-12.paginators.json → RDS.paginators.json} +0 -0
- data/apis/{rds-2013-09-09.waiters.json → RDS.waiters.json} +0 -0
- data/apis/Redshift.api.json +4482 -0
- data/apis/{redshift-2012-12-01.paginators.json → Redshift.paginators.json} +0 -0
- data/apis/{redshift-2012-12-01.waiters.json → Redshift.waiters.json} +0 -0
- data/apis/Route53.api.json +1935 -0
- data/apis/{route53-2013-04-01.paginators.json → Route53.paginators.json} +0 -0
- data/apis/Route53Domains.api.json +1129 -0
- data/apis/{s3-2006-03-01.api.json → S3.api.json} +336 -942
- data/apis/{s3-2006-03-01.paginators.json → S3.paginators.json} +1 -1
- data/apis/{s3-2006-03-01.resources.json → S3.resources.json} +0 -0
- data/apis/{s3-2006-03-01.waiters.json → S3.waiters.json} +0 -0
- data/apis/SES.api.json +644 -0
- data/apis/{email-2010-12-01.paginators.json → SES.paginators.json} +0 -0
- data/apis/{email-2010-12-01.waiters.json → SES.waiters.json} +0 -0
- data/apis/SNS.api.json +1760 -0
- data/apis/{sns-2010-03-31.paginators.json → SNS.paginators.json} +0 -0
- data/apis/{sns-2010-03-31.resources.json → SNS.resources.json} +0 -0
- data/apis/SQS.api.json +1113 -0
- data/apis/{sqs-2012-11-05.paginators.json → SQS.paginators.json} +0 -0
- data/apis/{sqs-2012-11-05.resources.json → SQS.resources.json} +0 -0
- data/apis/STS.api.json +594 -0
- data/apis/SWF.api.json +2656 -0
- data/apis/{swf-2012-01-25.paginators.json → SWF.paginators.json} +0 -0
- data/apis/SimpleDB.api.json +954 -0
- data/apis/{sdb-2009-04-15.paginators.json → SimpleDB.paginators.json} +0 -0
- data/apis/StorageGateway.api.json +2311 -0
- data/apis/{storagegateway-2013-06-30.paginators.json → StorageGateway.paginators.json} +0 -0
- data/apis/Support.api.json +869 -0
- data/apis/{support-2013-04-15.paginators.json → Support.paginators.json} +0 -0
- data/lib/aws.rb +96 -53
- data/lib/aws/api/documenter.rb +238 -0
- data/lib/aws/api/{documentor.rb → operation_documenter.rb} +9 -5
- data/lib/aws/api/{doc_example.rb → operation_example.rb} +8 -7
- data/lib/aws/api/service_customizations.rb +3 -1
- data/lib/aws/client.rb +38 -0
- data/lib/aws/credential_provider_chain.rb +1 -0
- data/lib/aws/dynamodb/attribute_value.rb +87 -0
- data/lib/aws/empty_structure.rb +4 -3
- data/lib/aws/endpoint_provider.rb +1 -0
- data/lib/aws/errors.rb +2 -0
- data/lib/aws/instance_profile_credentials.rb +1 -1
- data/lib/aws/plugins/csd_conditional_signing.rb +32 -0
- data/lib/aws/plugins/dynamodb_simple_attributes.rb +179 -0
- data/lib/aws/plugins/global_configuration.rb +13 -3
- data/lib/aws/plugins/protocols/json_rpc.rb +9 -7
- data/lib/aws/plugins/regional_endpoint.rb +1 -1
- data/lib/aws/plugins/request_signer.rb +13 -6
- data/lib/aws/plugins/response_paging.rb +1 -2
- data/lib/aws/plugins/s3_url_encoded_keys.rb +92 -0
- data/lib/aws/plugins/user_agent.rb +1 -2
- data/lib/aws/signers/v4.rb +1 -1
- data/lib/aws/structure.rb +49 -2
- data/lib/aws/version.rb +1 -1
- data/lib/aws/xml/builder.rb +1 -0
- data/lib/seahorse.rb +2 -1
- data/lib/seahorse/client/handler_list.rb +10 -3
- data/lib/seahorse/client/http/request.rb +0 -8
- data/lib/seahorse/client/xml/builder.rb +0 -1
- data/lib/seahorse/model/shape_map.rb +1 -0
- data/lib/seahorse/model/shapes.rb +5 -0
- metadata +93 -107
- data/apis/autoscaling-2011-01-01.api.json +0 -3063
- data/apis/cloudformation-2010-05-15.api.json +0 -1306
- data/apis/cloudfront-2014-01-31.api.json +0 -3478
- data/apis/cloudfront-2014-01-31.paginators.json +0 -32
- data/apis/cloudfront-2014-05-31.api.json +0 -3540
- data/apis/cloudfront-2014-05-31.waiters.json +0 -29
- data/apis/cloudsearch-2011-02-01.api.json +0 -2093
- data/apis/cloudsearch-2011-02-01.paginators.json +0 -13
- data/apis/cloudsearch-2013-01-01.api.json +0 -2655
- data/apis/cloudsearchdomain-2013-01-01.api.json +0 -508
- data/apis/cloudtrail-2013-11-01.api.json +0 -773
- data/apis/cognito-identity-2014-06-30.api.json +0 -884
- data/apis/cognito-sync-2014-06-30.api.json +0 -1029
- data/apis/datapipeline-2012-10-29.api.json +0 -1432
- data/apis/directconnect-2012-10-25.api.json +0 -1174
- data/apis/dynamodb-2011-12-05.api.json +0 -1208
- data/apis/dynamodb-2011-12-05.waiters.json +0 -27
- data/apis/dynamodb-2012-08-10.api.json +0 -1857
- data/apis/dynamodb-2012-08-10.paginators.json +0 -26
- data/apis/ec2-2014-06-15.api.json +0 -11670
- data/apis/elasticache-2014-03-24.api.json +0 -4789
- data/apis/elasticache-2014-07-15.api.json +0 -4826
- data/apis/elasticache-2014-07-15.paginators.json +0 -76
- data/apis/elasticbeanstalk-2010-12-01.api.json +0 -2442
- data/apis/elasticloadbalancing-2012-06-01.api.json +0 -2605
- data/apis/elasticmapreduce-2009-03-31.api.json +0 -2282
- data/apis/elastictranscoder-2012-09-25.api.json +0 -2478
- data/apis/email-2010-12-01.api.json +0 -954
- data/apis/glacier-2012-06-01.api.json +0 -2012
- data/apis/iam-2010-05-08.api.json +0 -5322
- data/apis/importexport-2010-06-01.api.json +0 -687
- data/apis/kinesis-2013-12-02.api.json +0 -769
- data/apis/logs-2014-03-28.api.json +0 -942
- data/apis/manifest.json +0 -259
- data/apis/monitoring-2010-08-01.api.json +0 -1338
- data/apis/opsworks-2013-02-18.api.json +0 -4348
- data/apis/rds-2013-01-10.api.json +0 -6074
- data/apis/rds-2013-01-10.paginators.json +0 -97
- data/apis/rds-2013-02-12.api.json +0 -6392
- data/apis/rds-2013-09-09.api.json +0 -6564
- data/apis/rds-2013-09-09.paginators.json +0 -110
- data/apis/redshift-2012-12-01.api.json +0 -6318
- data/apis/route53-2013-04-01.api.json +0 -2493
- data/apis/route53domains-2014-05-15.api.json +0 -1622
- data/apis/sdb-2009-04-15.api.json +0 -1178
- data/apis/sns-2010-03-31.api.json +0 -2275
- data/apis/sqs-2012-11-05.api.json +0 -1438
- data/apis/storagegateway-2013-06-30.api.json +0 -3153
- data/apis/sts-2011-06-15.api.json +0 -786
- data/apis/support-2013-04-15.api.json +0 -1379
- data/apis/swf-2012-01-25.api.json +0 -4463
- data/lib/aws/api/manifest.rb +0 -29
- data/lib/aws/api/manifest_builder.rb +0 -57
- data/lib/aws/api/minifier.rb +0 -42
- data/lib/aws/response_handler.rb +0 -38
- data/lib/aws/service_builder.rb +0 -56
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'set'
|
|
2
|
+
|
|
1
3
|
module Aws
|
|
2
4
|
module Plugins
|
|
3
5
|
|
|
@@ -38,6 +40,9 @@ module Aws
|
|
|
38
40
|
#
|
|
39
41
|
class GlobalConfiguration < Seahorse::Client::Plugin
|
|
40
42
|
|
|
43
|
+
# @api private
|
|
44
|
+
IDENTIFIERS = Set.new
|
|
45
|
+
|
|
41
46
|
# @api private
|
|
42
47
|
def before_initialize(client_class, options)
|
|
43
48
|
# apply service specific defaults before the global aws defaults
|
|
@@ -48,7 +53,7 @@ module Aws
|
|
|
48
53
|
private
|
|
49
54
|
|
|
50
55
|
def apply_service_defaults(client_class, options)
|
|
51
|
-
if defaults = Aws.config[client_class
|
|
56
|
+
if defaults = Aws.config[client_class.identifier]
|
|
52
57
|
defaults.each do |option_name, default|
|
|
53
58
|
options[option_name] = default unless options.key?(option_name)
|
|
54
59
|
end
|
|
@@ -57,8 +62,7 @@ module Aws
|
|
|
57
62
|
|
|
58
63
|
def apply_aws_defaults(client_class, options)
|
|
59
64
|
Aws.config.each do |option_name, default|
|
|
60
|
-
next if
|
|
61
|
-
next if Aws.services.key?(option_name)
|
|
65
|
+
next if IDENTIFIERS.include?(option_name)
|
|
62
66
|
next if options.key?(option_name)
|
|
63
67
|
options[option_name] = default
|
|
64
68
|
end
|
|
@@ -66,4 +70,10 @@ module Aws
|
|
|
66
70
|
|
|
67
71
|
end
|
|
68
72
|
end
|
|
73
|
+
|
|
74
|
+
service_added do |name, _, _|
|
|
75
|
+
Plugins::GlobalConfiguration::IDENTIFIERS << name.downcase.to_sym
|
|
76
|
+
end
|
|
77
|
+
|
|
69
78
|
end
|
|
79
|
+
|
|
@@ -3,13 +3,15 @@ module Aws
|
|
|
3
3
|
module Protocols
|
|
4
4
|
|
|
5
5
|
# @seahorse.client.option [Boolean] :simple_json (false)
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
6
|
+
# Disables request parameter conversion, validation, and formatting.
|
|
7
|
+
# Also disable response data type conversions. This option is useful
|
|
8
|
+
# when you want to ensure the highest level of performance by
|
|
9
|
+
# avoiding overhead of walking request parameters and response data
|
|
10
|
+
# structures.
|
|
11
|
+
#
|
|
12
|
+
# When `:simple_json` is enabled, the request parameters hash must
|
|
13
|
+
# be formatted exactly as the DynamoDB API expects.
|
|
14
|
+
#
|
|
13
15
|
class JsonRpc < Seahorse::Client::Plugin
|
|
14
16
|
|
|
15
17
|
option(:simple_json, false)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Aws
|
|
2
2
|
module Plugins
|
|
3
3
|
|
|
4
|
-
# @seahorse.client.option [String] :region
|
|
4
|
+
# @seahorse.client.option [required, String] :region
|
|
5
5
|
# The AWS region to connect to. The region is used to construct
|
|
6
6
|
# the client endpoint. Defaults to `ENV['AWS_DEFAULT_REGION']`.
|
|
7
7
|
# Also checks `AWS_REGION` and `AMAZON_REGION`.
|
|
@@ -79,22 +79,29 @@ module Aws
|
|
|
79
79
|
@handler.call(context)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
private
|
|
83
|
+
|
|
82
84
|
def sign_authenticated_requests(context)
|
|
83
85
|
if signer = SIGNERS[context.config.signature_version]
|
|
86
|
+
require_credentials(context)
|
|
84
87
|
signer.sign(context)
|
|
85
88
|
end
|
|
86
89
|
end
|
|
87
90
|
|
|
91
|
+
def require_credentials(context)
|
|
92
|
+
if
|
|
93
|
+
context.config.credentials.nil? or
|
|
94
|
+
!context.config.credentials.set?
|
|
95
|
+
then
|
|
96
|
+
msg = 'unable to sign request without credentials set'
|
|
97
|
+
raise Errors::MissingCredentialsError, msg
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
88
101
|
end
|
|
89
102
|
|
|
90
103
|
handler(Handler, step: :sign)
|
|
91
104
|
|
|
92
|
-
def after_initialize(client)
|
|
93
|
-
if client.config.credentials.nil? or !client.config.credentials.set?
|
|
94
|
-
raise Errors::MissingCredentialsError
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
105
|
end
|
|
99
106
|
end
|
|
100
107
|
end
|
|
@@ -6,8 +6,7 @@ module Aws
|
|
|
6
6
|
class Handler < Seahorse::Client::Handler
|
|
7
7
|
|
|
8
8
|
def call(context)
|
|
9
|
-
|
|
10
|
-
pager = paging_provider.pager(context.operation.name)
|
|
9
|
+
pager = context.client.class.paginators.pager(context.operation.name)
|
|
11
10
|
PageableResponse.new(@handler.call(context), pager)
|
|
12
11
|
end
|
|
13
12
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Aws
|
|
4
|
+
module Plugins
|
|
5
|
+
|
|
6
|
+
# This plugin auto-populates the `:encoding_type` request parameter
|
|
7
|
+
# to all calls made to Amazon S3 that accept it.
|
|
8
|
+
#
|
|
9
|
+
# This enables Amazon S3 to return object keys that might contain
|
|
10
|
+
# invalid XML characters as URL encoded strings. This plugin also
|
|
11
|
+
# automatically decodes these keys so that the key management is
|
|
12
|
+
# transparent to the user.
|
|
13
|
+
#
|
|
14
|
+
# If you specify the `:encoding_type` parameter, then this plugin
|
|
15
|
+
# will be disabled, and you will need to decode the keys yourself.
|
|
16
|
+
#
|
|
17
|
+
# The following operations are managed:
|
|
18
|
+
#
|
|
19
|
+
# * {S3::Client#list_objects}
|
|
20
|
+
# * {S3::Client#list_multipart_uploads}
|
|
21
|
+
# * {S3::Client#list_object_versions}
|
|
22
|
+
#
|
|
23
|
+
class S3UrlEncodedKeys < Seahorse::Client::Plugin
|
|
24
|
+
|
|
25
|
+
class Handler < Seahorse::Client::Handler
|
|
26
|
+
|
|
27
|
+
def call(context)
|
|
28
|
+
if context.params.key?(:encoding_type)
|
|
29
|
+
@handler.call(context) # user managed
|
|
30
|
+
else
|
|
31
|
+
manage_keys(context)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def manage_keys(context)
|
|
38
|
+
context.params[:encoding_type] = 'url'
|
|
39
|
+
@handler.call(context).on_success do |resp|
|
|
40
|
+
send("decode_#{resp.context.operation_name}_keys", resp.data)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def decode_list_objects_keys(data)
|
|
45
|
+
decode(:marker, data)
|
|
46
|
+
decode(:next_marker, data)
|
|
47
|
+
decode(:prefix, data)
|
|
48
|
+
decode(:delimiter, data)
|
|
49
|
+
data.contents.each { |o| decode(:key, o) }
|
|
50
|
+
data.common_prefixes.each { |o| decode(:prefix, o) }
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def decode_list_object_versions_keys(data)
|
|
54
|
+
decode(:key_marker, data)
|
|
55
|
+
decode(:next_key_marker, data)
|
|
56
|
+
decode(:prefix, data)
|
|
57
|
+
decode(:delimiter, data)
|
|
58
|
+
data.versions.each { |o| decode(:key, o) }
|
|
59
|
+
data.delete_markers.each { |o| decode(:key, o) }
|
|
60
|
+
data.common_prefixes.each { |o| decode(:prefix, o) }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def decode_list_multipart_uploads_keys(data)
|
|
64
|
+
decode(:key_marker, data)
|
|
65
|
+
decode(:next_key_marker, data)
|
|
66
|
+
decode(:prefix, data)
|
|
67
|
+
decode(:delimiter, data)
|
|
68
|
+
data.uploads.each { |o| decode(:key, o) }
|
|
69
|
+
data.common_prefixes.each { |o| decode(:prefix, o) }
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def decode(member, struct)
|
|
73
|
+
if struct[member]
|
|
74
|
+
struct[member] = CGI.unescape(struct[member])
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
handler(Handler,
|
|
81
|
+
step: :build,
|
|
82
|
+
priority: 60, # run this just before/after the XML builder/parser
|
|
83
|
+
operations: [
|
|
84
|
+
:list_objects,
|
|
85
|
+
:list_object_versions,
|
|
86
|
+
:list_multipart_uploads,
|
|
87
|
+
]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -13,11 +13,10 @@ module Aws
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def set_user_agent(context)
|
|
16
|
-
ua = "aws-sdk-ruby2/#{VERSION} %s/%s %s
|
|
16
|
+
ua = "aws-sdk-ruby2/#{VERSION} %s/%s %s %s" % [
|
|
17
17
|
(RUBY_ENGINE rescue nil or "ruby"),
|
|
18
18
|
RUBY_VERSION,
|
|
19
19
|
RUBY_PLATFORM,
|
|
20
|
-
Seahorse::VERSION,
|
|
21
20
|
context.config.user_agent_suffix,
|
|
22
21
|
]
|
|
23
22
|
context.http_request.headers['User-Agent'] = ua.strip
|
data/lib/aws/signers/v4.rb
CHANGED
|
@@ -44,7 +44,7 @@ module Aws
|
|
|
44
44
|
# @option options [required, Integer<Seconds>] :expires_in
|
|
45
45
|
# @option options [optional, String] :body_digest The SHA256 hexdigest of
|
|
46
46
|
# the payload to sign. For S3, this should be the string literal
|
|
47
|
-
# `UNSIGNED-
|
|
47
|
+
# `UNSIGNED-PAYLOAD`.
|
|
48
48
|
# @return [Seahorse::Client::Http::Request] the signed request.
|
|
49
49
|
# @api private
|
|
50
50
|
def presigned_url(request, options = {})
|
data/lib/aws/structure.rb
CHANGED
|
@@ -1,13 +1,62 @@
|
|
|
1
1
|
require 'thread'
|
|
2
2
|
|
|
3
3
|
module Aws
|
|
4
|
+
|
|
5
|
+
# A utilty class that makes it easier to work with Struct objects.
|
|
6
|
+
#
|
|
7
|
+
# ## Construction
|
|
8
|
+
#
|
|
9
|
+
# You can construct a Structure with a simple hash.
|
|
10
|
+
#
|
|
11
|
+
# person = Structure.new(name: 'John Doe', age: 40)
|
|
12
|
+
# #=> #<struct name="John Doe", age=40>
|
|
13
|
+
#
|
|
14
|
+
# ## Empty Structures
|
|
15
|
+
#
|
|
16
|
+
# The stdlib Struct class does not work with empty member lists.
|
|
17
|
+
# Structure solves this by introducing the EmptyStructure class.
|
|
18
|
+
#
|
|
19
|
+
# struct = Structure.new({})
|
|
20
|
+
# #=> #<struct>
|
|
21
|
+
#
|
|
22
|
+
# ## Structure Classes
|
|
23
|
+
#
|
|
24
|
+
# In addition to simpler object construction, struct classes are re-used
|
|
25
|
+
# automatically.
|
|
26
|
+
#
|
|
27
|
+
# person1 = Structure.new(name: 'John Doe', age: 40)
|
|
28
|
+
# person2 = Structure.new(name: 'Jane Doe', age: 40)
|
|
29
|
+
#
|
|
30
|
+
# person1.class == person2.class
|
|
31
|
+
#
|
|
32
|
+
# ## Hash Conversion
|
|
33
|
+
#
|
|
34
|
+
# Calling {#to_h} or {#to_hash} on a Structure object performs a deep
|
|
35
|
+
# conversion of Structure objects into hashes.
|
|
36
|
+
#
|
|
37
|
+
# person = Structure.new(
|
|
38
|
+
# name: "John",
|
|
39
|
+
# age: 40,
|
|
40
|
+
# friend: Structure.new(name: "Jane", age: 40, friend: nil)
|
|
41
|
+
# )
|
|
42
|
+
# person.to_h
|
|
43
|
+
# #=> {:name=>"John", :age=>40, :friend=>{:name=>"Jane", :age=>40}}
|
|
44
|
+
#
|
|
4
45
|
class Structure < Struct
|
|
5
46
|
|
|
6
47
|
@@classes = {}
|
|
7
48
|
@@classes_mutex = Mutex.new
|
|
8
49
|
|
|
50
|
+
if Struct.instance_methods.include?(:to_h)
|
|
51
|
+
alias orig_to_h to_h
|
|
52
|
+
end
|
|
53
|
+
|
|
9
54
|
# Deeply converts the Structure into a hash. Structure members that
|
|
10
55
|
# are `nil` are omitted from the resultant hash.
|
|
56
|
+
#
|
|
57
|
+
# You can call #orig_to_h to get vanilla #to_h behavior as defined
|
|
58
|
+
# in stdlib Struct.
|
|
59
|
+
#
|
|
11
60
|
# @return [Hash]
|
|
12
61
|
def to_h(obj = self)
|
|
13
62
|
case obj
|
|
@@ -22,8 +71,6 @@ module Aws
|
|
|
22
71
|
end
|
|
23
72
|
when Array
|
|
24
73
|
obj.collect { |value| to_hash(value) }
|
|
25
|
-
when StringIO
|
|
26
|
-
obj.string
|
|
27
74
|
else
|
|
28
75
|
obj
|
|
29
76
|
end
|
data/lib/aws/version.rb
CHANGED
data/lib/aws/xml/builder.rb
CHANGED
|
@@ -67,6 +67,7 @@ module Aws
|
|
|
67
67
|
when 'list' then list(name, shape, value)
|
|
68
68
|
when 'timestamp' then node(name, shape, shape.format_time(value, 'iso8601'))
|
|
69
69
|
when 'blob' then node(name, shape, Base64.strict_encode64(value))
|
|
70
|
+
when 'map' then raise NotImplementedError, 'not supported'
|
|
70
71
|
else
|
|
71
72
|
node(name, shape, value.to_s)
|
|
72
73
|
end
|
data/lib/seahorse.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
module Seahorse
|
|
2
2
|
|
|
3
|
-
autoload :VERSION, 'seahorse/version'
|
|
4
3
|
autoload :Util, 'seahorse/util'
|
|
5
4
|
|
|
6
5
|
module Client
|
|
@@ -33,6 +32,7 @@ module Seahorse
|
|
|
33
32
|
autoload :Formatter, 'seahorse/client/logging/formatter'
|
|
34
33
|
end
|
|
35
34
|
|
|
35
|
+
# @api private
|
|
36
36
|
module NetHttp
|
|
37
37
|
autoload :ConnectionPool, 'seahorse/client/net_http/connection_pool'
|
|
38
38
|
autoload :Handler, 'seahorse/client/net_http/handler'
|
|
@@ -53,6 +53,7 @@ module Seahorse
|
|
|
53
53
|
autoload :RestfulBindings, 'seahorse/client/plugins/restful_bindings'
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
# @api private
|
|
56
57
|
module Xml
|
|
57
58
|
autoload :Builder, 'seahorse/client/xml/builder'
|
|
58
59
|
end
|
|
@@ -113,11 +113,18 @@ module Seahorse
|
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
# Copies handlers from the `source_list` onto the current handler list.
|
|
116
|
+
# If a block is given, only the entries that return a `true` value
|
|
117
|
+
# from the block will be copied.
|
|
116
118
|
# @param [HandlerList] source_list
|
|
117
119
|
# @return [void]
|
|
118
|
-
def copy_from(source_list)
|
|
119
|
-
entries =
|
|
120
|
-
|
|
120
|
+
def copy_from(source_list, &block)
|
|
121
|
+
entries = []
|
|
122
|
+
source_list.entries.each do |entry|
|
|
123
|
+
if block_given?
|
|
124
|
+
entries << entry.copy(inserted: next_index) if yield(entry)
|
|
125
|
+
else
|
|
126
|
+
entries << entry.copy(inserted: next_index)
|
|
127
|
+
end
|
|
121
128
|
end
|
|
122
129
|
add_entries(entries)
|
|
123
130
|
end
|
|
@@ -14,7 +14,6 @@ module Seahorse
|
|
|
14
14
|
self.endpoint = options[:endpoint] if options[:endpoint]
|
|
15
15
|
self.http_method = options[:http_method] || 'GET'
|
|
16
16
|
self.headers = Headers.new(options[:headers] || {})
|
|
17
|
-
self.headers['User-Agent'] ||= ua
|
|
18
17
|
self.body = options[:body]
|
|
19
18
|
end
|
|
20
19
|
|
|
@@ -59,13 +58,6 @@ module Seahorse
|
|
|
59
58
|
end
|
|
60
59
|
end
|
|
61
60
|
|
|
62
|
-
private
|
|
63
|
-
|
|
64
|
-
# @return [String]
|
|
65
|
-
def ua
|
|
66
|
-
"Seahorse/#{Seahorse::VERSION}"
|
|
67
|
-
end
|
|
68
|
-
|
|
69
61
|
end
|
|
70
62
|
end
|
|
71
63
|
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.0.
|
|
4
|
+
version: 2.0.0.rc15
|
|
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: 2014-08-
|
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|
|
@@ -77,14 +77,14 @@ files:
|
|
|
77
77
|
- LICENSE.txt
|
|
78
78
|
- endpoints.json
|
|
79
79
|
- lib/aws/api/customizer.rb
|
|
80
|
-
- lib/aws/api/
|
|
81
|
-
- lib/aws/api/
|
|
82
|
-
- lib/aws/api/
|
|
83
|
-
- lib/aws/api/manifest_builder.rb
|
|
84
|
-
- lib/aws/api/minifier.rb
|
|
80
|
+
- lib/aws/api/documenter.rb
|
|
81
|
+
- lib/aws/api/operation_documenter.rb
|
|
82
|
+
- lib/aws/api/operation_example.rb
|
|
85
83
|
- lib/aws/api/service_customizations.rb
|
|
84
|
+
- lib/aws/client.rb
|
|
86
85
|
- lib/aws/credential_provider_chain.rb
|
|
87
86
|
- lib/aws/credentials.rb
|
|
87
|
+
- lib/aws/dynamodb/attribute_value.rb
|
|
88
88
|
- lib/aws/empty_structure.rb
|
|
89
89
|
- lib/aws/endpoint_provider.rb
|
|
90
90
|
- lib/aws/errors.rb
|
|
@@ -101,7 +101,9 @@ files:
|
|
|
101
101
|
- lib/aws/paging/null_provider.rb
|
|
102
102
|
- lib/aws/paging/pager.rb
|
|
103
103
|
- lib/aws/paging/provider.rb
|
|
104
|
+
- lib/aws/plugins/csd_conditional_signing.rb
|
|
104
105
|
- lib/aws/plugins/dynamodb_extended_retries.rb
|
|
106
|
+
- lib/aws/plugins/dynamodb_simple_attributes.rb
|
|
105
107
|
- lib/aws/plugins/ec2_copy_encrypted_snapshot.rb
|
|
106
108
|
- lib/aws/plugins/glacier_account_id.rb
|
|
107
109
|
- lib/aws/plugins/glacier_api_version.rb
|
|
@@ -125,6 +127,7 @@ files:
|
|
|
125
127
|
- lib/aws/plugins/s3_md5s.rb
|
|
126
128
|
- lib/aws/plugins/s3_redirects.rb
|
|
127
129
|
- lib/aws/plugins/s3_sse_cpk.rb
|
|
130
|
+
- lib/aws/plugins/s3_url_encoded_keys.rb
|
|
128
131
|
- lib/aws/plugins/sqs_queue_urls.rb
|
|
129
132
|
- lib/aws/plugins/swf_read_timeouts.rb
|
|
130
133
|
- lib/aws/plugins/user_agent.rb
|
|
@@ -133,10 +136,8 @@ files:
|
|
|
133
136
|
- lib/aws/query/param.rb
|
|
134
137
|
- lib/aws/query/param_builder.rb
|
|
135
138
|
- lib/aws/query/param_list.rb
|
|
136
|
-
- lib/aws/response_handler.rb
|
|
137
139
|
- lib/aws/rest_body_handler.rb
|
|
138
140
|
- lib/aws/service.rb
|
|
139
|
-
- lib/aws/service_builder.rb
|
|
140
141
|
- lib/aws/shared_credentials.rb
|
|
141
142
|
- lib/aws/signers/base.rb
|
|
142
143
|
- lib/aws/signers/handler.rb
|
|
@@ -196,104 +197,89 @@ files:
|
|
|
196
197
|
- lib/seahorse/util.rb
|
|
197
198
|
- lib/seahorse/version.rb
|
|
198
199
|
- lib/seahorse.rb
|
|
199
|
-
- apis/
|
|
200
|
-
- apis/
|
|
201
|
-
- apis/
|
|
202
|
-
- apis/
|
|
203
|
-
- apis/
|
|
204
|
-
- apis/
|
|
205
|
-
- apis/
|
|
206
|
-
- apis/
|
|
207
|
-
- apis/
|
|
208
|
-
- apis/
|
|
209
|
-
- apis/
|
|
210
|
-
- apis/
|
|
211
|
-
- apis/
|
|
212
|
-
- apis/
|
|
213
|
-
- apis/
|
|
214
|
-
- apis/
|
|
215
|
-
- apis/
|
|
216
|
-
- apis/
|
|
217
|
-
- apis/
|
|
218
|
-
- apis/
|
|
219
|
-
- apis/
|
|
220
|
-
- apis/
|
|
221
|
-
- apis/
|
|
222
|
-
- apis/
|
|
223
|
-
- apis/
|
|
224
|
-
- apis/
|
|
225
|
-
- apis/
|
|
226
|
-
- apis/
|
|
227
|
-
- apis/
|
|
228
|
-
- apis/
|
|
229
|
-
- apis/
|
|
230
|
-
- apis/
|
|
231
|
-
- apis/
|
|
232
|
-
- apis/
|
|
233
|
-
- apis/
|
|
234
|
-
- apis/
|
|
235
|
-
- apis/
|
|
236
|
-
- apis/
|
|
237
|
-
- apis/
|
|
238
|
-
- apis/
|
|
239
|
-
- apis/
|
|
240
|
-
- apis/
|
|
241
|
-
- apis/
|
|
242
|
-
- apis/
|
|
243
|
-
- apis/
|
|
244
|
-
- apis/
|
|
245
|
-
- apis/
|
|
246
|
-
- apis/
|
|
247
|
-
- apis/
|
|
248
|
-
- apis/
|
|
249
|
-
- apis/
|
|
250
|
-
- apis/
|
|
251
|
-
- apis/
|
|
252
|
-
- apis/
|
|
253
|
-
- apis/
|
|
254
|
-
- apis/
|
|
255
|
-
- apis/
|
|
256
|
-
- apis/
|
|
257
|
-
- apis/
|
|
258
|
-
- apis/
|
|
259
|
-
- apis/
|
|
260
|
-
- apis/
|
|
261
|
-
- apis/
|
|
262
|
-
- apis/
|
|
263
|
-
- apis/
|
|
264
|
-
- apis/
|
|
265
|
-
- apis/
|
|
266
|
-
- apis/
|
|
267
|
-
- apis/
|
|
268
|
-
- apis/
|
|
269
|
-
- apis/
|
|
270
|
-
- apis/
|
|
271
|
-
- apis/
|
|
272
|
-
- apis/
|
|
273
|
-
- apis/
|
|
274
|
-
- apis/
|
|
275
|
-
- apis/
|
|
276
|
-
- apis/
|
|
277
|
-
- apis/
|
|
278
|
-
- apis/
|
|
279
|
-
- apis/
|
|
280
|
-
- apis/
|
|
281
|
-
- apis/
|
|
282
|
-
- apis/sdb-2009-04-15.api.json
|
|
283
|
-
- apis/sdb-2009-04-15.paginators.json
|
|
284
|
-
- apis/sns-2010-03-31.api.json
|
|
285
|
-
- apis/sns-2010-03-31.paginators.json
|
|
286
|
-
- apis/sns-2010-03-31.resources.json
|
|
287
|
-
- apis/sqs-2012-11-05.api.json
|
|
288
|
-
- apis/sqs-2012-11-05.paginators.json
|
|
289
|
-
- apis/sqs-2012-11-05.resources.json
|
|
290
|
-
- apis/storagegateway-2013-06-30.api.json
|
|
291
|
-
- apis/storagegateway-2013-06-30.paginators.json
|
|
292
|
-
- apis/sts-2011-06-15.api.json
|
|
293
|
-
- apis/support-2013-04-15.api.json
|
|
294
|
-
- apis/support-2013-04-15.paginators.json
|
|
295
|
-
- apis/swf-2012-01-25.api.json
|
|
296
|
-
- apis/swf-2012-01-25.paginators.json
|
|
200
|
+
- apis/AutoScaling.api.json
|
|
201
|
+
- apis/AutoScaling.paginators.json
|
|
202
|
+
- apis/CloudFormation.api.json
|
|
203
|
+
- apis/CloudFormation.paginators.json
|
|
204
|
+
- apis/CloudFront.api.json
|
|
205
|
+
- apis/CloudFront.paginators.json
|
|
206
|
+
- apis/CloudFront.waiters.json
|
|
207
|
+
- apis/CloudSearch.api.json
|
|
208
|
+
- apis/CloudSearch.paginators.json
|
|
209
|
+
- apis/CloudSearchDomain.api.json
|
|
210
|
+
- apis/CloudTrail.api.json
|
|
211
|
+
- apis/CloudTrail.paginators.json
|
|
212
|
+
- apis/CloudWatch.api.json
|
|
213
|
+
- apis/CloudWatch.paginators.json
|
|
214
|
+
- apis/CloudWatchLogs.api.json
|
|
215
|
+
- apis/CloudWatchLogs.paginators.json
|
|
216
|
+
- apis/CognitoIdentity.api.json
|
|
217
|
+
- apis/CognitoSync.api.json
|
|
218
|
+
- apis/DataPipeline.api.json
|
|
219
|
+
- apis/DataPipeline.paginators.json
|
|
220
|
+
- apis/DirectConnect.api.json
|
|
221
|
+
- apis/DirectConnect.paginators.json
|
|
222
|
+
- apis/DynamoDB.api.json
|
|
223
|
+
- apis/DynamoDB.paginators.json
|
|
224
|
+
- apis/DynamoDB.waiters.json
|
|
225
|
+
- apis/EC2.api.json
|
|
226
|
+
- apis/EC2.paginators.json
|
|
227
|
+
- apis/EC2.resources.json
|
|
228
|
+
- apis/EC2.waiters.json
|
|
229
|
+
- apis/ElastiCache.api.json
|
|
230
|
+
- apis/ElastiCache.paginators.json
|
|
231
|
+
- apis/ElasticBeanstalk.api.json
|
|
232
|
+
- apis/ElasticBeanstalk.paginators.json
|
|
233
|
+
- apis/ElasticLoadBalancing.api.json
|
|
234
|
+
- apis/ElasticLoadBalancing.paginators.json
|
|
235
|
+
- apis/ElasticTranscoder.api.json
|
|
236
|
+
- apis/ElasticTranscoder.paginators.json
|
|
237
|
+
- apis/EMR.api.json
|
|
238
|
+
- apis/EMR.paginators.json
|
|
239
|
+
- apis/Glacier.api.json
|
|
240
|
+
- apis/Glacier.paginators.json
|
|
241
|
+
- apis/Glacier.resources.json
|
|
242
|
+
- apis/Glacier.waiters.json
|
|
243
|
+
- apis/IAM.api.json
|
|
244
|
+
- apis/IAM.paginators.json
|
|
245
|
+
- apis/IAM.resources.json
|
|
246
|
+
- apis/ImportExport.api.json
|
|
247
|
+
- apis/ImportExport.paginators.json
|
|
248
|
+
- apis/Kinesis.api.json
|
|
249
|
+
- apis/Kinesis.paginators.json
|
|
250
|
+
- apis/OpsWorks.api.json
|
|
251
|
+
- apis/OpsWorks.paginators.json
|
|
252
|
+
- apis/RDS.api.json
|
|
253
|
+
- apis/RDS.paginators.json
|
|
254
|
+
- apis/RDS.waiters.json
|
|
255
|
+
- apis/Redshift.api.json
|
|
256
|
+
- apis/Redshift.paginators.json
|
|
257
|
+
- apis/Redshift.waiters.json
|
|
258
|
+
- apis/Route53.api.json
|
|
259
|
+
- apis/Route53.paginators.json
|
|
260
|
+
- apis/Route53Domains.api.json
|
|
261
|
+
- apis/S3.api.json
|
|
262
|
+
- apis/S3.paginators.json
|
|
263
|
+
- apis/S3.resources.json
|
|
264
|
+
- apis/S3.waiters.json
|
|
265
|
+
- apis/SES.api.json
|
|
266
|
+
- apis/SES.paginators.json
|
|
267
|
+
- apis/SES.waiters.json
|
|
268
|
+
- apis/SimpleDB.api.json
|
|
269
|
+
- apis/SimpleDB.paginators.json
|
|
270
|
+
- apis/SNS.api.json
|
|
271
|
+
- apis/SNS.paginators.json
|
|
272
|
+
- apis/SNS.resources.json
|
|
273
|
+
- apis/SQS.api.json
|
|
274
|
+
- apis/SQS.paginators.json
|
|
275
|
+
- apis/SQS.resources.json
|
|
276
|
+
- apis/StorageGateway.api.json
|
|
277
|
+
- apis/StorageGateway.paginators.json
|
|
278
|
+
- apis/STS.api.json
|
|
279
|
+
- apis/Support.api.json
|
|
280
|
+
- apis/Support.paginators.json
|
|
281
|
+
- apis/SWF.api.json
|
|
282
|
+
- apis/SWF.paginators.json
|
|
297
283
|
- bin/aws.rb
|
|
298
284
|
homepage: http://github.com/aws/aws-sdk-core-ruby
|
|
299
285
|
licenses:
|