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
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
module Seahorse
|
|
4
|
-
module Client
|
|
5
|
-
describe HandlerList do
|
|
6
|
-
|
|
7
|
-
let(:handlers) { HandlerList.new }
|
|
8
|
-
|
|
9
|
-
it 'is enumerable' do
|
|
10
|
-
expect(handlers).to be_kind_of(Enumerable)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
describe '#add' do
|
|
14
|
-
|
|
15
|
-
it 'adds a handler' do
|
|
16
|
-
handler = Class.new
|
|
17
|
-
handlers.add(handler)
|
|
18
|
-
expect(handlers.to_a).to eq([handler])
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it 'handlers added first have a higher priority' do
|
|
22
|
-
handler1 = Class.new
|
|
23
|
-
handler2 = Class.new
|
|
24
|
-
handlers.add(handler1)
|
|
25
|
-
handlers.add(handler2)
|
|
26
|
-
expect(handlers.to_a).to eq([handler2, handler1])
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'returns the handler class' do
|
|
30
|
-
handler_class = Class.new(Handler)
|
|
31
|
-
expect(handlers.add(handler_class)).to be(handler_class)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
describe ':step' do
|
|
35
|
-
|
|
36
|
-
it 'sorts handlers by step priority order' do
|
|
37
|
-
handlers.add('validate', step: :validate)
|
|
38
|
-
handlers.add('build', step: :build)
|
|
39
|
-
handlers.add('sign', step: :sign)
|
|
40
|
-
handlers.add('send', step: :send)
|
|
41
|
-
expect(handlers.to_a).to eq(%w(send sign build validate))
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it 'defaults step to :build' do
|
|
45
|
-
handlers.add('validate', step: :validate)
|
|
46
|
-
handlers.add('build')
|
|
47
|
-
handlers.add('sign', step: :sign)
|
|
48
|
-
expect(handlers.to_a).to eq(['sign', 'build', 'validate'])
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it 'accepts multiple handlers with the same step' do
|
|
52
|
-
handlers.add('h1', step: :validate)
|
|
53
|
-
handlers.add('h2', step: :validate)
|
|
54
|
-
handlers.add('h3', step: :build)
|
|
55
|
-
handlers.add('h4', step: :build)
|
|
56
|
-
expect(handlers.to_a).to eq(%w(h4 h3 h2 h1))
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
describe ':priority' do
|
|
62
|
-
|
|
63
|
-
it 'accepts a priority' do
|
|
64
|
-
handlers.add('medium', priority: 50)
|
|
65
|
-
handlers.add('high', priority: 80)
|
|
66
|
-
handlers.add('low', priority: 20)
|
|
67
|
-
expect(handlers.to_a).to eq(%w(low medium high))
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it 'sorts handler with the same priority in FIFO order' do
|
|
71
|
-
handlers.add('a', priority: 20, step: :sign)
|
|
72
|
-
handlers.add('b', priority: 20, step: :sign)
|
|
73
|
-
handlers.add('c', priority: 20, step: :sign)
|
|
74
|
-
handlers.add('m', priority: 20, step: :build)
|
|
75
|
-
handlers.add('n', priority: 20, step: :build)
|
|
76
|
-
handlers.add('o', priority: 20, step: :build)
|
|
77
|
-
handlers.add('x', priority: 20, step: :validate)
|
|
78
|
-
handlers.add('y', priority: 20, step: :validate)
|
|
79
|
-
handlers.add('z', priority: 20, step: :validate)
|
|
80
|
-
handlers.add('-', step: :send)
|
|
81
|
-
expect(handlers.to_a).to eq(%w(- c b a o n m z y x))
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
describe 'errors' do
|
|
87
|
-
|
|
88
|
-
it 'raises an error if :step is not valid' do
|
|
89
|
-
msg = "invalid :step `:bogus', must be one of :initialize, "
|
|
90
|
-
msg << ":validate, :build, :sign or :send"
|
|
91
|
-
expect {
|
|
92
|
-
handlers.add('handler', step: :bogus)
|
|
93
|
-
}.to raise_error(ArgumentError, msg)
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'raises an error if :priority is less than 0' do
|
|
97
|
-
msg = "invalid :priority `-1', must be between 0 and 99"
|
|
98
|
-
expect {
|
|
99
|
-
handlers.add('handler', priority: -1)
|
|
100
|
-
}.to raise_error(ArgumentError, msg)
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it 'raises an error if :priority is greater than 99' do
|
|
104
|
-
msg = "invalid :priority `100', must be between 0 and 99"
|
|
105
|
-
expect {
|
|
106
|
-
handlers.add('handler', priority: 100)
|
|
107
|
-
}.to raise_error(ArgumentError, msg)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
describe ':step => :send' do
|
|
113
|
-
|
|
114
|
-
it 'only keeps the latest send handler' do
|
|
115
|
-
handlers.add('handler1', step: :send)
|
|
116
|
-
handlers.add('handler2', step: :send)
|
|
117
|
-
handlers.add('handler3', step: :send)
|
|
118
|
-
expect(handlers.to_a).to eq(['handler3'])
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
it 'ignores :priority when adding :send handlers' do
|
|
122
|
-
handlers.add('handler1', step: :send, priority: 80)
|
|
123
|
-
handlers.add('handler2', step: :send, priority: 50)
|
|
124
|
-
handlers.add('handler3', step: :send, priority: 20)
|
|
125
|
-
expect(handlers.to_a).to eq(['handler3'])
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
describe ':operations' do
|
|
131
|
-
|
|
132
|
-
it 'adds a handler that is not enumerated by default' do
|
|
133
|
-
handlers.add('handler', operations: ['operation_name'])
|
|
134
|
-
expect(handlers.to_a).to eq([])
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
it 'adds a handler that is enumerated for a given :operation' do
|
|
138
|
-
handlers.add('handler1', operations: ['operation1'])
|
|
139
|
-
handlers.add('handler2', operations: ['operation1'])
|
|
140
|
-
handlers.add('handler3', operations: ['operation2'])
|
|
141
|
-
expect(handlers.for('operation1').to_a).to eq(%w(handler2 handler1))
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
describe '#copy_from' do
|
|
149
|
-
|
|
150
|
-
it 'copies handlers from one list to another' do
|
|
151
|
-
handlers.add('send', step: :send)
|
|
152
|
-
handlers.add('handler')
|
|
153
|
-
handlers2 = HandlerList.new
|
|
154
|
-
handlers2.copy_from(handlers)
|
|
155
|
-
expect(handlers2.to_a).to eq(handlers.to_a)
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
end
|
|
159
|
-
|
|
160
|
-
describe '#for' do
|
|
161
|
-
|
|
162
|
-
it 'returns a handler list' do
|
|
163
|
-
expect(handlers.for('operation')).to be_kind_of(HandlerList)
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
it 'returns a different handler list' do
|
|
167
|
-
expect(handlers.for('operation')).to_not be(handlers)
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
it 'copies the send handler' do
|
|
171
|
-
handlers.add('send', step: :send)
|
|
172
|
-
expect(handlers.for('operation').to_a).to eq(['send'])
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
it 'copies the common handlers' do
|
|
176
|
-
handlers.add('validate', step: :validate)
|
|
177
|
-
handlers.add('build', step: :build)
|
|
178
|
-
handlers.add('sign', step: :sign)
|
|
179
|
-
expect(handlers.for('operation').to_a).to eq(%w(sign build validate))
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
it 'deep copies handlers' do
|
|
183
|
-
handlers.add('handler1')
|
|
184
|
-
handlers2 = handlers.for('operation')
|
|
185
|
-
handlers2.add('handler2')
|
|
186
|
-
expect(handlers.to_a).to eq(['handler1'])
|
|
187
|
-
expect(handlers2.to_a).to eq(['handler2', 'handler1'])
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
it 'copies operation handlers with the given name' do
|
|
191
|
-
handlers.add('handler', operations: ['operation'])
|
|
192
|
-
expect(handlers.for('operation').to_a).to eq(['handler'])
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
it 'does not copy operation handlers that have a different name' do
|
|
196
|
-
handlers.add('handler', operations: ['operation'])
|
|
197
|
-
expect(handlers.for('operation2').to_a).to eq([])
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
it 'merges operation and common handlers preserving priority' do
|
|
201
|
-
handlers.add('high', priority: 30, operation: 'operation')
|
|
202
|
-
handlers.add('medium', priority: 20, operation: 'operation')
|
|
203
|
-
handlers.add('low', priority: 10)
|
|
204
|
-
expect(handlers.for('operation').to_a).to eq(%w(low medium high))
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
it 'accpets operation names as symbols' do
|
|
208
|
-
handlers.add('handler1', operations: [:operation])
|
|
209
|
-
handlers.add('handler2', operations: ['operation'])
|
|
210
|
-
expect(handlers.for('operation').to_a).to eq(%w(handler2 handler1))
|
|
211
|
-
expect(handlers.for(:operation).to_a).to eq(%w(handler2 handler1))
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
describe '#to_stack' do
|
|
217
|
-
|
|
218
|
-
it 'constructs a handler stack' do
|
|
219
|
-
handler = Handler
|
|
220
|
-
expect(handler).to receive(:new).with(nil).and_return(1)
|
|
221
|
-
expect(handler).to receive(:new).with(1).and_return(2)
|
|
222
|
-
expect(handler).to receive(:new).with(2).and_return(3)
|
|
223
|
-
handlers.add(handler)
|
|
224
|
-
handlers.add(handler)
|
|
225
|
-
handlers.add(handler)
|
|
226
|
-
expect(handlers.to_stack).to eq(3)
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
end
|
|
232
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
module Seahorse
|
|
4
|
-
module Client
|
|
5
|
-
describe Handler do
|
|
6
|
-
|
|
7
|
-
let(:context) { RequestContext.new }
|
|
8
|
-
let(:response) { Response.new }
|
|
9
|
-
|
|
10
|
-
it 'provides access to the nested handler' do
|
|
11
|
-
handler = Handler.new
|
|
12
|
-
expect(Handler.new(handler).handler).to be(handler)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it 'responds to #call' do
|
|
16
|
-
expect(Handler.new).to respond_to(:call)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'chains #call to the nested handler' do
|
|
20
|
-
handler = double('handler')
|
|
21
|
-
expect(handler).to receive(:call).with(context) { response }
|
|
22
|
-
Handler.new(handler).call(context)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'returns the response from the nested handler' do
|
|
26
|
-
handler = double('handler')
|
|
27
|
-
expect(handler).to receive(:call).with(context) { response }
|
|
28
|
-
expect(Handler.new(handler).call(context)).to be(response)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
describe '#inspect' do
|
|
32
|
-
|
|
33
|
-
it 'overrides class name for anonymous handler' do
|
|
34
|
-
handler = Class.new(Handler).new
|
|
35
|
-
expect(handler.inspect).to eql '#<UnnamedHandler @handler=nil>'
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
module Seahorse
|
|
4
|
-
module Client
|
|
5
|
-
module Http
|
|
6
|
-
describe Headers do
|
|
7
|
-
|
|
8
|
-
let(:headers) { Headers.new }
|
|
9
|
-
|
|
10
|
-
it 'provides indifferent access to symbolized keys' do
|
|
11
|
-
headers[:key] = 'value'
|
|
12
|
-
expect(headers[:key]).to eq('value')
|
|
13
|
-
expect(headers['key']).to eq('value')
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it 'provides indifferent access to string keys' do
|
|
17
|
-
headers['key'] = 'value'
|
|
18
|
-
expect(headers['key']).to eq('value')
|
|
19
|
-
expect(headers[:key]).to eq('value')
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'provides case-insenitive access to keys' do
|
|
23
|
-
headers['Content-Length'] = 100
|
|
24
|
-
expect(headers['content-length']).to eq('100')
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it 'stringifies values' do
|
|
28
|
-
headers['key'] = 123
|
|
29
|
-
expect(headers['key']).to eq('123')
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'can be seeded by the constructor' do
|
|
33
|
-
hash = { 'abc' => '123' }
|
|
34
|
-
headers = Headers.new(hash)
|
|
35
|
-
expect(headers.to_hash).to eq(hash)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
describe '#to_hash' do
|
|
39
|
-
|
|
40
|
-
it 'returns a regular hash' do
|
|
41
|
-
headers[:abc] = 'xyz'
|
|
42
|
-
expect(headers.to_hash).to eq({ 'abc' => 'xyz' })
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
it 'is aliased as #to_h' do
|
|
46
|
-
headers[:abc] = 'xyz'
|
|
47
|
-
expect(headers.to_h).to eq({ 'abc' => 'xyz' })
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it 'returns a new hash that protects internal state' do
|
|
51
|
-
headers['abc'] = 'xyz'
|
|
52
|
-
headers.to_hash['abc'] = 'mno'
|
|
53
|
-
expect(headers['abc']).to eq('xyz')
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
describe '#update' do
|
|
59
|
-
|
|
60
|
-
it 'accepts a hash, updating self' do
|
|
61
|
-
headers.update(:abc => 123, 'xyz' => '234')
|
|
62
|
-
expect(headers['abc']).to eq('123')
|
|
63
|
-
expect(headers['xyz']).to eq('234')
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
describe '#each' do
|
|
69
|
-
|
|
70
|
-
it 'is enumerable' do
|
|
71
|
-
expect(headers).to be_kind_of(Enumerable)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it 'returns nil if a block is given' do
|
|
75
|
-
ret = headers.each {}
|
|
76
|
-
expect(ret).to eq(nil)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'returns an Enumerator if a block is not given' do
|
|
80
|
-
expect(headers.each).to be_kind_of(Enumerator)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it 'yields headers keys and values' do
|
|
84
|
-
headers['key1'] = 'value1'
|
|
85
|
-
headers['key2'] = 'value2'
|
|
86
|
-
yielded = []
|
|
87
|
-
headers.each do |key, value|
|
|
88
|
-
yielded << [key, value]
|
|
89
|
-
end
|
|
90
|
-
expect(yielded.sort_by(&:first)).to eq([
|
|
91
|
-
['key1', 'value1'],
|
|
92
|
-
['key2', 'value2'],
|
|
93
|
-
])
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'is aliased as #each_pair' do
|
|
97
|
-
headers['key1'] = 'value1'
|
|
98
|
-
headers['key2'] = 'value2'
|
|
99
|
-
yielded = []
|
|
100
|
-
headers.each_pair do |key, value|
|
|
101
|
-
yielded << [key, value]
|
|
102
|
-
end
|
|
103
|
-
expect(yielded.sort_by(&:first)).to eq([
|
|
104
|
-
['key1', 'value1'],
|
|
105
|
-
['key2', 'value2'],
|
|
106
|
-
])
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
describe '#delete' do
|
|
112
|
-
|
|
113
|
-
it 'deletes a header by key' do
|
|
114
|
-
headers['key1'] = 'value1'
|
|
115
|
-
headers.delete('key1')
|
|
116
|
-
expect(headers).to_not have_key('key1')
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
it 'deletes header with a symbol key' do
|
|
120
|
-
headers['key1'] = 'value'
|
|
121
|
-
headers.delete(:key1)
|
|
122
|
-
expect(headers).to_not have_key('key1')
|
|
123
|
-
expect(headers).to_not have_key(:key1)
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
it 'deletes headers ignoring case' do
|
|
127
|
-
headers['key1'] = 'value'
|
|
128
|
-
headers['Key2'] = 'value'
|
|
129
|
-
headers.delete('Key1')
|
|
130
|
-
headers.delete('key2')
|
|
131
|
-
expect(headers).to_not have_key('key1')
|
|
132
|
-
expect(headers).to_not have_key('Key1')
|
|
133
|
-
expect(headers).to_not have_key('key2')
|
|
134
|
-
expect(headers).to_not have_key('Key2')
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
describe '#keys' do
|
|
140
|
-
|
|
141
|
-
it 'returns the keys' do
|
|
142
|
-
headers['key1'] = 'value1'
|
|
143
|
-
headers['key2'] = 'value2'
|
|
144
|
-
expect(headers.keys).to eql(['key1', 'key2'])
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
describe '#values' do
|
|
150
|
-
|
|
151
|
-
it 'returns the values' do
|
|
152
|
-
headers['key1'] = 'value1'
|
|
153
|
-
headers['key2'] = 'value2'
|
|
154
|
-
expect(headers.values).to eql(['value1', 'value2'])
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
describe '#values_at' do
|
|
160
|
-
|
|
161
|
-
it 'returns the values for the given keys' do
|
|
162
|
-
headers['key1'] = 'v1'
|
|
163
|
-
headers['key2'] = 'v2'
|
|
164
|
-
expect(headers.values_at('key2', 'key1')).to eql(['v2', 'v1'])
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
describe '#key?' do
|
|
170
|
-
|
|
171
|
-
it 'returns true if the header has been set' do
|
|
172
|
-
headers['foo'] = 'bar'
|
|
173
|
-
expect(headers.key?('foo')).to eq(true)
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
it 'treats symbols indifferently' do
|
|
177
|
-
headers['foo'] = 'bar'
|
|
178
|
-
expect(headers.key?(:foo)).to be(true)
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
it 'treats strings case insensitively' do
|
|
182
|
-
headers['foo'] = 'bar'
|
|
183
|
-
expect(headers.key?('Foo')).to be(true)
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
it 'returns false if the header has not been set' do
|
|
187
|
-
expect(headers.key?('foo')).to be(false)
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
it 'is aliased as #has_key?' do
|
|
191
|
-
headers['foo'] = 'bar'
|
|
192
|
-
expect(headers.has_key?('foo')).to be(true)
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
it 'is aliased as #include?' do
|
|
196
|
-
headers['foo'] = 'bar'
|
|
197
|
-
expect(headers.include?('foo')).to be(true)
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
describe '#inspect' do
|
|
203
|
-
|
|
204
|
-
it 'inspects like a normal hash' do
|
|
205
|
-
headers['foo'] = 'bar'
|
|
206
|
-
expect(headers.inspect).to eq({'foo' => 'bar'}.inspect)
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
end
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
end
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'stringio'
|
|
3
|
-
|
|
4
|
-
module Seahorse
|
|
5
|
-
module Client
|
|
6
|
-
module Http
|
|
7
|
-
describe Request do
|
|
8
|
-
|
|
9
|
-
def request(*args) Request.new(*args) end
|
|
10
|
-
|
|
11
|
-
describe '#endpoint' do
|
|
12
|
-
|
|
13
|
-
it 'defaults to nil' do
|
|
14
|
-
expect(request.endpoint).to eq(nil)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'can be set in the constructor' do
|
|
18
|
-
endpoint = 'http://foo.com/'
|
|
19
|
-
req = request(endpoint: endpoint)
|
|
20
|
-
expect(req.endpoint).to eq(URI.parse(endpoint))
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it 'can be blanked out' do
|
|
24
|
-
req = request(endpoint: 'http://foo.com')
|
|
25
|
-
req.endpoint = nil
|
|
26
|
-
expect(req.endpoint).to be(nil)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'converts strings to URIs' do
|
|
30
|
-
req = Request.new
|
|
31
|
-
req.endpoint = 'http://foo.com'
|
|
32
|
-
expect(req.endpoint).to be_kind_of(URI::HTTP)
|
|
33
|
-
expect(req.endpoint).to eq(URI.parse('http://foo.com'))
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'supports https endpoints' do
|
|
37
|
-
req = Request.new
|
|
38
|
-
req.endpoint = 'https://foo.com'
|
|
39
|
-
expect(req.endpoint).to be_kind_of(URI::HTTPS)
|
|
40
|
-
expect(req.endpoint).to eq(URI.parse('https://foo.com'))
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
describe '#http_method' do
|
|
46
|
-
|
|
47
|
-
it 'defaults to GET' do
|
|
48
|
-
expect(request.http_method).to eq('GET')
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it 'can be set in the constructor' do
|
|
52
|
-
req = request(http_method: 'POST')
|
|
53
|
-
expect(req.http_method).to eq('POST')
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
describe '#headers' do
|
|
59
|
-
|
|
60
|
-
it 'defaults to a Http::Headers' do
|
|
61
|
-
expect(request.headers).to be_kind_of(Headers)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it 'provides a default user agent' do
|
|
65
|
-
expect(request.headers.to_h).to eq(
|
|
66
|
-
'user-agent' => "Seahorse/#{Seahorse::VERSION}"
|
|
67
|
-
)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it 'sets a default user agent' do
|
|
71
|
-
ua = request.headers['User-Agent']
|
|
72
|
-
expect(ua).to eq("Seahorse/#{Seahorse::VERSION}")
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it 'does not set the user-agent when given in the constructor' do
|
|
76
|
-
req = request(headers: { 'User-Agent' => 'ua' })
|
|
77
|
-
expect(req.headers['User-Agent']).to eq('ua')
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
it 'casts incoming headers as a Http::Headers object' do
|
|
81
|
-
req = request(headers: { 'User-Agent' => 'ua' })
|
|
82
|
-
expect(req.headers).to be_kind_of(Http::Headers)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
describe '#body' do
|
|
88
|
-
|
|
89
|
-
it 'defaults to an empty IO-like object' do
|
|
90
|
-
expect(request.body.read).to eq('')
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it 'can be set in the constructor' do
|
|
94
|
-
body = StringIO.new('body')
|
|
95
|
-
expect(request(body: body).body).to be(body)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'can be set as a string in the constructor' do
|
|
99
|
-
req = request(body: 'body')
|
|
100
|
-
expect(req.body).to be_a(StringIO)
|
|
101
|
-
expect(req.body.read).to eq('body')
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
it 'converts nil bodies into empty io objects' do
|
|
105
|
-
req = request
|
|
106
|
-
req.body = nil
|
|
107
|
-
expect(req.body.read).to eq('')
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
it 'can be set as a string in accessor' do
|
|
111
|
-
req = request
|
|
112
|
-
req.body = 'body'
|
|
113
|
-
expect(req.body).to be_a(StringIO)
|
|
114
|
-
expect(req.body.read).to eq('body')
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
end
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
module Seahorse
|
|
4
|
-
module Client
|
|
5
|
-
module Http
|
|
6
|
-
describe Response do
|
|
7
|
-
|
|
8
|
-
describe '#status_code' do
|
|
9
|
-
|
|
10
|
-
it 'defaults to 0' do
|
|
11
|
-
expect(Response.new.status_code).to eq(0)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it 'can be set' do
|
|
15
|
-
resp = Response.new
|
|
16
|
-
resp.status_code = 500
|
|
17
|
-
expect(resp.status_code).to eq(500)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
describe '#headers' do
|
|
23
|
-
|
|
24
|
-
it 'is a Http::Headers' do
|
|
25
|
-
expect(Response.new.headers).to be_kind_of(Headers)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'defaults to a empty hash' do
|
|
29
|
-
expect(Response.new.headers.to_h).to eq({})
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'can be set' do
|
|
33
|
-
headers = Headers.new
|
|
34
|
-
response = Response.new
|
|
35
|
-
response.headers = headers
|
|
36
|
-
expect(response.headers).to be(headers)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
describe '#body' do
|
|
42
|
-
|
|
43
|
-
it 'defaults to an IO object' do
|
|
44
|
-
expect(Response.new.body).to respond_to(:write)
|
|
45
|
-
expect(Response.new.body).to respond_to(:read)
|
|
46
|
-
expect(Response.new.body).to respond_to(:rewind)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'defaults to an empty body' do
|
|
50
|
-
body = Response.new.body
|
|
51
|
-
body.rewind
|
|
52
|
-
expect(body.read).to eq('')
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it 'can be set' do
|
|
56
|
-
body = Object.new
|
|
57
|
-
response = Response.new
|
|
58
|
-
response.body = body
|
|
59
|
-
expect(response.body).to be(body)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
describe '#body_contents' do
|
|
65
|
-
|
|
66
|
-
it 'returns the body as a string' do
|
|
67
|
-
response = Response.new
|
|
68
|
-
response.body = StringIO.new('abc')
|
|
69
|
-
expect(response.body_contents).to eq(response.body.read)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|