aws-sdk-core 2.0.0.rc12 → 2.0.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/AutoScaling.api.json +1943 -0
- data/apis/CloudFormation.api.json +785 -0
- data/apis/CloudFront.api.json +2581 -0
- data/apis/CloudFront.paginators.json +32 -0
- data/apis/CloudSearch.api.json +1955 -0
- data/apis/CloudSearchDomain.api.json +349 -0
- data/apis/CloudTrail.api.json +559 -0
- data/apis/CloudWatch.api.json +917 -0
- data/apis/CloudWatchLogs.api.json +816 -0
- data/apis/CognitoIdentity.api.json +631 -0
- data/apis/CognitoSync.api.json +721 -0
- data/apis/DataPipeline.api.json +940 -0
- data/apis/DirectConnect.api.json +833 -0
- data/apis/DynamoDB.api.json +1210 -0
- data/apis/{dynamodb-2011-12-05.paginators.json → DynamoDB.paginators.json} +1 -3
- data/apis/EC2.api.json +9914 -0
- data/apis/{ec2-2014-06-15.resources.json → EC2.resources.json} +16 -0
- data/apis/EMR.api.json +1339 -0
- data/apis/ElastiCache.api.json +3410 -0
- data/apis/ElasticBeanstalk.api.json +1543 -0
- data/apis/ElasticLoadBalancing.api.json +2131 -0
- data/apis/ElasticTranscoder.api.json +1647 -0
- data/apis/Glacier.api.json +1456 -0
- data/apis/{glacier-2012-06-01.resources.json → Glacier.resources.json} +5 -9
- data/apis/IAM.api.json +4033 -0
- data/apis/{iam-2010-05-08.resources.json → IAM.resources.json} +1 -1
- data/apis/ImportExport.api.json +515 -0
- data/apis/Kinesis.api.json +706 -0
- data/apis/{kinesis-2013-12-02.paginators.json → Kinesis.paginators.json} +0 -6
- data/apis/OpsWorks.api.json +2555 -0
- data/apis/OpsWorks.resources.json +181 -0
- data/apis/RDS.api.json +4473 -0
- data/apis/Redshift.api.json +4482 -0
- data/apis/Route53.api.json +1935 -0
- data/apis/Route53Domains.api.json +1129 -0
- data/apis/{s3-2006-03-01.api.json → S3.api.json} +377 -972
- data/apis/{s3-2006-03-01.paginators.json → S3.paginators.json} +1 -1
- data/apis/{s3-2006-03-01.resources.json → S3.resources.json} +13 -2
- data/apis/SES.api.json +644 -0
- data/apis/SNS.api.json +1760 -0
- data/apis/SQS.api.json +1113 -0
- data/apis/{sqs-2012-11-05.resources.json → SQS.resources.json} +0 -10
- data/apis/STS.api.json +594 -0
- data/apis/SWF.api.json +2656 -0
- data/apis/SimpleDB.api.json +954 -0
- data/apis/StorageGateway.api.json +2311 -0
- data/apis/Support.api.json +869 -0
- data/bin/aws.rb +19 -1
- data/endpoints.json +77 -0
- data/lib/aws-sdk-core/api/docstrings.rb +35 -0
- data/lib/aws-sdk-core/api/documenter.rb +241 -0
- data/lib/{aws/api/documentor.rb → aws-sdk-core/api/operation_documenter.rb} +39 -28
- data/lib/{aws/api/doc_example.rb → aws-sdk-core/api/operation_example.rb} +31 -22
- data/lib/{aws → aws-sdk-core}/api/service_customizations.rb +5 -1
- data/lib/aws-sdk-core/autoscaling.rb +5 -0
- data/lib/aws-sdk-core/client.rb +121 -0
- data/lib/aws-sdk-core/cloudformation.rb +5 -0
- data/lib/aws-sdk-core/cloudfront.rb +6 -0
- data/lib/aws-sdk-core/cloudsearch.rb +5 -0
- data/lib/aws-sdk-core/cloudsearchdomain.rb +4 -0
- data/lib/aws-sdk-core/cloudtrail.rb +5 -0
- data/lib/aws-sdk-core/cloudwatch.rb +5 -0
- data/lib/aws-sdk-core/cloudwatchlogs.rb +5 -0
- data/lib/aws-sdk-core/cognitoidentity.rb +4 -0
- data/lib/aws-sdk-core/cognitosync.rb +4 -0
- data/lib/{aws → aws-sdk-core}/credential_provider_chain.rb +4 -1
- data/lib/aws-sdk-core/datapipeline.rb +5 -0
- data/lib/aws-sdk-core/directconnect.rb +5 -0
- data/lib/aws-sdk-core/dynamodb/attribute_value.rb +87 -0
- data/lib/aws-sdk-core/dynamodb.rb +12 -0
- data/lib/aws-sdk-core/ec2.rb +7 -0
- data/lib/aws-sdk-core/elasticache.rb +5 -0
- data/lib/aws-sdk-core/elasticbeanstalk.rb +5 -0
- data/lib/aws-sdk-core/elasticloadbalancing.rb +5 -0
- data/lib/aws-sdk-core/elastictranscoder.rb +5 -0
- data/lib/{aws → aws-sdk-core}/empty_structure.rb +4 -3
- data/lib/aws-sdk-core/emr.rb +5 -0
- data/lib/aws-sdk-core/endpoint_provider.rb +97 -0
- data/lib/{aws → aws-sdk-core}/errors.rb +27 -8
- data/lib/aws-sdk-core/glacier.rb +7 -0
- data/lib/aws-sdk-core/iam.rb +6 -0
- data/lib/aws-sdk-core/importexport.rb +5 -0
- data/lib/{aws → aws-sdk-core}/instance_profile_credentials.rb +13 -9
- data/lib/aws-sdk-core/kinesis.rb +5 -0
- data/lib/aws-sdk-core/opsworks.rb +6 -0
- data/lib/{aws → aws-sdk-core}/pageable_response.rb +1 -1
- data/lib/aws-sdk-core/plugins/csd_conditional_signing.rb +37 -0
- data/lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb +179 -0
- data/lib/{aws → aws-sdk-core}/plugins/global_configuration.rb +14 -7
- data/lib/{aws → aws-sdk-core}/plugins/protocols/json_rpc.rb +9 -7
- data/lib/{aws → aws-sdk-core}/plugins/regional_endpoint.rb +2 -4
- data/lib/{aws → aws-sdk-core}/plugins/request_signer.rb +18 -8
- data/lib/aws-sdk-core/plugins/response_paging.rb +25 -0
- data/lib/{aws → aws-sdk-core}/plugins/retry_errors.rb +11 -1
- data/lib/aws-sdk-core/plugins/route_53_id_fix.rb +55 -0
- data/lib/aws-sdk-core/plugins/s3_expect_100_continue.rb +27 -0
- data/lib/aws-sdk-core/plugins/s3_sse_cpk.rb +63 -0
- data/lib/aws-sdk-core/plugins/s3_url_encoded_keys.rb +92 -0
- data/lib/{aws → aws-sdk-core}/plugins/user_agent.rb +1 -2
- data/lib/{aws → aws-sdk-core}/query/handler.rb +4 -5
- data/lib/aws-sdk-core/rds.rb +6 -0
- data/lib/aws-sdk-core/redshift.rb +6 -0
- data/lib/aws-sdk-core/route53.rb +5 -0
- data/lib/aws-sdk-core/route53domains.rb +4 -0
- data/lib/aws-sdk-core/s3/presigner.rb +64 -0
- data/lib/aws-sdk-core/s3.rb +13 -0
- data/lib/aws-sdk-core/service.rb +4 -0
- data/lib/aws-sdk-core/ses.rb +6 -0
- data/lib/{aws → aws-sdk-core}/signers/v4.rb +6 -5
- data/lib/aws-sdk-core/simpledb.rb +5 -0
- data/lib/aws-sdk-core/sns.rb +6 -0
- data/lib/aws-sdk-core/sqs.rb +6 -0
- data/lib/aws-sdk-core/storagegateway.rb +5 -0
- data/lib/{aws → aws-sdk-core}/structure.rb +60 -4
- data/lib/aws-sdk-core/sts.rb +4 -0
- data/lib/aws-sdk-core/support.rb +5 -0
- data/lib/aws-sdk-core/swf.rb +5 -0
- data/lib/aws-sdk-core/version.rb +3 -0
- data/lib/aws-sdk-core/waiters/errors.rb +30 -0
- data/lib/aws-sdk-core/waiters/null_provider.rb +12 -0
- data/lib/aws-sdk-core/waiters/provider.rb +54 -0
- data/lib/aws-sdk-core/waiters/waiter.rb +194 -0
- data/lib/{aws → aws-sdk-core}/xml/builder.rb +4 -3
- data/lib/aws-sdk-core/xml/default_list.rb +10 -0
- data/lib/{aws → aws-sdk-core}/xml/parser.rb +6 -1
- data/lib/aws-sdk-core.rb +288 -1
- data/{vendor/seahorse/lib → lib}/seahorse/client/base.rb +45 -20
- data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list.rb +17 -3
- data/{vendor/seahorse/lib → lib}/seahorse/client/http/error.rb +2 -2
- data/{vendor/seahorse/lib → lib}/seahorse/client/http/request.rb +1 -9
- data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/connection_pool.rb +2 -0
- data/{vendor/seahorse/lib → lib}/seahorse/client/net_http/handler.rb +13 -1
- data/lib/seahorse/client/net_http/patches.rb +97 -0
- data/{vendor/seahorse/lib → lib}/seahorse/client/param_converter.rb +2 -2
- data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/endpoint.rb +24 -15
- data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/restful_bindings.rb +1 -1
- data/{vendor/seahorse/lib → lib}/seahorse/client/request.rb +1 -1
- data/{vendor/seahorse/lib → lib}/seahorse/client/response.rb +0 -2
- data/{vendor/seahorse/lib → lib}/seahorse/client/xml/builder.rb +0 -1
- data/{vendor/seahorse/lib → lib}/seahorse/model/shape_map.rb +1 -0
- data/{vendor/seahorse/lib → lib}/seahorse/model/shapes.rb +13 -4
- data/{vendor/seahorse/lib → lib}/seahorse.rb +3 -3
- metadata +257 -593
- data/.gitignore +0 -8
- data/.simplecov +0 -6
- data/.travis.yml +0 -20
- data/.yardopts +0 -11
- data/Gemfile +0 -26
- data/LICENSE.txt +0 -12
- data/README.md +0 -250
- data/Rakefile +0 -17
- data/apis/autoscaling-2011-01-01.api.json +0 -2602
- 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.paginators.json +0 -32
- 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 -27
- data/apis/ec2-2014-06-15.api.json +0 -11661
- data/apis/elasticache-2014-03-24.api.json +0 -4789
- data/apis/elasticbeanstalk-2010-12-01.api.json +0 -2442
- data/apis/elasticloadbalancing-2012-06-01.api.json +0 -2576
- 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/endpoints.json +0 -98
- data/apis/glacier-2012-06-01.api.json +0 -2012
- data/apis/iam-2010-05-08.api.json +0 -5046
- 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 -250
- 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-02-12.api.json +0 -6392
- data/apis/rds-2013-02-12.paginators.json +0 -110
- 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 -1927
- 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 -1115
- data/apis/swf-2012-01-25.api.json +0 -4463
- data/aws-sdk-core.gemspec +0 -22
- data/doc-src/images/lastnode.png +0 -0
- data/doc-src/images/node.png +0 -0
- data/doc-src/images/vline.png +0 -0
- data/doc-src/plugins/apis.rb +0 -260
- data/doc-src/plugins/stability.rb +0 -1
- data/doc-src/services/CloudSearchDomain/client.md +0 -8
- data/doc-src/services/CloudSearchDomain/service.md +0 -0
- data/doc-src/services/default/client.md +0 -84
- data/doc-src/services/default/errors.md +0 -45
- data/doc-src/services/default/service.md +0 -28
- data/doc-src/templates/default/fulldoc/html/css/common.css +0 -90
- data/doc-src/templates/default/fulldoc/html/js/tabs.js +0 -21
- data/doc-src/templates/default/fulldoc/html/setup.rb +0 -66
- data/doc-src/templates/default/layout/html/footer.erb +0 -29
- data/doc-src/templates/default/layout/html/layout.erb +0 -37
- data/doc-src/templates/default/layout/html/setup.rb +0 -3
- data/features/autoscaling/client.feature +0 -18
- data/features/autoscaling/step_definitions.rb +0 -6
- data/features/cloudformation/client.feature +0 -17
- data/features/cloudformation/step_definitions.rb +0 -6
- data/features/cloudfront/client.feature +0 -17
- data/features/cloudfront/step_definitions.rb +0 -6
- data/features/cloudsearch/client.feature +0 -16
- data/features/cloudsearch/step_definitions.rb +0 -6
- data/features/cloudtrail/client.feature +0 -16
- data/features/cloudtrail/step_definitions.rb +0 -6
- data/features/cloudwatch/client.feature +0 -19
- data/features/cloudwatch/step_definitions.rb +0 -6
- data/features/cloudwatchlogs/client.feature +0 -17
- data/features/cloudwatchlogs/step_definitions.rb +0 -6
- data/features/cognitoidentity/client.feature +0 -17
- data/features/cognitoidentity/step_definitions.rb +0 -6
- data/features/cognitosync/client.feature +0 -16
- data/features/cognitosync/step_definitions.rb +0 -6
- data/features/datapipeline/client.feature +0 -16
- data/features/datapipeline/step_definitions.rb +0 -6
- data/features/directconnect/client.feature +0 -16
- data/features/directconnect/step_definitions.rb +0 -6
- data/features/dynamodb/client.feature +0 -17
- data/features/dynamodb/simplified.feature +0 -32
- data/features/dynamodb/step_definitions.rb +0 -11
- data/features/ec2/client.feature +0 -16
- data/features/ec2/step_definitions.rb +0 -6
- data/features/elasticache/client.feature +0 -16
- data/features/elasticache/step_definitions.rb +0 -6
- data/features/elasticbeanstalk/client.feature +0 -16
- data/features/elasticbeanstalk/step_definitions.rb +0 -6
- data/features/elasticloadbalancing/client.feature +0 -16
- data/features/elasticloadbalancing/step_definitions.rb +0 -6
- data/features/elastictranscoder/client.feature +0 -16
- data/features/elastictranscoder/step_definitions.rb +0 -6
- data/features/emr/client.feature +0 -16
- data/features/emr/step_definitions.rb +0 -6
- data/features/env.rb +0 -23
- data/features/glacier/client.feature +0 -17
- data/features/glacier/step_definitions.rb +0 -93
- data/features/glacier/upload.feature +0 -27
- data/features/iam/client.feature +0 -16
- data/features/iam/step_definitions.rb +0 -6
- data/features/importexport/client.feature +0 -16
- data/features/importexport/step_definitions.rb +0 -6
- data/features/kinesis/client.feature +0 -16
- data/features/kinesis/step_definitions.rb +0 -6
- data/features/opsworks/client.feature +0 -16
- data/features/opsworks/step_definitions.rb +0 -6
- data/features/rds/client.feature +0 -16
- data/features/rds/step_definitions.rb +0 -6
- data/features/redshift/client.feature +0 -16
- data/features/redshift/step_definitions.rb +0 -6
- data/features/route53/client.feature +0 -16
- data/features/route53/step_definitions.rb +0 -6
- data/features/s3/buckets.feature +0 -40
- data/features/s3/objects.feature +0 -37
- data/features/s3/step_definitions.rb +0 -165
- data/features/s3/test.png +0 -0
- data/features/ses/client.feature +0 -16
- data/features/ses/step_definitions.rb +0 -6
- data/features/simpledb/client.feature +0 -16
- data/features/simpledb/step_definitions.rb +0 -6
- data/features/sns/client.feature +0 -17
- data/features/sns/step_definitions.rb +0 -6
- data/features/sqs/client.feature +0 -21
- data/features/sqs/step_definitions.rb +0 -29
- data/features/step_definitions.rb +0 -94
- data/features/storagegateway/client.feature +0 -16
- data/features/storagegateway/step_definitions.rb +0 -6
- data/features/sts/client.feature +0 -17
- data/features/sts/step_definitions.rb +0 -6
- data/features/swf/client.feature +0 -17
- data/features/swf/step_definitions.rb +0 -6
- data/integration-test-config.json.sample +0 -3
- data/lib/aws/api/manifest.rb +0 -29
- data/lib/aws/api/manifest_builder.rb +0 -57
- data/lib/aws/client.rb +0 -241
- data/lib/aws/endpoint_provider.rb +0 -165
- data/lib/aws/plugins/response_paging.rb +0 -20
- data/lib/aws/plugins/s3_sse_cpk.rb +0 -42
- data/lib/aws/response_handler.rb +0 -38
- data/lib/aws/service.rb +0 -32
- data/lib/aws/signers/v4.rb.orig +0 -243
- data/lib/aws/version.rb +0 -3
- data/lib/aws/version.rb.orig +0 -7
- data/lib/aws.rb +0 -208
- data/lib/aws.rb.orig +0 -218
- data/spec/aws/client_spec.rb +0 -269
- data/spec/aws/credential_provider_chain_spec.rb +0 -120
- data/spec/aws/credentials_spec.rb +0 -47
- data/spec/aws/errors_spec.rb +0 -39
- data/spec/aws/iam_spec.rb +0 -17
- data/spec/aws/instance_profile_credentials_spec.rb +0 -94
- data/spec/aws/json/builder_spec.rb +0 -188
- data/spec/aws/json/parser_spec.rb +0 -214
- data/spec/aws/operations_spec.rb +0 -145
- data/spec/aws/pageable_response_spec.rb +0 -171
- data/spec/aws/plugins/global_configuration_spec.rb +0 -58
- data/spec/aws/plugins/region_endpoint_spec.rb +0 -86
- data/spec/aws/plugins/request_signer_spec.rb +0 -88
- data/spec/aws/plugins/retry_errors_spec.rb +0 -266
- data/spec/aws/plugins/s3_md5s_spec.rb +0 -84
- data/spec/aws/plugins/sqs_queue_urls_spec.rb +0 -42
- data/spec/aws/query/param_builder_spec.rb +0 -362
- data/spec/aws/query/param_list_spec.rb +0 -80
- data/spec/aws/query/param_spec.rb +0 -64
- data/spec/aws/s3_spec.rb +0 -79
- data/spec/aws/shared_credentials_spec.rb +0 -68
- data/spec/aws/signers/v4_spec.rb +0 -141
- data/spec/aws/structure_spec.rb +0 -166
- data/spec/aws/util_spec.rb +0 -60
- data/spec/aws/xml/builder_spec.rb +0 -412
- data/spec/aws/xml/parser_spec.rb +0 -723
- data/spec/aws_spec.rb +0 -94
- data/spec/fixtures/api/swf.json +0 -100
- data/spec/fixtures/credentials/mock_shared_credentials +0 -14
- data/spec/fixtures/operations/cloudfront/list_distributions.yml +0 -199
- data/spec/fixtures/operations/cloudfront/max_items.yml +0 -11
- data/spec/fixtures/operations/dynamodb/error_parsing.yml +0 -13
- data/spec/fixtures/operations/glacier/account_id_param.yml +0 -13
- data/spec/fixtures/operations/glacier/custom_account_id.yml +0 -11
- data/spec/fixtures/operations/glacier/default_account_id.yml +0 -10
- data/spec/fixtures/operations/glacier/error_parsing.yml +0 -10
- data/spec/fixtures/operations/glacier/get_job_output.yml +0 -23
- data/spec/fixtures/operations/glacier/list_vaults.yml +0 -24
- data/spec/fixtures/operations/iam/result_wrapped_elements.yml +0 -31
- data/spec/fixtures/operations/route53/change_resource_record_sets.yml +0 -18
- data/spec/fixtures/operations/s3/304_response.yml +0 -12
- data/spec/fixtures/operations/s3/400_response.yml +0 -12
- data/spec/fixtures/operations/s3/403_response.yml +0 -12
- data/spec/fixtures/operations/s3/404_response.yml +0 -12
- data/spec/fixtures/operations/s3/412_response_head.yml +0 -10
- data/spec/fixtures/operations/s3/comlete_multipart_upload_error.yml +0 -18
- data/spec/fixtures/operations/s3/content_type_header.yml +0 -12
- data/spec/fixtures/operations/s3/create_bucket_with_implied_location_constraint.yml +0 -23
- data/spec/fixtures/operations/s3/create_bucket_with_location_constraint.yml +0 -25
- data/spec/fixtures/operations/s3/create_bucket_without_location_constraint.yml +0 -9
- data/spec/fixtures/operations/s3/delete_objects.yml +0 -54
- data/spec/fixtures/operations/s3/error_parsing.yml +0 -17
- data/spec/fixtures/operations/s3/get_bucket_location.yml +0 -17
- data/spec/fixtures/operations/s3/get_bucket_location_classic.yml +0 -17
- data/spec/fixtures/operations/s3/get_bucket_policy.yml +0 -8
- data/spec/fixtures/operations/s3/head_bucket_with_dns_incompatible_name.yml +0 -12
- data/spec/fixtures/operations/s3/head_object.yml +0 -50
- data/spec/fixtures/operations/s3/list_buckets.yml +0 -41
- data/spec/fixtures/operations/s3/md5_checksum_disabled.yml +0 -10
- data/spec/fixtures/operations/s3/md5_checksum_enabled.yml +0 -8
- data/spec/fixtures/operations/swf/list_domains.yml +0 -20
- data/spec/fixtures/protocols/input/ec2.json +0 -383
- data/spec/fixtures/protocols/input/json.json +0 -47
- data/spec/fixtures/protocols/input/query.json +0 -335
- data/spec/fixtures/protocols/input/rest-json.json +0 -365
- data/spec/fixtures/protocols/input/rest-xml.json +0 -818
- data/spec/fixtures/protocols/output/ec2.json +0 -381
- data/spec/fixtures/protocols/output/json.json +0 -313
- data/spec/fixtures/protocols/output/query.json +0 -424
- data/spec/fixtures/protocols/output/rest-json.json +0 -486
- data/spec/fixtures/protocols/output/rest-xml.json +0 -486
- data/spec/protocols_spec.rb +0 -186
- data/spec/spec_helper.rb +0 -66
- data/tasks/docs.rake +0 -61
- data/tasks/handlers.rake +0 -98
- data/tasks/manifest.rake +0 -9
- data/tasks/test.rake +0 -30
- data/vendor/seahorse/.gitignore +0 -5
- data/vendor/seahorse/.simplecov +0 -4
- data/vendor/seahorse/.yardopts +0 -10
- data/vendor/seahorse/Gemfile +0 -17
- data/vendor/seahorse/LICENSE.txt +0 -12
- data/vendor/seahorse/README.md +0 -129
- data/vendor/seahorse/Rakefile +0 -7
- data/vendor/seahorse/lib/seahorse/client/plugins/api.rb +0 -11
- data/vendor/seahorse/seahorse.gemspec +0 -20
- data/vendor/seahorse/spec/fixtures/plugin.rb +0 -4
- data/vendor/seahorse/spec/seahorse/client/base_spec.rb +0 -299
- data/vendor/seahorse/spec/seahorse/client/configuration_spec.rb +0 -122
- data/vendor/seahorse/spec/seahorse/client/handler_builder_spec.rb +0 -159
- data/vendor/seahorse/spec/seahorse/client/handler_list_spec.rb +0 -232
- data/vendor/seahorse/spec/seahorse/client/handler_spec.rb +0 -40
- data/vendor/seahorse/spec/seahorse/client/http/headers_spec.rb +0 -213
- data/vendor/seahorse/spec/seahorse/client/http/request_spec.rb +0 -121
- data/vendor/seahorse/spec/seahorse/client/http/response_spec.rb +0 -77
- data/vendor/seahorse/spec/seahorse/client/logging/formatter_spec.rb +0 -185
- data/vendor/seahorse/spec/seahorse/client/logging/handler_spec.rb +0 -63
- data/vendor/seahorse/spec/seahorse/client/net_http/connection_pool_spec.rb +0 -10
- data/vendor/seahorse/spec/seahorse/client/net_http/handler_spec.rb +0 -242
- data/vendor/seahorse/spec/seahorse/client/param_converter_spec.rb +0 -308
- data/vendor/seahorse/spec/seahorse/client/param_validator_spec.rb +0 -275
- data/vendor/seahorse/spec/seahorse/client/plugin_list_spec.rb +0 -166
- data/vendor/seahorse/spec/seahorse/client/plugin_spec.rb +0 -118
- data/vendor/seahorse/spec/seahorse/client/plugins/content_length_spec.rb +0 -19
- data/vendor/seahorse/spec/seahorse/client/plugins/endpoint_spec.rb +0 -33
- data/vendor/seahorse/spec/seahorse/client/plugins/logging_spec.rb +0 -46
- data/vendor/seahorse/spec/seahorse/client/plugins/net_http_spec.rb +0 -70
- data/vendor/seahorse/spec/seahorse/client/plugins/operation_methods_spec.rb +0 -76
- data/vendor/seahorse/spec/seahorse/client/request_context_spec.rb +0 -105
- data/vendor/seahorse/spec/seahorse/client/request_spec.rb +0 -152
- data/vendor/seahorse/spec/seahorse/client/response_spec.rb +0 -95
- data/vendor/seahorse/spec/seahorse/client/xml/builder/xml_doc_spec.rb +0 -142
- data/vendor/seahorse/spec/seahorse/client/xml/builder_spec.rb +0 -10
- data/vendor/seahorse/spec/seahorse/model/api_spec.rb +0 -154
- data/vendor/seahorse/spec/seahorse/model/operation_spec.rb +0 -162
- data/vendor/seahorse/spec/seahorse/model/shape_map_spec.rb +0 -84
- data/vendor/seahorse/spec/seahorse/model/shapes_spec.rb +0 -522
- data/vendor/seahorse/spec/seahorse/util_spec.rb +0 -54
- data/vendor/seahorse/spec/seahorse/version_spec.rb +0 -11
- data/vendor/seahorse/spec/spec_helper.rb +0 -34
- data/vendor/seahorse/tasks/docs.rake +0 -11
- data/vendor/seahorse/tasks/test.rake +0 -15
- /data/apis/{autoscaling-2011-01-01.paginators.json → AutoScaling.paginators.json} +0 -0
- /data/apis/{cloudformation-2010-05-15.paginators.json → CloudFormation.paginators.json} +0 -0
- /data/apis/{cloudfront-2014-01-31.waiters.json → CloudFront.waiters.json} +0 -0
- /data/apis/{cloudsearch-2013-01-01.paginators.json → CloudSearch.paginators.json} +0 -0
- /data/apis/{cloudtrail-2013-11-01.paginators.json → CloudTrail.paginators.json} +0 -0
- /data/apis/{monitoring-2010-08-01.paginators.json → CloudWatch.paginators.json} +0 -0
- /data/apis/{logs-2014-03-28.paginators.json → CloudWatchLogs.paginators.json} +0 -0
- /data/apis/{datapipeline-2012-10-29.paginators.json → DataPipeline.paginators.json} +0 -0
- /data/apis/{directconnect-2012-10-25.paginators.json → DirectConnect.paginators.json} +0 -0
- /data/apis/{dynamodb-2012-08-10.waiters.json → DynamoDB.waiters.json} +0 -0
- /data/apis/{ec2-2014-06-15.paginators.json → EC2.paginators.json} +0 -0
- /data/apis/{ec2-2014-06-15.waiters.json → EC2.waiters.json} +0 -0
- /data/apis/{elasticmapreduce-2009-03-31.paginators.json → EMR.paginators.json} +0 -0
- /data/apis/{elasticache-2014-03-24.paginators.json → ElastiCache.paginators.json} +0 -0
- /data/apis/{elasticbeanstalk-2010-12-01.paginators.json → ElasticBeanstalk.paginators.json} +0 -0
- /data/apis/{elasticloadbalancing-2012-06-01.paginators.json → ElasticLoadBalancing.paginators.json} +0 -0
- /data/apis/{elastictranscoder-2012-09-25.paginators.json → ElasticTranscoder.paginators.json} +0 -0
- /data/apis/{glacier-2012-06-01.paginators.json → Glacier.paginators.json} +0 -0
- /data/apis/{glacier-2012-06-01.waiters.json → Glacier.waiters.json} +0 -0
- /data/apis/{iam-2010-05-08.paginators.json → IAM.paginators.json} +0 -0
- /data/apis/{importexport-2010-06-01.paginators.json → ImportExport.paginators.json} +0 -0
- /data/apis/{opsworks-2013-02-18.paginators.json → OpsWorks.paginators.json} +0 -0
- /data/apis/{rds-2013-01-10.paginators.json → RDS.paginators.json} +0 -0
- /data/apis/{rds-2013-09-09.waiters.json → RDS.waiters.json} +0 -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-2013-04-01.paginators.json → Route53.paginators.json} +0 -0
- /data/apis/{s3-2006-03-01.waiters.json → S3.waiters.json} +0 -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-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-2012-11-05.paginators.json → SQS.paginators.json} +0 -0
- /data/apis/{swf-2012-01-25.paginators.json → SWF.paginators.json} +0 -0
- /data/apis/{sdb-2009-04-15.paginators.json → SimpleDB.paginators.json} +0 -0
- /data/apis/{storagegateway-2013-06-30.paginators.json → StorageGateway.paginators.json} +0 -0
- /data/apis/{support-2013-04-15.paginators.json → Support.paginators.json} +0 -0
- /data/lib/{aws → aws-sdk-core}/api/customizer.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/credentials.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/error_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/parser.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rest_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rpc_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/rpc_headers_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/json/simple_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/null_pager.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/null_provider.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/pager.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/paging/provider.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/dynamodb_extended_retries.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/ec2_copy_encrypted_snapshot.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_account_id.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_api_version.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/glacier_checksums.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/ec2.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/query.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_json.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/protocols/rest_xml.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_bucket_dns.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_complete_multipart_upload_fix.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_get_bucket_location_fix.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_location_constraint.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_md5s.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/s3_redirects.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/sqs_queue_urls.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/plugins/swf_read_timeouts.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/ec2_param_builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param_builder.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/query/param_list.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/rest_body_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/shared_credentials.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/base.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/s3.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/v2.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/signers/v3.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/tree_hash.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/xml/error_handler.rb +0 -0
- /data/lib/{aws → aws-sdk-core}/xml/rest_handler.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/block_io.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/configuration.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/handler.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/handler_builder.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/handler_list_entry.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/http/headers.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/http/response.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/logging/formatter.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/logging/handler.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/managed_file.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/param_validator.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugin.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugin_list.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/content_length.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/json_simple.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/logging.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/net_http.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/operation_methods.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_conversion.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/param_validation.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/plugins/raise_response_errors.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/client/request_context.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/model/api.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/model/operation.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/util.rb +0 -0
- /data/{vendor/seahorse/lib → lib}/seahorse/version.rb +0 -0
data/spec/aws/xml/parser_spec.rb
DELETED
|
@@ -1,723 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'time'
|
|
3
|
-
|
|
4
|
-
module Aws
|
|
5
|
-
module Xml
|
|
6
|
-
describe Parser do
|
|
7
|
-
|
|
8
|
-
let(:members) { {} }
|
|
9
|
-
|
|
10
|
-
let(:definition) {{ 'type' => 'structure', 'members' => members }}
|
|
11
|
-
|
|
12
|
-
let(:shape) { Seahorse::Model::Shapes::Structure.new(definition) }
|
|
13
|
-
|
|
14
|
-
def parse(xml)
|
|
15
|
-
Parser.new(shape).parse(xml).to_hash
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'returns an empty hash when the XML is empty' do
|
|
19
|
-
expect(parse('<xml/>')).to eq({})
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'ignores xml namespaces on the root element' do
|
|
23
|
-
expect(parse('<xml xmlns="http://xmlns.com"/>')).to eq({})
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'ignores xml elements when the rules are empty' do
|
|
27
|
-
expect(parse('<xml><foo>bar</foo></xml>')).to eq({})
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'returns an instance of Struct' do
|
|
31
|
-
expect(Parser.new(shape).parse('<xml/>')).to be_kind_of(Aws::Structure)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
describe 'structures' do
|
|
35
|
-
|
|
36
|
-
it 'parses structure members' do
|
|
37
|
-
members['First'] = { 'type' => 'string' }
|
|
38
|
-
members['Last'] = { 'type' => 'string' }
|
|
39
|
-
xml = <<-XML
|
|
40
|
-
<xml>
|
|
41
|
-
<First>abc</First>
|
|
42
|
-
<Last>xyz</Last>
|
|
43
|
-
</xml>
|
|
44
|
-
XML
|
|
45
|
-
expect(parse(xml)).to eq(first: 'abc', last: 'xyz')
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it 'parses members using their location name' do
|
|
49
|
-
definition['members'] = {
|
|
50
|
-
'first' => { 'type' => 'string', 'locationName' => 'FirstName' },
|
|
51
|
-
'last' => { 'type' => 'string', 'locationName' => 'LastName' }
|
|
52
|
-
}
|
|
53
|
-
xml = <<-XML
|
|
54
|
-
<xml>
|
|
55
|
-
<FirstName>John</FirstName>
|
|
56
|
-
<LastName>Doe</LastName>
|
|
57
|
-
</xml>
|
|
58
|
-
XML
|
|
59
|
-
expect(parse(xml)).to eq(first: 'John', last: 'Doe')
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
it 'parses structures of structures' do
|
|
63
|
-
definition['members'] = {
|
|
64
|
-
'config' => {
|
|
65
|
-
'type' => 'structure',
|
|
66
|
-
'members' => {
|
|
67
|
-
'state' => { 'type' => 'string' }
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
'name' => { 'type' => 'string' }
|
|
71
|
-
}
|
|
72
|
-
xml = <<-XML
|
|
73
|
-
<xml>
|
|
74
|
-
<config>
|
|
75
|
-
<state>on</state>
|
|
76
|
-
</config>
|
|
77
|
-
<name>abc</name>
|
|
78
|
-
</xml>
|
|
79
|
-
XML
|
|
80
|
-
expect(parse(xml)).to eq(config: { state: 'on' }, name: 'abc')
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
describe 'non-flattened lists' do
|
|
86
|
-
|
|
87
|
-
it 'returns missing lists as []' do
|
|
88
|
-
definition['members'] = {
|
|
89
|
-
'Values' => {
|
|
90
|
-
'type' => 'list',
|
|
91
|
-
'member' => { 'type' => 'string' }
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
xml = "<xml/>"
|
|
95
|
-
expect(parse(xml)[:values]).to eq([])
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'returns empty list elements as []' do
|
|
99
|
-
definition['members'] = {
|
|
100
|
-
'Values' => {
|
|
101
|
-
'type' => 'list',
|
|
102
|
-
'member' => { 'type' => 'string' }
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
xml = "<xml><Values/></xml>"
|
|
106
|
-
expect(parse(xml)[:values]).to eq([])
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
it 'converts lists of strings into arrays of strings' do
|
|
110
|
-
definition['members'] = {
|
|
111
|
-
'Values' => {
|
|
112
|
-
'type' => 'list',
|
|
113
|
-
'member' => { 'type' => 'string' }
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
xml = <<-XML
|
|
117
|
-
<xml>
|
|
118
|
-
<Values>
|
|
119
|
-
<member>abc</member>
|
|
120
|
-
<member>mno</member>
|
|
121
|
-
<member>xyz</member>
|
|
122
|
-
</Values>
|
|
123
|
-
</xml>
|
|
124
|
-
XML
|
|
125
|
-
expect(parse(xml)[:values]).to eq(%w(abc mno xyz))
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it 'accepts lists of single elements' do
|
|
129
|
-
definition['members'] = {
|
|
130
|
-
'Values' => {
|
|
131
|
-
'type' => 'list',
|
|
132
|
-
'member' => {
|
|
133
|
-
'type' => 'structure',
|
|
134
|
-
'members' => {
|
|
135
|
-
'Enabled' => { 'type' => 'boolean' }
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
xml = <<-XML
|
|
141
|
-
<xml>
|
|
142
|
-
<Values>
|
|
143
|
-
<member>
|
|
144
|
-
<Enabled>true</Enabled>
|
|
145
|
-
</member>
|
|
146
|
-
</Values>
|
|
147
|
-
</xml>
|
|
148
|
-
XML
|
|
149
|
-
expect(parse(xml)[:values]).to eq([{ enabled: true }])
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
it 'observes the list member location name when present' do
|
|
153
|
-
definition['members'] = {
|
|
154
|
-
'Values' => {
|
|
155
|
-
'type' => 'list',
|
|
156
|
-
'member' => { 'type' => 'string', 'locationName' => 'Value' }
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
xml = <<-XML
|
|
160
|
-
<xml>
|
|
161
|
-
<Values>
|
|
162
|
-
<Value>abc</Value>
|
|
163
|
-
<Value>mno</Value>
|
|
164
|
-
<Value>xyz</Value>
|
|
165
|
-
</Values>
|
|
166
|
-
</xml>
|
|
167
|
-
XML
|
|
168
|
-
expect(parse(xml)[:values]).to eq(%w(abc mno xyz))
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
it 'can parse lists of complex types' do
|
|
172
|
-
definition['members'] = {
|
|
173
|
-
'Values' => {
|
|
174
|
-
'type' => 'list',
|
|
175
|
-
'member' => {
|
|
176
|
-
'type' => 'structure',
|
|
177
|
-
'locationName' => 'item',
|
|
178
|
-
'members' => { 'Name' => { 'type' => 'string' } }
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
xml = <<-XML
|
|
183
|
-
<xml>
|
|
184
|
-
<Values>
|
|
185
|
-
<item><Name>abc</Name></item>
|
|
186
|
-
<item><Name>mno</Name></item>
|
|
187
|
-
<item><Name>xyz</Name></item>
|
|
188
|
-
</Values>
|
|
189
|
-
</xml>
|
|
190
|
-
XML
|
|
191
|
-
expect(parse(xml)[:values]).to eq([
|
|
192
|
-
{ name: 'abc' },
|
|
193
|
-
{ name: 'mno' },
|
|
194
|
-
{ name: 'xyz' }
|
|
195
|
-
])
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
describe 'flattened lists' do
|
|
201
|
-
|
|
202
|
-
it 'returns missing lists as []' do
|
|
203
|
-
definition['members'] = {
|
|
204
|
-
'Values' => {
|
|
205
|
-
'type' => 'list',
|
|
206
|
-
'member' => { 'type' => 'string' },
|
|
207
|
-
'flattened' => true
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
xml = "<xml/>"
|
|
211
|
-
expect(parse(xml)[:values]).to eq([])
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
it 'returns empty list elements as []' do
|
|
215
|
-
definition['members'] = {
|
|
216
|
-
'Values' => {
|
|
217
|
-
'type' => 'list',
|
|
218
|
-
'member' => { 'type' => 'string' },
|
|
219
|
-
'flattened' => true
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
xml = "<xml><Values/></xml>"
|
|
223
|
-
expect(parse(xml)[:values]).to eq([])
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
it 'converts lists of strings into arrays of strings' do
|
|
227
|
-
definition['members'] = {
|
|
228
|
-
'Values' => {
|
|
229
|
-
'type' => 'list',
|
|
230
|
-
'member' => { 'type' => 'string' },
|
|
231
|
-
'flattened' => true
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
xml = <<-XML
|
|
235
|
-
<xml>
|
|
236
|
-
<Values>abc</Values>
|
|
237
|
-
<Values>mno</Values>
|
|
238
|
-
<Values>xyz</Values>
|
|
239
|
-
</xml>
|
|
240
|
-
XML
|
|
241
|
-
expect(parse(xml)[:values]).to eq(%w(abc mno xyz))
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
it 'accepts lists of a single element' do
|
|
245
|
-
definition['members'] = {
|
|
246
|
-
'Values' => {
|
|
247
|
-
'type' => 'list',
|
|
248
|
-
'member' => { 'type' => 'string' },
|
|
249
|
-
'flattened' => true
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
xml = <<-XML
|
|
253
|
-
<xml>
|
|
254
|
-
<Values>abc</Values>
|
|
255
|
-
</xml>
|
|
256
|
-
XML
|
|
257
|
-
expect(parse(xml)[:values]).to eq(['abc'])
|
|
258
|
-
end
|
|
259
|
-
|
|
260
|
-
it 'observes the list serialization name when present' do
|
|
261
|
-
definition['members'] = {
|
|
262
|
-
'Values' => {
|
|
263
|
-
'type' => 'list',
|
|
264
|
-
'member' => { 'type' => 'string', 'locationName' => 'Item' },
|
|
265
|
-
'flattened' => true
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
xml = <<-XML
|
|
269
|
-
<xml>
|
|
270
|
-
<Item>abc</Item>
|
|
271
|
-
<Item>mno</Item>
|
|
272
|
-
<Item>xyz</Item>
|
|
273
|
-
</xml>
|
|
274
|
-
XML
|
|
275
|
-
expect(parse(xml)[:values]).to eq(%w(abc mno xyz))
|
|
276
|
-
end
|
|
277
|
-
|
|
278
|
-
it 'can parse lists of complex types' do
|
|
279
|
-
definition['members'] = {
|
|
280
|
-
'People' => {
|
|
281
|
-
'type' => 'list',
|
|
282
|
-
'locationName' => 'Person',
|
|
283
|
-
'member' => {
|
|
284
|
-
'type' => 'structure',
|
|
285
|
-
'members' => {
|
|
286
|
-
'Handle' => { 'type' => 'string', 'locationName' => 'Name' }
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
'flattened' => true
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
xml = <<-XML
|
|
293
|
-
<xml>
|
|
294
|
-
<Person><Name>abc</Name></Person>
|
|
295
|
-
<Person><Name>mno</Name></Person>
|
|
296
|
-
<Person><Name>xyz</Name></Person>
|
|
297
|
-
</xml>
|
|
298
|
-
XML
|
|
299
|
-
expect(parse(xml)[:people]).to eq([
|
|
300
|
-
{ handle: 'abc' },
|
|
301
|
-
{ handle: 'mno' },
|
|
302
|
-
{ handle: 'xyz' }
|
|
303
|
-
])
|
|
304
|
-
end
|
|
305
|
-
|
|
306
|
-
end
|
|
307
|
-
|
|
308
|
-
describe 'non-flattened maps' do
|
|
309
|
-
|
|
310
|
-
it 'returns missing maps as {}' do
|
|
311
|
-
definition['members'] = {
|
|
312
|
-
'Attributes' => {
|
|
313
|
-
'type' => 'map',
|
|
314
|
-
'key' => { 'type' => 'string' },
|
|
315
|
-
'value' => { 'type' => 'string' }
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
xml = "<xml/>"
|
|
319
|
-
expect(parse(xml)[:attributes]).to eq({})
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
it 'returns empty maps as {}' do
|
|
323
|
-
definition['members'] = {
|
|
324
|
-
'Attributes' => {
|
|
325
|
-
'type' => 'map',
|
|
326
|
-
'key' => { 'type' => 'string' },
|
|
327
|
-
'value' => { 'type' => 'string' }
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
xml = "<xml><Attributes/></xml>"
|
|
331
|
-
expect(parse(xml)[:attributes]).to eq({})
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
it 'expects entry, key and value tags by default' do
|
|
335
|
-
definition['members'] = {
|
|
336
|
-
'Attributes' => {
|
|
337
|
-
'type' => 'map',
|
|
338
|
-
'key' => { 'type' => 'string' },
|
|
339
|
-
'value' => { 'type' => 'string' }
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
xml = <<-XML
|
|
343
|
-
<xml>
|
|
344
|
-
<Attributes>
|
|
345
|
-
<entry>
|
|
346
|
-
<key>Color</key>
|
|
347
|
-
<value>red</value>
|
|
348
|
-
</entry>
|
|
349
|
-
<entry>
|
|
350
|
-
<key>Size</key>
|
|
351
|
-
<value>large</value>
|
|
352
|
-
</entry>
|
|
353
|
-
</Attributes>
|
|
354
|
-
</xml>
|
|
355
|
-
XML
|
|
356
|
-
expect(parse(xml)[:attributes]).to eq({
|
|
357
|
-
'Color' => 'red',
|
|
358
|
-
'Size' => 'large'
|
|
359
|
-
})
|
|
360
|
-
end
|
|
361
|
-
|
|
362
|
-
it 'accepts maps with a single entry' do
|
|
363
|
-
definition['members'] = {
|
|
364
|
-
'Attributes' => {
|
|
365
|
-
'type' => 'map',
|
|
366
|
-
'key' => { 'type' => 'string' },
|
|
367
|
-
'value' => { 'type' => 'string' }
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
xml = <<-XML
|
|
371
|
-
<xml>
|
|
372
|
-
<Attributes>
|
|
373
|
-
<entry>
|
|
374
|
-
<key>Color</key>
|
|
375
|
-
<value>red</value>
|
|
376
|
-
</entry>
|
|
377
|
-
</Attributes>
|
|
378
|
-
</xml>
|
|
379
|
-
XML
|
|
380
|
-
expect(parse(xml)[:attributes]).to eq('Color' => 'red')
|
|
381
|
-
end
|
|
382
|
-
|
|
383
|
-
it 'accepts alternate key and value names' do
|
|
384
|
-
definition['members'] = {
|
|
385
|
-
'Attributes' => {
|
|
386
|
-
'type' => 'map',
|
|
387
|
-
'key' => { 'type' => 'string', 'locationName' => 'attr' },
|
|
388
|
-
'value' => { 'type' => 'string', 'locationName' => 'val' }
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
xml = <<-XML
|
|
392
|
-
<xml>
|
|
393
|
-
<Attributes>
|
|
394
|
-
<entry>
|
|
395
|
-
<attr>hue</attr>
|
|
396
|
-
<val>red</val>
|
|
397
|
-
</entry>
|
|
398
|
-
<entry>
|
|
399
|
-
<attr>size</attr>
|
|
400
|
-
<val>med</val>
|
|
401
|
-
</entry>
|
|
402
|
-
</Attributes>
|
|
403
|
-
</xml>
|
|
404
|
-
XML
|
|
405
|
-
expect(parse(xml)[:attributes]).to eq('hue' => 'red', 'size' => 'med')
|
|
406
|
-
end
|
|
407
|
-
|
|
408
|
-
end
|
|
409
|
-
|
|
410
|
-
describe 'flattened maps' do
|
|
411
|
-
|
|
412
|
-
it 'returns missing maps as {}' do
|
|
413
|
-
definition['members'] = {
|
|
414
|
-
'Attributes' => {
|
|
415
|
-
'type' => 'map',
|
|
416
|
-
'key' => { 'type' => 'string' },
|
|
417
|
-
'value' => { 'type' => 'string' },
|
|
418
|
-
'flattened' => true
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
xml = "<xml/>"
|
|
422
|
-
expect(parse(xml)[:attributes]).to eq({})
|
|
423
|
-
end
|
|
424
|
-
|
|
425
|
-
it 'returns empty maps as {}' do
|
|
426
|
-
definition['members'] = {
|
|
427
|
-
'Attributes' => {
|
|
428
|
-
'type' => 'map',
|
|
429
|
-
'key' => { 'type' => 'string' },
|
|
430
|
-
'value' => { 'type' => 'string' },
|
|
431
|
-
'flattened' => true
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
xml = "<xml><Attributes/></xml>"
|
|
435
|
-
expect(parse(xml)[:attributes]).to eq({})
|
|
436
|
-
end
|
|
437
|
-
|
|
438
|
-
it 'expects key and value tags by default' do
|
|
439
|
-
definition['members'] = {
|
|
440
|
-
'Attributes' => {
|
|
441
|
-
'type' => 'map',
|
|
442
|
-
'key' => { 'type' => 'string' },
|
|
443
|
-
'value' => { 'type' => 'string' },
|
|
444
|
-
'flattened' => true
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
xml = <<-XML
|
|
448
|
-
<xml>
|
|
449
|
-
<Attributes>
|
|
450
|
-
<key>Color</key>
|
|
451
|
-
<value>red</value>
|
|
452
|
-
</Attributes>
|
|
453
|
-
<Attributes>
|
|
454
|
-
<key>Size</key>
|
|
455
|
-
<value>large</value>
|
|
456
|
-
</Attributes>
|
|
457
|
-
</xml>
|
|
458
|
-
XML
|
|
459
|
-
expect(parse(xml)[:attributes]).to eq({
|
|
460
|
-
'Color' => 'red',
|
|
461
|
-
'Size' => 'large'
|
|
462
|
-
})
|
|
463
|
-
end
|
|
464
|
-
|
|
465
|
-
it 'accepts maps with a single entry' do
|
|
466
|
-
definition['members'] = {
|
|
467
|
-
'Attributes' => {
|
|
468
|
-
'type' => 'map',
|
|
469
|
-
'key' => { 'type' => 'string' },
|
|
470
|
-
'value' => { 'type' => 'string' },
|
|
471
|
-
'flattened' => true
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
xml = <<-XML
|
|
475
|
-
<xml>
|
|
476
|
-
<Attributes>
|
|
477
|
-
<key>Color</key>
|
|
478
|
-
<value>red</value>
|
|
479
|
-
</Attributes>
|
|
480
|
-
</xml>
|
|
481
|
-
XML
|
|
482
|
-
expect(parse(xml)[:attributes]).to eq('Color' => 'red')
|
|
483
|
-
end
|
|
484
|
-
|
|
485
|
-
it 'accepts alternate key and value names' do
|
|
486
|
-
definition['members'] = {
|
|
487
|
-
'Attributes' => {
|
|
488
|
-
'type' => 'map',
|
|
489
|
-
'key' => { 'type' => 'string', 'locationName' => 'attr' },
|
|
490
|
-
'value' => { 'type' => 'string', 'locationName' => 'val' },
|
|
491
|
-
'flattened' => true
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
xml = <<-XML
|
|
495
|
-
<xml>
|
|
496
|
-
<Attributes>
|
|
497
|
-
<attr>hue</attr>
|
|
498
|
-
<val>red</val>
|
|
499
|
-
</Attributes>
|
|
500
|
-
<Attributes>
|
|
501
|
-
<attr>size</attr>
|
|
502
|
-
<val>med</val>
|
|
503
|
-
</Attributes>
|
|
504
|
-
</xml>
|
|
505
|
-
XML
|
|
506
|
-
expect(parse(xml)[:attributes]).to eq('hue' => 'red', 'size' => 'med')
|
|
507
|
-
end
|
|
508
|
-
|
|
509
|
-
end
|
|
510
|
-
|
|
511
|
-
describe 'booleans' do
|
|
512
|
-
|
|
513
|
-
before(:each) do
|
|
514
|
-
definition['members'] = { 'enabled' => { 'type' => 'boolean' } }
|
|
515
|
-
end
|
|
516
|
-
|
|
517
|
-
it 'converts boolean true values' do
|
|
518
|
-
xml = "<xml><enabled>true</enabled></xml>"
|
|
519
|
-
expect(parse(xml)).to eq(enabled: true)
|
|
520
|
-
end
|
|
521
|
-
|
|
522
|
-
it 'converts boolean false values' do
|
|
523
|
-
xml = "<xml><enabled>false</enabled></xml>"
|
|
524
|
-
expect(parse(xml)).to eq(enabled: false)
|
|
525
|
-
end
|
|
526
|
-
|
|
527
|
-
it 'does not apply a boolean true/false value when not present' do
|
|
528
|
-
xml = "<xml/>"
|
|
529
|
-
expect(parse(xml)).to eq({})
|
|
530
|
-
end
|
|
531
|
-
|
|
532
|
-
end
|
|
533
|
-
|
|
534
|
-
describe 'timestamps' do
|
|
535
|
-
|
|
536
|
-
before(:each) do
|
|
537
|
-
definition['members'] = {
|
|
538
|
-
'CreatedAt' => {
|
|
539
|
-
'type' => 'timestamp',
|
|
540
|
-
'locationName' => 'Created',
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
end
|
|
544
|
-
|
|
545
|
-
it 'returns an empty element as nil' do
|
|
546
|
-
xml = "<xml><Created/></xml>"
|
|
547
|
-
expect(parse(xml)[:created_at]).to be(nil)
|
|
548
|
-
end
|
|
549
|
-
|
|
550
|
-
it 'can parse unix timestamps' do
|
|
551
|
-
timestamp = 1349908100
|
|
552
|
-
time = Time.at(timestamp)
|
|
553
|
-
xml = "<xml><Created>#{timestamp}</Created></xml>"
|
|
554
|
-
data = parse(xml)
|
|
555
|
-
expect(data[:created_at]).to be_a(Time)
|
|
556
|
-
expect(data[:created_at]).to eq(time)
|
|
557
|
-
end
|
|
558
|
-
|
|
559
|
-
it 'understands basic iso8601 strings' do
|
|
560
|
-
timestamp = '2012-09-10T15:47:10.001Z'
|
|
561
|
-
time = Time.parse(timestamp).to_time.utc
|
|
562
|
-
xml = "<xml><Created>#{timestamp}</Created></xml>"
|
|
563
|
-
data = parse(xml)
|
|
564
|
-
expect(data[:created_at]).to be_a(Time)
|
|
565
|
-
expect(data[:created_at]).to eq(time)
|
|
566
|
-
end
|
|
567
|
-
|
|
568
|
-
it 'understands basic rfc822 strings' do
|
|
569
|
-
timestamp = 'Wed, 10 Oct 2012 15:59:55 UTC'
|
|
570
|
-
time = Time.parse(timestamp).to_time.utc
|
|
571
|
-
xml = "<xml><Created>#{timestamp}</Created></xml>"
|
|
572
|
-
data = parse(xml)
|
|
573
|
-
expect(data[:created_at]).to be_a(Time)
|
|
574
|
-
expect(data[:created_at]).to eq(time)
|
|
575
|
-
end
|
|
576
|
-
|
|
577
|
-
it 'throws an error when unable to determine the format' do
|
|
578
|
-
timestamp = 'bad-date-format'
|
|
579
|
-
xml = "<xml><Created>#{timestamp}</Created></xml>"
|
|
580
|
-
expect {
|
|
581
|
-
parse(xml)
|
|
582
|
-
}.to raise_error("unhandled timestamp format `#{timestamp}'")
|
|
583
|
-
end
|
|
584
|
-
|
|
585
|
-
end
|
|
586
|
-
|
|
587
|
-
describe 'integers' do
|
|
588
|
-
|
|
589
|
-
before(:each) do
|
|
590
|
-
definition['members'] = { 'count' => { 'type' => 'integer' } }
|
|
591
|
-
end
|
|
592
|
-
|
|
593
|
-
it 'parses integer elements' do
|
|
594
|
-
xml = "<xml><count>123</count></xml>"
|
|
595
|
-
expect(parse(xml)[:count]).to eq(123)
|
|
596
|
-
end
|
|
597
|
-
|
|
598
|
-
it 'returns empty elements as nil' do
|
|
599
|
-
xml = "<xml><count/></xml>"
|
|
600
|
-
expect(parse(xml)[:count]).to eq(nil)
|
|
601
|
-
end
|
|
602
|
-
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
describe 'floats' do
|
|
606
|
-
|
|
607
|
-
before(:each) do
|
|
608
|
-
definition['members'] = { 'price' => { 'type' => 'float' } }
|
|
609
|
-
end
|
|
610
|
-
|
|
611
|
-
it 'parses float elements' do
|
|
612
|
-
xml = "<xml><price>12.34</price></xml>"
|
|
613
|
-
expect(parse(xml)[:price]).to eq(12.34)
|
|
614
|
-
end
|
|
615
|
-
|
|
616
|
-
it 'returns empty elements as nil' do
|
|
617
|
-
xml = "<xml><price/></xml>"
|
|
618
|
-
expect(parse(xml)[:price]).to eq(nil)
|
|
619
|
-
end
|
|
620
|
-
|
|
621
|
-
end
|
|
622
|
-
|
|
623
|
-
describe 'strings' do
|
|
624
|
-
|
|
625
|
-
it 'returns nil for empty elements' do
|
|
626
|
-
definition['members'] = {
|
|
627
|
-
'data' => { 'type' => 'string' }
|
|
628
|
-
}
|
|
629
|
-
xml = "<xml><data/></xml>"
|
|
630
|
-
expect(parse(xml)[:data]).to be(nil)
|
|
631
|
-
end
|
|
632
|
-
|
|
633
|
-
it 'base64 decodes strings when encoding attribute is present' do
|
|
634
|
-
definition['members'] = {
|
|
635
|
-
'encoded' => { 'type' => 'string' },
|
|
636
|
-
'not_encoded' => { 'type' => 'string' },
|
|
637
|
-
'nested' => {
|
|
638
|
-
'type' => 'structure',
|
|
639
|
-
'members' => {
|
|
640
|
-
'encoded' => { 'type' => 'string' }
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
xml = <<-XML.strip
|
|
645
|
-
<xml>
|
|
646
|
-
<encoded encoding="base64">#{Base64.encode64('a')}</encoded>
|
|
647
|
-
<not_encoded abc="yxz">mno</not_encoded>
|
|
648
|
-
<nested>
|
|
649
|
-
<encoded encoding="base64">#{Base64.encode64('b')}</encoded>
|
|
650
|
-
</nested>
|
|
651
|
-
</xml>
|
|
652
|
-
XML
|
|
653
|
-
parsed = parse(xml)
|
|
654
|
-
expect(parsed[:encoded]).to eq('a')
|
|
655
|
-
expect(parsed[:nested][:encoded]).to eq('b')
|
|
656
|
-
expect(parsed[:not_encoded]).to eq('mno')
|
|
657
|
-
end
|
|
658
|
-
|
|
659
|
-
end
|
|
660
|
-
|
|
661
|
-
describe 'blobs' do
|
|
662
|
-
|
|
663
|
-
it 'returns nil for empty elements' do
|
|
664
|
-
definition['members'] = {
|
|
665
|
-
'data' => { 'type' => 'blob' }
|
|
666
|
-
}
|
|
667
|
-
xml = "<xml><data/></xml>"
|
|
668
|
-
expect(parse(xml)[:data]).to be(nil)
|
|
669
|
-
end
|
|
670
|
-
|
|
671
|
-
it 'base64 decodes blob elements' do
|
|
672
|
-
definition['members'] = {
|
|
673
|
-
'data' => { 'type' => 'blob' }
|
|
674
|
-
}
|
|
675
|
-
xml = "<xml><data>aGVsbG8=</data></xml>"
|
|
676
|
-
expect(parse(xml)).to eq(data: 'hello')
|
|
677
|
-
end
|
|
678
|
-
|
|
679
|
-
end
|
|
680
|
-
|
|
681
|
-
describe 'xml attributes' do
|
|
682
|
-
|
|
683
|
-
it 'omits attributes that are not members' do
|
|
684
|
-
definition['members'] = {
|
|
685
|
-
'config' => {
|
|
686
|
-
'type' => 'structure',
|
|
687
|
-
'members' => {
|
|
688
|
-
'state' => { 'type' => 'string' }
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
xml = "<xml><config foo='bar'><state>on</state></config></xml>"
|
|
693
|
-
expect(parse(xml)).to eq(config: { state: 'on' })
|
|
694
|
-
end
|
|
695
|
-
|
|
696
|
-
it 'merges xml attributes that are members' do
|
|
697
|
-
definition['members'] = {
|
|
698
|
-
'config' => {
|
|
699
|
-
'type' => 'structure',
|
|
700
|
-
'members' => {
|
|
701
|
-
'state' => { 'type' => 'string' },
|
|
702
|
-
'foo' => { 'type' => 'string' }
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
xml = "<xml><config foo='bar'><state>on</state></config></xml>"
|
|
707
|
-
expect(parse(xml)).to eq(config: { state: 'on', foo: 'bar' })
|
|
708
|
-
end
|
|
709
|
-
|
|
710
|
-
end
|
|
711
|
-
|
|
712
|
-
describe 'parsing errors' do
|
|
713
|
-
|
|
714
|
-
it 'does not trap xml parsing errors' do
|
|
715
|
-
xml = '<xml'
|
|
716
|
-
expect { parse(xml) }.to raise_error
|
|
717
|
-
end
|
|
718
|
-
|
|
719
|
-
end
|
|
720
|
-
|
|
721
|
-
end
|
|
722
|
-
end
|
|
723
|
-
end
|