diff --git a/Gopkg.lock b/Gopkg.lock index 7e0960f..2cf255d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,7 +2,7 @@ [[projects]] - digest = "1:105a96fda710a64f0388222f7c31cf2078e2f5f9b7783c08677b41744310c4f3" + digest = "1:4538fa77bf2ba9e4c1e2a4c00666093bd81f537cc72874267c19a93d2ee8c00f" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -48,8 +48,8 @@ "service/sts/stsiface", ] pruneopts = "UT" - revision = "f421e2327a6e6566d937e4519317765f3cd0e856" - version = "v1.25.48" + revision = "fcbfc357f185c1d55e2c37626357ec92abd52286" + version = "v1.26.8" [[projects]] digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" @@ -75,25 +75,6 @@ pruneopts = "UT" revision = "ea13c021720c495c6747ee07bc5376afdd1ff900" -[[projects]] - digest = "1:a54d9b22e14caae3254cfa3e86c814c720e334bc49b0e153a673a7137642598e" - name = "github.com/go-kit/kit" - packages = [ - "log", - "log/level", - ] - pruneopts = "UT" - revision = "150a65a7ec6156b4b640c1fd55f26fd3d475d656" - version = "v0.9.0" - -[[projects]] - digest = "1:4062bc6de62d73e2be342243cf138cf499b34d558876db8d9430e2149388a4d8" - name = "github.com/go-logfmt/logfmt" - packages = ["."] - pruneopts = "UT" - revision = "07c9b44f60d7ffdfb7d8efe1ad539965737836dc" - version = "v0.4.0" - [[projects]] digest = "1:573ca21d3669500ff845bdebee890eb7fc7f0f50c59f2132f2a0c6b03d85086a" name = "github.com/golang/protobuf" @@ -110,12 +91,12 @@ revision = "c2b33e84" [[projects]] - digest = "1:beb5b4f42a25056f0aa291b5eadd21e2f2903a05d15dfe7caf7eaee7e12fa972" + digest = "1:7cd2924a44ecf80a319cfa2378529fabd348d011b739fb4eccc565f65e3296c4" name = "github.com/json-iterator/go" packages = ["."] pruneopts = "UT" - revision = "03217c3e97663914aec3faafde50d081f197a0a2" - version = "v1.1.8" + revision = "acfec88f7a0d5140ace3dcdbee10184e3684a9e1" + version = "v1.1.9" [[projects]] digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de" @@ -125,14 +106,6 @@ revision = "f55edac94c9bbba5d6182a4be46d86a2c9b5b50e" version = "v1.0.2" -[[projects]] - branch = "master" - digest = "1:a64e323dc06b73892e5bb5d040ced475c4645d456038333883f58934abbf6f72" - name = "github.com/kr/logfmt" - packages = ["."] - pruneopts = "UT" - revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" - [[projects]] digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" @@ -157,14 +130,6 @@ revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" -[[projects]] - digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "UT" - revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" - version = "v0.8.1" - [[projects]] digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" @@ -185,16 +150,16 @@ version = "v1.1.0" [[projects]] - branch = "master" digest = "1:982be0b5396e16a663697899ce69cc7b1e71ddcae4153af157578d4dc9bc3f88" name = "github.com/prometheus/client_model" packages = ["go"] pruneopts = "UT" revision = "d1d2010b5beead3fa1c5f271a5cf626e40b3ad6e" + version = "v0.1.0" [[projects]] branch = "master" - digest = "1:7dec9ab2db741c280b89b142b08ea142824152c5f40fb1f90c35b6ef7a694456" + digest = "1:ba75229a1404913593f067be36b8ad916148bdd2b14592d9e40bd5f770d46ae4" name = "github.com/prometheus/common" packages = [ "expfmt", @@ -203,7 +168,7 @@ "version", ] pruneopts = "UT" - revision = "b5fe7d854c42dc7842e48d1ca58f60feae09d77b" + revision = "7680068d4af7bd5cb3043381494f956c22c034b2" [[projects]] digest = "1:ec0ff4bd619a67065e34d6477711ed0117e335f99059a4c508e0fe21cfe7b304" @@ -243,30 +208,14 @@ [[projects]] branch = "master" - digest = "1:0cc11cd6954a646d5ff24f6ec4f3b1aa13a32273ecf358e637fd05bcb42bc67f" - name = "github.com/weaveworks/common" - packages = ["logging"] - pruneopts = "UT" - revision = "02b9c3fc5b90b294b61e167321cfbc64c5d57b9a" - -[[projects]] - digest = "1:bb40f7ff970145324f2a2acafdff3a23ed3f05db49cb5eb519b3d6bee86a5887" - name = "github.com/weaveworks/promrus" - packages = ["."] - pruneopts = "UT" - revision = "0599d764e054d4e983bb120e30759179fafe3942" - version = "v1.2.0" - -[[projects]] - branch = "master" - digest = "1:8191c209ac2aaba9e958a061256fab8955ad10cc731aa609660184800f1ef55a" + digest = "1:33a7c341af0f0358f9ac03d9d12d6990b9a8dc1641e1845fea2e6810fd0572af" name = "golang.org/x/sys" packages = [ "unix", "windows", ] pruneopts = "UT" - revision = "eeba5f6aabab6d6594a9191d6bfeaca5fa6a8248" + revision = "c709ea063b76879dc9915358f55d4d77c16ab6d5" [[projects]] digest = "1:b75b3deb2bce8bc079e16bb2aecfe01eb80098f5650f9e93e5643ca8b7b73737" @@ -291,7 +240,6 @@ "github.com/prometheus/common/version", "github.com/sirupsen/logrus", "github.com/stretchr/testify/assert", - "github.com/weaveworks/common/logging", ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/aws/aws-sdk-go/.gitignore b/vendor/github.com/aws/aws-sdk-go/.gitignore deleted file mode 100644 index fb11cec..0000000 --- a/vendor/github.com/aws/aws-sdk-go/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -dist -/doc -/doc-staging -.yardoc -Gemfile.lock -awstesting/integration/smoke/**/importmarker__.go -awstesting/integration/smoke/_test/ -/vendor/bin/ -/vendor/pkg/ -/vendor/src/ -/private/model/cli/gen-api/gen-api diff --git a/vendor/github.com/aws/aws-sdk-go/.godoc_config b/vendor/github.com/aws/aws-sdk-go/.godoc_config deleted file mode 100644 index 0c6400b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/.godoc_config +++ /dev/null @@ -1,14 +0,0 @@ -{ - "PkgHandler": { - "Pattern": "/sdk-for-go/api/", - "StripPrefix": "/sdk-for-go/api", - "Include": ["/src/github.com/aws/aws-sdk-go/aws", "/src/github.com/aws/aws-sdk-go/service"], - "Exclude": ["/src/cmd", "/src/github.com/aws/aws-sdk-go/awstesting", "/src/github.com/aws/aws-sdk-go/awsmigrate", "/src/github.com/aws/aws-sdk-go/private"], - "IgnoredSuffixes": ["iface"] - }, - "Github": { - "Tag": "master", - "Repo": "/aws/aws-sdk-go", - "UseGithub": true - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/.travis.yml b/vendor/github.com/aws/aws-sdk-go/.travis.yml deleted file mode 100644 index d0914ef..0000000 --- a/vendor/github.com/aws/aws-sdk-go/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: go - -sudo: required - -os: - - linux - - osx -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -matrix: - allow_failures: - - go: tip - - os: windows - exclude: - # OSX 1.6.4 is not present in travis. - # https://github.com/travis-ci/travis-ci/issues/10309 - - go: 1.6.x - os: osx - include: - - os: windows - go: 1.12.x - - os: windows - go: 1.13.x - - os: windows - go: tip - - os: linux - go: 1.5.x - # Use Go 1.5's vendoring experiment for 1.5 tests. - env: GO15VENDOREXPERIMENT=1 - -before_install: - - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi - -script: - - if [ "$TRAVIS_OS_NAME" = "windows" ]; then - make get-deps; - make unit-no-verify; - else - if [ $TRAVIS_GO_VERSION == "1.10.x" ] || - [ $TRAVIS_GO_VERSION == "1.11.x" ] || - [ $TRAVIS_GO_VERSION == "1.12.x" ] || - [ $TRAVIS_GO_VERSION == "1.13.x" ] || - [ $TRAVIS_GO_VERSION == "tip" ]; then - make get-deps; - make ci-test; - else - make get-deps-tests; - make unit-old-go-race-cover; - fi - fi - -branches: - only: - - master diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md deleted file mode 100644 index dc73d5d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md +++ /dev/null @@ -1,7992 +0,0 @@ -Release v1.25.48 (2019-12-05) -=== - -### Service Client Updates -* `service/apigatewayv2`: Updates service API and documentation - * Amazon API Gateway now supports HTTP APIs (beta), enabling customers to quickly build high performance RESTful APIs that are up to 71% cheaper than REST APIs also available from API Gateway. HTTP APIs are optimized for building APIs that proxy to AWS Lambda functions or HTTP backends, making them ideal for serverless workloads. Using HTTP APIs, you can secure your APIs using OIDC and OAuth 2 out of box, quickly build web applications using a simple CORS experience, and get started immediately with automatic deployment and simple create workflows. -* `service/kinesis-video-signaling`: Adds new service -* `service/kinesisvideo`: Updates service API, documentation, and paginators - * Introduces management of signaling channels for Kinesis Video Streams. - -Release v1.25.47 (2019-12-04) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/ebs`: Adds new service -* `service/lambda`: Updates service API, documentation, and paginators - * - Added the ProvisionedConcurrency type and operations. Allocate provisioned concurrency to enable your function to scale up without fluctuations in latency. Use PutProvisionedConcurrencyConfig to configure provisioned concurrency on a version of a function, or on an alias. -* `service/rds`: Updates service API, documentation, and paginators - * This release adds support for the Amazon RDS Proxy -* `service/rekognition`: Updates service API, documentation, waiters, and paginators - * This SDK Release introduces APIs for Amazon Rekognition Custom Labels feature (CreateProjects, CreateProjectVersion,DescribeProjects, DescribeProjectVersions, StartProjectVersion, StopProjectVersion and DetectCustomLabels). Also new is AugmentedAI (Human In The Loop) Support for DetectModerationLabels in Amazon Rekognition. -* `service/sagemaker`: Updates service API, documentation, waiters, and paginators - * You can now use SageMaker Autopilot for automatically training and tuning candidate models using a combination of various feature engineering, ML algorithms, and hyperparameters determined from the user's input data. SageMaker Automatic Model Tuning now supports tuning across multiple algorithms. With Amazon SageMaker Experiments users can create Experiments, ExperimentTrials, and ExperimentTrialComponents to track, organize, and evaluate their ML training jobs. With Amazon SageMaker Debugger, users can easily debug training jobs using a number of pre-built rules provided by Amazon SageMaker, or build custom rules. With Amazon SageMaker Processing, users can run on-demand, distributed, and fully managed jobs for data pre- or post- processing or model evaluation. With Amazon SageMaker Model Monitor, a user can create MonitoringSchedules to automatically monitor endpoints to detect data drift and other issues and get alerted on them. This release also includes the preview version of Amazon SageMaker Studio with Domains, UserProfiles, and Apps. This release also includes the preview version of Amazon Augmented AI to easily implement human review of machine learning predictions by creating FlowDefinitions, HumanTaskUis, and HumanLoops. -* `service/states`: Updates service API and documentation - * This release of the AWS Step Functions SDK introduces support for Express Workflows. - -Release v1.25.46 (2019-12-03) -=== - -### Service Client Updates -* `service/codeguru-reviewer`: Adds new service -* `service/codeguruprofiler`: Adds new service -* `service/compute-optimizer`: Adds new service -* `service/ec2`: Updates service API and documentation - * This release adds support for the following features: 1. An option to enable acceleration for Site-to-Site VPN connections, to improve connection performance by leveraging AWS Global Accelerator; 2. Inf1 instances featuring up to 16 AWS Inferentia chips, custom-built for ML inference applications to deliver low latency and high throughput performance. Use Inf1 instances to run high scale ML inference applications such as image recognition, speech recognition, natural language processing, personalization, and fraud detection at the lowest cost in the cloud. Inf1 instances will soon be available for use with Amazon SageMaker, Amazon EKS and Amazon ECS. To get started, see https://aws.amazon.com/ec2/instance-types/Inf1; 3. The ability to associate route tables with internet gateways and virtual private gateways, and define routes to insert network and security virtual appliances in the path of inbound and outbound traffic. For more information on Amazon VPC Ingress Routing, see https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#gateway-route-table; 4. AWS Local Zones that place compute, storage, database, and other select services closer to you for applications that require very low latency to your end-users. AWS Local Zones also allow you to seamlessly connect to the full range of services in the AWS Region through the same APIs and tool sets; 5. Launching and viewing EC2 instances and EBS volumes running locally in Outposts. This release also introduces a new local gateway (LGW) with Outposts to enable connectivity between Outposts and local on-premises networks as well as the internet; 6. Peering Transit Gateways between regions simplifying creation of secure and private global networks on AWS; 7. Transit Gateway Multicast, enabling multicast routing within and between VPCs using Transit Gateway as a multicast router. -* `service/ecs`: Updates service API, documentation, and paginators - * This release supports ECS Capacity Providers, Fargate Spot, and ECS Cluster Auto Scaling. These features enable new ways for ECS to manage compute capacity used by tasks. -* `service/eks`: Updates service API, documentation, and paginators -* `service/es`: Updates service API and documentation - * UltraWarm storage provides a cost-effective way to store large amounts of read-only data on Amazon Elasticsearch Service. Rather than attached storage, UltraWarm nodes use Amazon S3 and a sophisticated caching solution to improve performance. For indices that you are not actively writing to and query less frequently, UltraWarm storage offers significantly lower costs per GiB. In Elasticsearch, these warm indices behave just like any other index. You can query them using the same APIs or use them to create dashboards in Kibana. -* `service/frauddetector`: Adds new service -* `service/kendra`: Adds new service - * It is a preview launch of Amazon Kendra. Amazon Kendra is a managed, highly accurate and easy to use enterprise search service that is powered by machine learning. -* `service/networkmanager`: Adds new service -* `service/outposts`: Adds new service -* `service/s3`: Updates service documentation and examples - * Amazon S3 Access Points is a new S3 feature that simplifies managing data access at scale for shared data sets on Amazon S3. Access Points provide a customizable way to access the objects in a bucket, with a unique hostname and access policy that enforces the specific permissions and network controls for any request made through the access point. This represents a new way of provisioning access to shared data sets. -* `service/s3control`: Updates service documentation - * Amazon S3 Access Points is a new S3 feature that simplifies managing data access at scale for shared data sets on Amazon S3. Access Points provide a customizable way to access the objects in a bucket, with a unique hostname and access policy that enforces the specific permissions and network controls for any request made through the access point. This represents a new way of provisioning access to shared data sets. -* `service/sagemaker-a2i-runtime`: Adds new service -* `service/textract`: Updates service API and documentation - -### SDK Enhancements -* `service/s3`: Add support for Access Point resources - * Adds support for using Access Point resource with Amazon S3 API operation calls. The Access Point resource are identified by an Amazon Resource Name (ARN). - * To make operation calls to an S3 Access Point instead of a S3 Bucket, provide the Access Point ARN string as the value of the Bucket parameter. You can create an Access Point for your bucket with the Amazon S3 Control API. The Access Point ARN can be obtained from the S3 Control API. You should avoid building the ARN directly. - -Release v1.25.45 (2019-12-02) -=== - -### Service Client Updates -* `service/accessanalyzer`: Adds new service - -Release v1.25.44 (2019-12-02) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * AWS now provides a new BYOL experience for software licenses, such as Windows and SQL Server, that require a dedicated physical server. You can now enjoy the flexibility and cost effectiveness of using your own licenses on Amazon EC2 Dedicated Hosts, but with the simplicity, resiliency, and elasticity of AWS. You can specify your Dedicated Host management preferences, such as host allocation, host capacity utilization, and instance placement in AWS License Manager. Once set up, AWS takes care of these administrative tasks on your behalf, so that you can seamlessly launch virtual machines (instances) on Dedicated Hosts just like you would launch an EC2 instance with AWS provided licenses. -* `service/imagebuilder`: Adds new service -* `service/license-manager`: Updates service API and documentation -* `service/schemas`: Adds new service - -Release v1.25.43 (2019-11-26) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/ds`: Updates service API and documentation - * This release will introduce optional encryption over LDAP network traffic using SSL certificates between customer's self-managed AD and AWS Directory Services instances. The release also provides APIs for Certificate management. -* `service/dynamodb`: Updates service API, documentation, and paginators - * 1) Amazon Contributor Insights for Amazon DynamoDB is a diagnostic tool for identifying frequently accessed keys and understanding database traffic trends. 2) Support for displaying new fields when a table's encryption state is Inaccessible or the table have been Archived. -* `service/elastic-inference`: Adds new service -* `service/mediatailor`: Updates service API and documentation -* `service/organizations`: Updates service API and documentation - * Introduces the DescribeEffectivePolicy action, which returns the contents of the policy that's in effect for the account. -* `service/quicksight`: Updates service documentation - * Documentation updates for QuickSight -* `service/rds-data`: Updates service API and documentation -* `service/resourcegroupstaggingapi`: Updates service API, documentation, and paginators - * You can use tag policies to help standardize on tags across your organization's resources. -* `service/serverlessrepo`: Updates service API and documentation -* `service/workspaces`: Updates service API and documentation - * For the WorkspaceBundle API, added the image identifier and the time of the last update. - -Release v1.25.42 (2019-11-25) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/appconfig`: Adds new service -* `service/application-autoscaling`: Updates service API and documentation -* `service/application-insights`: Updates service API, documentation, and paginators -* `service/athena`: Updates service API and documentation - * This release adds additional query lifecycle metrics to the QueryExecutionStatistics object in GetQueryExecution response. -* `service/ce`: Updates service API and documentation -* `service/codebuild`: Updates service API and documentation - * CodeBuild adds support for test reporting -* `service/cognito-idp`: Updates service API -* `service/comprehend`: Updates service API and documentation -* `service/dlm`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * This release adds two new APIs: 1. ModifyDefaultCreditSpecification, which allows you to set default credit specification at the account level per AWS Region, per burstable performance instance family, so that all new burstable performance instances in the account launch using the new default credit specification. 2. GetDefaultCreditSpecification, which allows you to get current default credit specification per AWS Region, per burstable performance instance family. This release also adds new client exceptions for StartInstances and StopInstances. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/greengrass`: Updates service API and documentation - * IoT Greengrass supports machine learning resources in 'No container' mode. -* `service/iot`: Updates service API and documentation - * This release adds: 1) APIs for fleet provisioning claim and template, 2) endpoint configuration and custom domains, 3) support for enhanced custom authentication, d) support for 4 additional audit checks: Device and CA certificate key quality checks, IoT role alias over-permissive check and IoT role alias access to unused services check, 5) extended capability of AWS IoT Rules Engine to support IoT SiteWise rule action. The IoT SiteWise rule action lets you send messages from IoT sensors and applications to IoT SiteWise asset properties -* `service/iotsecuretunneling`: Adds new service -* `service/kinesisanalyticsv2`: Updates service API and documentation -* `service/kms`: Updates service API and documentation - * AWS Key Management Service (KMS) now enables creation and use of asymmetric Customer Master Keys (CMKs) and the generation of asymmetric data key pairs. -* `service/lambda`: Updates service API, documentation, waiters, and paginators - * Added the function state and update status to the output of GetFunctionConfiguration and other actions. Check the state information to ensure that a function is ready before you perform operations on it. Functions take time to become ready when you connect them to a VPC.Added the EventInvokeConfig type and operations to configure error handling options for asynchronous invocation. Use PutFunctionEventInvokeConfig to configure the number of retries and the maximum age of events when you invoke the function asynchronously.Added on-failure and on-success destination settings for asynchronous invocation. Configure destinations to send an invocation record to an SNS topic, an SQS queue, an EventBridge event bus, or a Lambda function.Added error handling options to event source mappings. This enables you to configure the number of retries, configure the maximum age of records, or retry with smaller batches when an error occurs when a function processes a Kinesis or DynamoDB stream.Added the on-failure destination setting to event source mappings. This enables you to send discarded events to an SNS topic or SQS queue when all retries fail or when the maximum record age is exceeded when a function processes a Kinesis or DynamoDB stream.Added the ParallelizationFactor option to event source mappings to increase concurrency per shard when a function processes a Kinesis or DynamoDB stream. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added support for 8K outputs and support for QuickTime Animation Codec (RLE) inputs. -* `service/medialive`: Updates service API, documentation, waiters, and paginators - * AWS Elemental MediaLive now supports the ability to create a multiple program transport stream (MPTS). -* `service/mediapackage-vod`: Updates service API and documentation -* `service/monitoring`: Updates service API, documentation, and paginators - * This release adds a new feature called "Contributor Insights". "Contributor Insights" supports the following 6 new APIs (PutInsightRule, DeleteInsightRules, EnableInsightRules, DisableInsightRules, DescribeInsightRules and GetInsightRuleReport). -* `service/ram`: Updates service API and documentation -* `service/rds`: Updates service API and documentation - * Cluster Endpoints can now be tagged by using --tags in the create-db-cluster-endpoint API -* `service/redshift`: Updates service API, documentation, and paginators - * This release contains changes for 1. Redshift Scheduler 2. Update to the DescribeNodeConfigurationOptions to include a new action type recommend-node-config -* `service/runtime.lex`: Updates service API and documentation -* `service/sesv2`: Updates service API, documentation, and paginators -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager Documents now supports more Document Types: ApplicationConfiguration, ApplicationConfigurationSchema and DeploymentStrategy. This release also extends Document Permissions capabilities and introduces a new Force flag for DeleteDocument API. - -### SDK Enhancements -* `aws/credentials/processcreds`: Increase the default max buffer size ([#2957](https://github.com/aws/aws-sdk-go/pull/2957)) - * Fixes [#2875](https://github.com/aws/aws-sdk-go/issues/2875) - -Release v1.25.41 (2019-11-22) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * This release adds support for Tag-Based IAM for AWS Certificate Manager and adding tags to certificates upon creation. -* `service/application-autoscaling`: Updates service API -* `service/autoscaling-plans`: Updates service API -* `service/codebuild`: Updates service API and documentation - * Add Canonical ARN to LogsLocation. -* `service/ec2`: Updates service API and documentation - * This release adds two new APIs (DescribeInstanceTypes and DescribeInstanceTypeOfferings) that give customers access to instance type attributes and regional and zonal offerings. -* `service/elasticmapreduce`: Updates service API and documentation - * Amazon EMR adds support for concurrent step execution and cancelling running steps. Amazon EMR has added a new Outpost ARN field in the ListCluster and DescribeCluster API responses that is populated for clusters launched in an AWS Outpost subnet. -* `service/forecast`: Updates service API and documentation -* `service/mediapackage-vod`: Updates service API and documentation -* `service/rekognition`: Updates service API and documentation - * This release adds enhanced face filtering support to the IndexFaces API operation, and introduces face filtering for CompareFaces and SearchFacesByImage API operations. -* `service/sns`: Updates service documentation - * Added documentation for the dead-letter queue feature. -* `service/ssm`: Updates service API and documentation - * Add RebootOption and LastNoRebootInstallOperationTime for DescribeInstancePatchStates and DescribeInstancePatchStatesForPatchGroup API -* `service/sts`: Updates service API, documentation, and examples - * Support tagging for STS sessions and tag based access control for the STS APIs - -### SDK Bugs -* `aws/ec2metadata`: Fix failing concurrency test for ec2metadata client ([#2960](https://github.com/aws/aws-sdk-go/pull/2960)) - -Release v1.25.40 (2019-11-21) -=== - -### Service Client Updates -* `service/amplify`: Updates service API and documentation -* `service/appsync`: Updates service API and documentation -* `service/config`: Updates service API and documentation -* `service/connect`: Updates service API and documentation -* `service/connectparticipant`: Adds new service -* `service/dynamodb`: Updates service API and documentation - * With this release, you can convert an existing Amazon DynamoDB table to a global table by adding replicas in other AWS Regions. -* `service/ec2`: Updates service API and documentation - * This release adds support for attaching AWS License Manager Configurations to Amazon Machine Image (AMI) using ImportImage API; and adds support for running different instance sizes on EC2 Dedicated Hosts -* `service/glue`: Updates service API and documentation - * This release adds support for Glue 1.0 compatible ML Transforms. -* `service/lex-models`: Updates service API and documentation -* `service/meteringmarketplace`: Updates service documentation - * Documentation updates for the AWS Marketplace Metering Service. -* `service/runtime.lex`: Updates service API and documentation -* `service/ssm`: Updates service API and documentation - * The release contains new API and API changes for AWS Systems Manager Explorer product. -* `service/transcribe`: Updates service API - -Release v1.25.39 (2019-11-20) -=== - -### Service Client Updates -* `service/AWSMigrationHub`: Updates service API, documentation, and paginators -* `service/chime`: Updates service API, documentation, and paginators - * Adds APIs to create and manage meeting session resources for the Amazon Chime SDK -* `service/cloudtrail`: Updates service API and documentation - * 1. This release adds two new APIs, GetInsightSelectors and PutInsightSelectors, which let you configure CloudTrail Insights event delivery on a trail. An Insights event is a new type of event that is generated when CloudTrail detects unusual activity in your AWS account. In this release, only "ApiCallRateInsight" is a supported Insights event type. 2. This release also adds the new "ExcludeManagementEventSource" option to the existing PutEventSelectors API. This field currently supports only AWS Key Management Services. -* `service/codecommit`: Updates service API, documentation, and paginators - * This release adds support for creating pull request approval rules and pull request approval rule templates in AWS CodeCommit. This allows developers to block merges of pull requests, contingent on the approval rules being satisfiied. -* `service/datasync`: Updates service API and documentation -* `service/discovery`: Updates service API and documentation - * New exception type for use with Migration Hub home region -* `service/dlm`: Updates service API and documentation -* `service/ec2`: Updates service API, documentation, waiters, and paginators - * This release of Amazon Elastic Compute Cloud (Amazon EC2) introduces support for Amazon Elastic Block Store (Amazon EBS) fast snapshot restores. -* `service/ecs`: Updates service API and documentation - * Added support for CPU and memory task-level overrides on the RunTask and StartTask APIs. Added location information to Tasks. -* `service/firehose`: Updates service API and documentation - * With this release, Amazon Kinesis Data Firehose allows server side encryption with customer managed CMKs. Customer managed CMKs ( "Customer Master Keys") are AWS Key Management Service (KMS) keys that are fully managed by the customer. With customer managed CMKs, customers can establish and maintain their key policies, IAM policies, rotating policies and add tags. For more information about AWS KMS and CMKs, please refer to: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html. Please refer to the following link to create CMKs: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html -* `service/fsx`: Updates service API and documentation -* `service/mediastore`: Updates service API and documentation - * This release fixes a broken link in the SDK documentation. -* `service/migrationhub-config`: Adds new service -* `service/quicksight`: Updates service API, documentation, and paginators - * Amazon QuickSight now supports programmatic creation and management of data sources, data sets, dashboards and templates with new APIs. Templates hold dashboard metadata, and can be used to create copies connected to the same or different dataset as required. Also included in this release are APIs for SPICE ingestions, fine-grained access control over AWS resources using AWS Identity and Access Management (IAM) policies, as well AWS tagging. APIs are supported for both Standard and Enterprise Edition, with edition-specific support for specific functionality. -* `service/s3`: Updates service API and documentation - * This release introduces support for Amazon S3 Replication Time Control, a new feature of S3 Replication that provides a predictable replication time backed by a Service Level Agreement. S3 Replication Time Control helps customers meet compliance or business requirements for data replication, and provides visibility into the replication process with new Amazon CloudWatch Metrics. -* `service/storagegateway`: Updates service API and documentation - * The new DescribeAvailabilityMonitorTest API provides the results of the most recent High Availability monitoring test. The new StartAvailabilityMonitorTest API verifies the storage gateway is configured for High Availability monitoring. The new ActiveDirectoryStatus response element has been added to the DescribeSMBSettings and JoinDomain APIs to indicate the status of the gateway after the most recent JoinDomain operation. The new TimeoutInSeconds parameter of the JoinDomain API allows for the configuration of the timeout in which the JoinDomain operation must complete. -* `service/transcribe`: Updates service API and documentation - -Release v1.25.38 (2019-11-19) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Amazon EC2 Auto Scaling now supports Instance Weighting and Max Instance Lifetime. Instance Weighting allows specifying the capacity units for each instance type included in the MixedInstancesPolicy and how they would contribute to your application's performance. Max Instance Lifetime allows specifying the maximum length of time that an instance can be in service. If any instances are approaching this limit, Amazon EC2 Auto Scaling gradually replaces them. -* `service/cloudformation`: Updates service API and documentation - * This release of AWS CloudFormation StackSets enables users to detect drift on a stack set and the stack instances that belong to that stack set. -* `service/codebuild`: Updates service API and documentation - * Add support for ARM and GPU-enhanced build environments and a new SSD-backed Linux compute type with additional CPU and memory in CodeBuild -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * This release adds support for RunInstances to specify the metadata options for new instances; adds a new API, ModifyInstanceMetadataOptions, which lets you modify the metadata options for a running or stopped instance; and adds support for CreateCustomerGateway to specify a device name. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/iam`: Updates service API, documentation, and examples - * IAM reports the timestamp when a role's credentials were last used to make an AWS request. This helps you identify unused roles and remove them confidently from your AWS accounts. -* `service/iot`: Updates service API and documentation - * As part of this release, we are extending the capability of AWS IoT Rules Engine to send messages directly to customer's own web services/applications. Customers can now create topic rules with HTTP actions to route messages from IoT Core directly to URL's that they own. Ownership is proved by creating and confirming topic rule destinations. -* `service/lambda`: Updates service API - * This release provides three new runtimes to support Node.js 12 (initially 12.13.0), Python 3.8 and Java 11. - -### SDK Enhancements -* `aws/ec2metadata`: Adds support for EC2Metadata client to use secure tokens provided by the IMDS ([#2958](https://github.com/aws/aws-sdk-go/pull/2958)) - * Modifies and adds tests to verify the behavior of the EC2Metadata client. - -Release v1.25.37 (2019-11-18) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/cloudformation`: Updates service API, documentation, waiters, and paginators - * This release introduces APIs for the CloudFormation Registry, a new service to submit and discover resource providers with which you can manage third-party resources natively in CloudFormation. -* `service/pinpoint`: Updates service API and documentation - * This release of the Amazon Pinpoint API introduces support for using and managing message templates for messages that are sent through the voice channel. It also introduces support for specifying default values for message variables in message templates. -* `service/rds`: Updates service documentation - * Documentation updates for rds -* `service/runtime.sagemaker`: Updates service API and documentation -* `service/s3`: Updates service API, documentation, and examples - * Added support for S3 Replication for existing objects. This release allows customers who have requested and been granted access to replicate existing S3 objects across buckets. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker now supports multi-model endpoints to host multiple models on an endpoint using a single inference container. -* `service/ssm`: Updates service API and documentation - * The release contains new API and API changes for AWS Systems Manager Explorer product. - -Release v1.25.36 (2019-11-15) -=== - -### Service Client Updates -* `service/chime`: Updates service API, documentation, and paginators - * This release adds support for Chime Room Management APIs -* `service/cognito-idp`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * You can now add tags while copying snapshots. Previously, a user had to first copy the snapshot and then add tags to the copied snapshot manually. Moving forward, you can specify the list of tags you wish to be applied to the copied snapshot as a parameter on the Copy Snapshot API. -* `service/eks`: Updates service API, documentation, waiters, paginators, and examples -* `service/elasticloadbalancingv2`: Updates service documentation -* `service/elasticmapreduce`: Updates service API and documentation - * Access to the cluster ARN makes it easier for you to author resource-level permissions policies in AWS Identity and Access Management. To simplify the process of obtaining the cluster ARN, Amazon EMR has added a new field containing the cluster ARN to all API responses that include the cluster ID. -* `service/guardduty`: Updates service API, documentation, and paginators - * This release includes new operations related to findings export, including: CreatePublishingDestination, UpdatePublishingDestination, DescribePublishingDestination, DeletePublishingDestination and ListPublishingDestinations. -* `service/logs`: Updates service documentation - * Documentation updates for logs -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added support for DolbyVision encoding, and SCTE35 & ESAM insertion to DASH ISO EMSG. -* `service/ssm`: Updates service documentation - * This release updates AWS Systems Manager Parameter Store documentation for the enhanced search capability. -* `service/workspaces`: Updates service API and documentation - * Added APIs to register your directories with Amazon WorkSpaces and to modify directory details. - -Release v1.25.35 (2019-11-14) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/connect`: Updates service API and documentation -* `service/meteringmarketplace`: Updates service API and documentation - * Added CustomerNotEntitledException in MeterUsage API for Container use case. -* `service/personalize`: Updates service API, documentation, and paginators -* `service/ssm`: Updates service API and documentation - * Updates support for adding attachments to Systems Manager Automation documents - -### SDK Enhancements -* `aws/endpoints`: Add support for regional S3 us-east-1 endpoint - * Adds support for S3 configuring an SDK Amazon S3 client for the regional us-east-1 endpoint instead of the default global S3 endpoint. - * Adds a new configuration option, `S3UsEast1RegionalEndpoint` which when set to `RegionalS3UsEast1Endpoint`, and region is `us-east-1` the S3 client will resolve the `us-east-1` regional endpoint, `s3.us-east-1.amazonaws.com` instead of the global S3 endpoint, `s3.amazonaws.com`. The SDK defaults to the current global S3 endpoint resolution for backwards compatibility. - * Opt-in to the `us-east-1` regional endpoint via the SDK's Config, environment variable, `AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional`, or shared config option, `s3_us_east_1_regional_endpoint=regional`. - * Note the SDK does not support the shared configuration file by default. You must opt-in to that behavior via Session Option `SharedConfigState`, or `AWS_SDK_LOAD_CONFIG=true` environment variable. - -Release v1.25.34 (2019-11-13) -=== - -### Service Client Updates -* `service/cloudsearch`: Updates service API, documentation, paginators, and examples - * Amazon CloudSearch domains let you require that all traffic to the domain arrive over HTTPS. This security feature helps you block clients that send unencrypted requests to the domain. -* `service/dataexchange`: Adds new service -* `service/dlm`: Updates service API and documentation -* `service/iot`: Updates service API and documentation - * This release adds the custom fields definition support in the index definition for AWS IoT Fleet Indexing Service. Custom fields can be used as an aggregation field to run aggregations with both existing GetStatistics API and newly added GetCardinality, GetPercentiles APIs. GetStatistics will return all statistics (min/max/sum/avg/count...) with this release. For more information, please refer to our latest documentation: https://docs.aws.amazon.com/iot/latest/developerguide/iot-indexing.html -* `service/sesv2`: Adds new service - -### SDK Enhancements -* Replaced case-insensitive string comparisons with `strings.EqualFold(...)` ([#2922](https://github.com/aws/aws-sdk-go/pull/2922)) - -Release v1.25.33 (2019-11-12) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service API and documentation - * AWS CodePipeline now supports the use of variables in action configuration. -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB enables you to restore your data to a new DynamoDB table using a point-in-time or on-demand backup. You now can modify the settings on the new restored table. Specifically, you can exclude some or all of the local and global secondary indexes from being created with the restored table. In addition, you can change the billing mode and provisioned capacity settings. -* `service/elasticloadbalancingv2`: Updates service documentation -* `service/marketplace-catalog`: Adds new service -* `service/transcribe`: Updates service API and documentation - -Release v1.25.32 (2019-11-11) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/cloudformation`: Updates service API, documentation, and waiters - * The Resource Import feature enables customers to import existing AWS resources into new or existing CloudFormation Stacks. - -Release v1.25.31 (2019-11-08) -=== - -### Service Client Updates -* `service/cognito-identity`: Updates service API and documentation -* `service/ecr`: Updates service documentation - * This release contains ticket fixes for Amazon ECR. - -### SDK Bugs -* `aws/request`: Ensure New request handles nil retryer ([#2934](https://github.com/aws/aws-sdk-go/pull/2934)) - * Adds additional default behavior to the SDK's New request constructor, to handle the case where a nil Retryer was passed in. This error could occur when the SDK's Request type was being used to create requests directly, not through one of the SDK's client. - * Fixes [#2889](https://github.com/aws/aws-sdk-go/issues/2889) - -Release v1.25.30 (2019-11-07) -=== - -### Service Client Updates -* `service/comprehend`: Updates service API and documentation -* `service/ssm`: Updates service API - * AWS Systems Manager Session Manager target length increased to 400. -* `service/sso`: Adds new service - * This is an initial release of AWS Single Sign-On (SSO) end-user access. This release adds support for accessing AWS accounts assigned in AWS SSO using short term credentials. -* `service/sso-oidc`: Adds new service - -Release v1.25.29 (2019-11-06) -=== - -### Service Client Updates -* `service/savingsplans`: Updates service documentation - -Release v1.25.28 (2019-11-06) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Documentation updates for budgets to track Savings Plans utilization and coverage -* `service/ce`: Updates service API, documentation, and paginators -* `service/codebuild`: Updates service API and documentation - * Add support for Build Number, Secrets Manager and Exported Environment Variables. -* `service/elasticfilesystem`: Updates service API - * EFS customers can select a lifecycle policy that automatically moves files that have not been accessed for 7 days into the EFS Infrequent Access (EFS IA) storage class. EFS IA provides price/performance that is cost-optimized for files that are not accessed every day. -* `service/savingsplans`: Adds new service -* `service/signer`: Updates service API and documentation - * This release adds support for tagging code-signing profiles in AWS Signer. - -Release v1.25.27 (2019-11-05) -=== - -### Service Client Updates -* `service/codestar-notifications`: Adds new service -* `service/rds`: Updates service documentation - * Documentation updates for Amazon RDS - -Release v1.25.26 (2019-11-04) -=== - -### Service Client Updates -* `service/dax`: Updates service documentation - * Documentation updates for dax -* `service/ec2`: Updates service API and documentation - * Documentation updates for ec2 -* `service/robomaker`: Updates service API and documentation - -Release v1.25.25 (2019-11-01) -=== - -### Service Client Updates -* `service/cloudtrail`: Updates service API, documentation, and paginators - * This release adds two new APIs, GetTrail and ListTrails, and support for adding tags when you create a trail by using a new TagsList parameter on CreateTrail operations. -* `service/dms`: Updates service API and documentation - * This release contains task timeline attributes in replication task statistics. This release also adds a note to the documentation for the CdcStartPosition task request parameter. This note describes how to enable the use of native CDC start points for a PostgreSQL source by setting the new slotName extra connection attribute on the source endpoint to the name of an existing logical replication slot. -* `service/pinpoint`: Updates service API and documentation - * This release of the Amazon Pinpoint API introduces support for using and managing journeys, and querying analytics data for journeys. - -Release v1.25.24 (2019-10-31) -=== - -### Service Client Updates -* `service/amplify`: Updates service API and documentation -* `service/s3`: Updates service API and examples - * S3 Inventory now supports a new field 'IntelligentTieringAccessTier' that reports the access tier (frequent or infrequent) of objects stored in Intelligent-Tiering storage class. -* `service/support`: Updates service API, documentation, and paginators - * The status descriptions for TrustedAdvisorCheckRefreshStatus have been updated - -Release v1.25.23 (2019-10-30) -=== - -### Service Client Updates -* `service/elasticache`: Updates service API and documentation - * Amazon ElastiCache for Redis 5.0.5 now allows you to modify authentication tokens by setting and rotating new tokens. You can now modify active tokens while in use, or add brand-new tokens to existing encryption-in-transit enabled clusters that were previously setup without authentication tokens. This is a two-step process that allows you to set and rotate the token without interrupting client requests. - -Release v1.25.22 (2019-10-29) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Adds support for providing domain names that can embed streaming sessions -* `service/cloud9`: Updates service API, documentation, and examples - * Added CREATING and CREATE_FAILED environment lifecycle statuses. - -Release v1.25.21 (2019-10-28) -=== - -### Service Client Updates -* `service/s3`: Updates service API, documentation, and examples - * Adding support in SelectObjectContent for scanning a portion of an object specified by a scan range. - -Release v1.25.20 (2019-10-28) -=== - -### Service Client Updates -* `service/ecr`: Updates service API, documentation, and paginators - * This release of Amazon Elastic Container Registry Service (Amazon ECR) introduces support for image scanning. This identifies the software vulnerabilities in the container image based on the Common Vulnerabilities and Exposures (CVE) database. -* `service/elasticache`: Updates service API and documentation - * Amazon ElastiCache adds support for migrating Redis workloads hosted on Amazon EC2 into ElastiCache by syncing the data between the source Redis cluster and target ElastiCache for Redis cluster in real time. For more information, see https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/migrate-to-elasticache.html. -* `service/transfer`: Updates service API and documentation - * This release adds logical directories support to your AWS SFTP server endpoint, so you can now create logical directory structures mapped to Amazon Simple Storage Service (Amazon S3) bucket paths for users created and stored within the service. Amazon S3 bucket names and paths can now be hidden from AWS SFTP users, providing an additional level of privacy to meet security requirements. You can lock down your SFTP users' access to designated folders (commonly referred to as 'chroot'), and simplify complex folder structures for data distribution through SFTP without replicating files across multiple users. - -### SDK Enhancements -* `aws/client`: Add PartitionID to Config ([#2902](https://github.com/aws/aws-sdk-go/pull/2902)) -* `aws/client/metadata`: Add PartitionID to ClientInfo ([#2902](https://github.com/aws/aws-sdk-go/pull/2902)) -* `aws/endpoints`: Add PartitionID to ResolvedEndpoint ([#2902](https://github.com/aws/aws-sdk-go/pull/2902)) - -### SDK Bugs -* `aws/endpoints`: Fix resolve endpoint with empty region ([#2911](https://github.com/aws/aws-sdk-go/pull/2911)) - * Fixes the SDK's behavior when attempting to resolve a service's endpoint when no region was provided. Adds legacy support for services that were able to resolve a valid endpoint. No new service will support resolving an endpoint without an region. - * Fixes [#2909](https://github.com/aws/aws-sdk-go/issues/2909) - -Release v1.25.19 (2019-10-24) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `service/chime`: Updates service API, documentation, and paginators - * * This release introduces Voice Connector PDX region and defaults previously created Voice Connectors to IAD. You can create Voice Connector Groups and add region specific Voice Connectors to direct telephony traffic across AWS regions in case of regional failures. With this release you can add phone numbers to Voice Connector Groups and can bulk move phone numbers between Voice Connectors, between Voice Connector and Voice Connector Groups and between Voice Connector Groups. Voice Connector now supports additional settings to enable SIP Log capture. This is in addition to the launch of Voice Connector Cloud Watch metrics in this release. This release also supports assigning outbound calling name (CNAM) to AWS account and individual phone numbers assigned to Voice Connectors. * Voice Connector now supports a setting to enable real time audio streaming delivered via Kinesis Audio streams. Please note that recording Amazon Chime Voice Connector calls with this feature maybe be subject to laws or regulations regarding the recording of telephone calls and other electronic communications. AWS Customer and their end users' have the responsibility to comply with all applicable laws regarding the recording, including properly notifying all participants in a recorded session or to a recorded communication that the session or communication is being recorded and obtain their consent. -* `service/ec2`: Updates service API and documentation - * This release updates CreateFpgaImage to support tagging FPGA images on creation -* `service/gamelift`: Updates service API - * Amazon GameLift offers expanded hardware options for game hosting: Custom game builds can use the Amazon Linux 2 operating system, and fleets for both custom builds and Realtime servers can now use C5, M5, and R5 instance types. -* `service/sagemaker`: Updates service API - * Adds support for the new family of Elastic Inference Accelerators (eia2) for SageMaker Hosting and Notebook Services - -Release v1.25.18 (2019-10-23) -=== - -### Service Client Updates -* `service/connect`: Updates service API, documentation, and paginators -* `service/polly`: Updates service API - * Amazon Polly adds new female voices: US Spanish - Lupe and Brazilian Portuguese - Camila; both voices are available in Standard and Neural engine. -* `service/sts`: Updates service documentation - * AWS Security Token Service (STS) now supports a regional configuration flag to make the client respect the region without the need for the endpoint parameter. - -### SDK Enhancements -* `aws/endpoints`: Adds support for STS Regional Flags ([#2779](https://github.com/aws/aws-sdk-go/pull/2779)) - * Implements STS regional flag, with support for `legacy` and `regional` options. Defaults to `legacy`. Legacy, will force all regions specified in aws/endpoints/sts_legacy_regions.go to resolve to the STS global endpoint, sts.amazonaws.com. This is the SDK's current behavior. - * When the flag's value is `regional` the SDK will resolve the endpoint based on the endpoints.json model. This allows STS to update their service's modeled endpoints to be regionalized for all regions. When `regional` turned on use `aws-global` as the region to use the global endpoint. - * `AWS_STS_REGIONAL_ENDPOINTS=regional` for environment, or `sts_regional_endpoints=regional` in shared config file. - * The regions the SDK defaults to the STS global endpoint in `legacy` mode are: - * ap-northeast-1 - * ap-south-1 - * ap-southeast-1 - * ap-southeast-2 - * aws-global - * ca-central-1 - * eu-central-1 - * eu-north-1 - * eu-west-1 - * eu-west-2 - * eu-west-3 - * sa-east-1 - * us-east-1 - * us-east-2 - * us-west-1 - * us-west-2 - -Release v1.25.17 (2019-10-22) -=== - -### Service Client Updates -* `service/iotevents`: Updates service API and documentation -* `service/opsworkscm`: Updates service API and documentation - * AWS OpsWorks for Chef Automate (OWCA) now allows customers to use a custom domain and respective certificate, for their AWS OpsWorks For Chef Automate servers. Customers can now provide a CustomDomain, CustomCertificate and CustomPrivateKey in CreateServer API to configure their Chef Automate servers with a custom domain and certificate. - -### SDK Bugs -* `service/s3`,`service/kinesis`: Fix streaming APIs' Err method closing stream ([#2882](https://github.com/aws/aws-sdk-go/pull/2882)) - * Fixes calling the Err method on SDK's Amazon Kinesis's SubscribeToShared and Amazon S3's SelectObjectContent response EventStream members closing the stream. This would cause unexpected read errors, or early termination of the streams. Only the Close method of the streaming members will close the streams. - * Related to [#2769](https://github.com/aws/aws-sdk-go/issues/2769) - -Release v1.25.16 (2019-10-18) -=== - -### Service Client Updates -* `service/monitoring`: Updates service API and documentation - * New Period parameter added to MetricDataQuery structure. - -Release v1.25.15 (2019-10-17) -=== - -### Service Client Updates -* `service/batch`: Updates service API and documentation - * Adding support for Compute Environment Allocation Strategies -* `service/rds`: Updates service API, documentation, and paginators - * Amazon RDS now supports Amazon RDS on VMware with the introduction of APIs related to Custom Availability Zones and Media installation. - -Release v1.25.14 (2019-10-16) -=== - -### Service Client Updates -* `service/kafka`: Updates service API and documentation -* `service/marketplacecommerceanalytics`: Updates service API and documentation - * add 2 more values for the supporting sections - age of past due funds + uncollected funds breakdown -* `service/robomaker`: Updates service API - -Release v1.25.13 (2019-10-15) -=== - -### Service Client Updates -* `service/kinesis-video-archived-media`: Updates service API and documentation - -Release v1.25.12 (2019-10-14) -=== - -### Service Client Updates -* `service/personalize`: Updates service API and documentation -* `service/workspaces`: Updates service documentation - * Documentation updates for WorkSpaces - -Release v1.25.11 (2019-10-11) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/greengrass`: Updates service API - * Greengrass OTA service supports Raspbian/Armv6l platforms. - -Release v1.25.10 (2019-10-10) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * New EC2 M5n, M5dn, R5n, R5dn instances with 100 Gbps network performance and Elastic Fabric Adapter (EFA) for ultra low latency; New A1.metal bare metal instance powered by AWS Graviton Processors -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/fms`: Updates service API and documentation -* `service/iotanalytics`: Updates service API and documentation -* `service/runtime.lex`: Updates service API and documentation - -Release v1.25.9 (2019-10-09) -=== - -### Service Client Updates -* `service/elasticache`: Updates service API and documentation - * Amazon ElastiCache now allows you to apply available service updates on demand to your Memcached and Redis Cache Clusters. Features included: (1) Access to the list of applicable service updates and their priorities. (2) Service update monitoring and regular status updates. (3) Recommended apply-by-dates for scheduling the service updates. (4) Ability to stop and later re-apply updates. For more information, see https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/Self-Service-Updates.html and https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Self-Service-Updates.html -* `service/kafka`: Updates service documentation -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added support for Dolby Atmos encoding, up to 36 outputs, accelerated transcoding with frame capture and preferred acceleration feature. - -Release v1.25.8 (2019-10-08) -=== - -### Service Client Updates -* `service/datasync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/eventbridge`: Updates service documentation -* `service/firehose`: Updates service API and documentation - * With this release, you can use Amazon Kinesis Firehose delivery streams to deliver streaming data to Amazon Elasticsearch Service version 7.x clusters. For technical documentation, look for CreateDeliveryStream operation in Amazon Kinesis Firehose API reference. -* `service/organizations`: Updates service documentation - * Documentation updates for organizations - -Release v1.25.7 (2019-10-07) -=== - -### Service Client Updates -* `service/directconnect`: Updates service API and documentation - * This release adds a service provider field for physical connection creation and provides a list of available partner providers for each Direct Connect location. -* `service/firehose`: Updates service API and documentation - * Amazon Kinesis Data Firehose now allows delivering data to Elasticsearch clusters set up in a different AWS account than the Firehose AWS account. For technical documentation, look for ElasticsearchDestinationConfiguration in the Amazon Kinesis Firehose API reference. -* `service/glue`: Updates service API and documentation - * AWS Glue now provides ability to use custom certificates for JDBC Connections. -* `service/pinpoint`: Updates service API and documentation - * This release of the Amazon Pinpoint API introduces support for using and managing message templates. -* `service/pinpoint-email`: Updates service API and documentation -* `service/snowball`: Updates service API and documentation - * AWS Snowball Edge now allows you to perform an offline update to the software of your Snowball Edge device when your device is not connected to the internet. Previously, updating your Snowball Edge's software required that the device be connected to the internet or be sent back to AWS. Now, you can keep your Snowball Edge software up to date even if your device(s) cannot connect to the internet, or are required to run in an air-gapped environment. To complete offline updates, download the software update from a client machine with connection to the internet using the AWS Command Line Interface (CLI). Then, have the Snowball Edge device download and install the software update using the Snowball Edge device API. For more information about offline updates, visit the Snowball Edge documentation page. - -Release v1.25.6 (2019-10-04) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API, documentation, and paginators -* `service/mediapackage`: Updates service API, documentation, and paginators - * New Harvest Job APIs to export segment-accurate content windows from MediaPackage Origin Endpoints to S3. See https://docs.aws.amazon.com/mediapackage/latest/ug/harvest-jobs.html for more info -* `service/ssm`: Updates service documentation - * Documentation updates for Systems Manager / StartSession. - -Release v1.25.5 (2019-10-03) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service documentation and examples -* `service/devicefarm`: Updates service documentation and examples - * Documentation updates for devicefarm -* `service/ec2`: Updates service API and documentation - * This release allows customers to purchase regional EC2 RIs on a future date. -* `service/es`: Updates service API and documentation - * Amazon Elasticsearch Service now supports configuring additional options for domain endpoint, such as whether to require HTTPS for all traffic. - -### SDK Bugs -* `service/dynamodb/dynamodbattribute`: Fixes a panic when decoding into a map with a key string type alias. ([#2870](https://github.com/aws/aws-sdk-go/pull/2870)) - -Release v1.25.4 (2019-10-02) -=== - -### Service Client Updates -* `service/lightsail`: Updates service API and documentation - * This release adds support for the automatic snapshots add-on for instances and block storage disks. - -### SDK Enhancements -* `service/s3/s3manager`: Allow reuse of Uploader buffer `sync.Pool` amongst multiple Upload calls ([#2863](https://github.com/aws/aws-sdk-go/pull/2863)) - * The `sync.Pool` used for the reuse of `[]byte` slices when handling streaming payloads will now be shared across multiple Upload calls when the upload part size remains constant. - -### SDK Bugs -* `internal/ini`: Fix ini parser to handle empty values [#2860](https://github.com/aws/aws-sdk-go/pull/2860) - * Fixes incorrect modifications to the previous token value of the skipper. Adds checks for cases where a skipped statement should be marked as complete and not be ignored. - * Adds tests for nested and empty field value parsing, along with tests suggested in [#2801](https://github.com/aws/aws-sdk-go/pull/2801) - * Fixes [#2800](https://github.com/aws/aws-sdk-go/issues/2800) - -Release v1.25.3 (2019-10-01) -=== - -### Service Client Updates -* `service/docdb`: Updates service API and documentation - * This release provides support for describe and modify CA certificates. - -### SDK Bugs -* `private/model/api` : Fixes broken test for code generation example ([#2855](https://github.com/aws/aws-sdk-go/pull/2855)) - -Release v1.25.2 (2019-09-30) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mq`: Updates service API and documentation - * Amazon MQ now includes the ability to scale your brokers by changing the host instance type. See the hostInstanceType property of UpdateBrokerInput (https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers-broker-id.html#brokers-broker-id-model-updatebrokerinput), and pendingHostInstanceType property of DescribeBrokerOutput (https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers-broker-id.html#brokers-broker-id-model-describebrokeroutput). -* `service/rds`: Updates service API, documentation, and waiters - * This release adds support for creating a Read Replica with Active Directory domain information. This release updates RDS API to indicate whether an OrderableDBInstanceOption supports Kerberos Authentication. -* `service/waf`: Updates service API and documentation - * Lowering the threshold for Rate Based rule from 2000 to 100. - -Release v1.25.1 (2019-09-27) -=== - -### Service Client Updates -* `service/amplify`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) removes FirelensConfiguration from the DescribeTask output during the FireLens public preview. - -### SDK Enhancements -* `private/protocol/xml/xmlutil`: Support for sorting xml attributes ([#2854](https://github.com/aws/aws-sdk-go/pull/2854)) - -### SDK Bugs -* `private/model/api`: Write locationName for top-level shapes for rest-xml and ec2 protocols ([#2854](https://github.com/aws/aws-sdk-go/pull/2854)) -* `private/mode/api`: Colliding fields should serialize with original name ([#2854](https://github.com/aws/aws-sdk-go/pull/2854)) - * Fixes [#2806](https://github.com/aws/aws-sdk-go/issues/2806) -Release v1.25.0 (2019-09-26) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service documentation - * Documentation updates for CodePipeline -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/ssm`: Updates service API and documentation - * This release updates the AWS Systems Manager Parameter Store PutParameter and LabelParameterVersion APIs to return the "Tier" of parameter created/updated and the "parameter version" labeled respectively. - -### SDK Features -* `service/dynamodb/dynamodbattribute`: Add EnableEmptyCollections flag to Encoder and Decoder ([#2834](https://github.com/aws/aws-sdk-go/pull/2834)) - * The `Encoder` and `Decoder` types have been enhanced to allow support for specifying the SDK's behavior when marshaling structures, maps, and slices to DynamoDB. - * When `EnableEmptyCollections` is set to `True` the SDK will preserve the empty of these types in DynamoDB rather then encoding a NULL AttributeValue. - * Fixes [#682](https://github.com/aws/aws-sdk-go/issues/682) - * Fixes [#1890](https://github.com/aws/aws-sdk-go/issues/1890) - * Fixes [#2746](https://github.com/aws/aws-sdk-go/issues/2746) -* `service/s3/s3manager`: Add Download Buffer Provider ([#2823](https://github.com/aws/aws-sdk-go/pull/2823)) - * Adds a new `BufferProvider` member for specifying how part data can be buffered in memory when copying from the http response body. - * Windows platforms will now default to buffering 1MB per part to reduce contention when downloading files. - * Non-Windows platforms will continue to employ a non-buffering behavior. - * Fixes [#2180](https://github.com/aws/aws-sdk-go/issues/2180) - * Fixes [#2662](https://github.com/aws/aws-sdk-go/issues/2662) - -Release v1.24.6 (2019-09-25) -=== - -### Service Client Updates -* `service/dms`: Updates service API, documentation, and examples - * This release adds a new DeleteConnection API to delete the connection between a replication instance and an endpoint. It also adds an optional S3 setting to specify the precision of any TIMESTAMP column values written to an S3 object file in .parquet format. -* `service/globalaccelerator`: Updates service API and documentation -* `service/sagemaker`: Updates service API and documentation - * Enable G4D and R5 instances in SageMaker Hosting Services - -Release v1.24.5 (2019-09-24) -=== - -### Service Client Updates -* `service/comprehendmedical`: Updates service API and documentation -* `service/datasync`: Updates service API and documentation -* `service/transcribe`: Updates service API and documentation - -### SDK Enhancements -* `private/model/api`: Skip unsupported API models during code generation ([#2849](https://github.com/aws/aws-sdk-go/pull/2849)) - * Adds support for removing API modeled operations that use unsupported features. If a API model results in having no operations it will be skipped. - -Release v1.24.4 (2019-09-23) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds-data`: Updates service API, documentation, paginators, and examples -* `service/redshift`: Updates service API, documentation, and paginators - * Adds API operation DescribeNodeConfigurationOptions and associated data structures. - -Release v1.24.3 (2019-09-20) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * G4 instances are Amazon EC2 instances based on NVIDIA T4 GPUs and are designed to provide cost-effective machine learning inference for applications, like image classification, object detection, recommender systems, automated speech recognition, and language translation. G4 instances are also a cost-effective platform for building and running graphics-intensive applications, such as remote graphics workstations, video transcoding, photo-realistic design, and game streaming in the cloud. To get started with G4 instances visit https://aws.amazon.com/ec2/instance-types/g4. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/greengrass`: Updates service API and documentation - * Greengrass OTA service now returns the updated software version in the PlatformSoftwareVersion parameter of a CreateSoftwareUpdateJob response -* `service/rds`: Updates service API and documentation - * Add a new LeaseID output field to DescribeReservedDBInstances, which shows the unique identifier for the lease associated with the reserved DB instance. AWS Support might request the lease ID for an issue related to a reserved DB instance. -* `service/workspaces`: Updates service API and documentation - * Adds the WorkSpaces restore feature - -Release v1.24.2 (2019-09-19) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for container image manifest digests. This enables you to identify all tasks launched using a container image pulled from ECR in order to correlate what was built with where it is running. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * AWS Glue DevEndpoints now supports GlueVersion, enabling you to choose Apache Spark 2.4.3 (in addition to Apache Spark 2.2.1). In addition to supporting the latest version of Spark, you will also have the ability to choose between Python 2 and Python 3. -* `service/mediaconnect`: Updates service API and documentation - -Release v1.24.1 (2019-09-18) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Amazon API Gateway simplifies accessing PRIVATE APIs by allowing you to associate one or more Amazon Virtual Private Cloud (VPC) Endpoints to a private API. API Gateway will create and manage DNS alias records necessary for easily invoking the private APIs. With this feature, you can leverage private APIs in web applications hosted within your VPCs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/ram`: Updates service API, documentation, and paginators -* `service/waf-regional`: Updates service API and documentation - -Release v1.24.0 (2019-09-17) -=== - -### Service Client Updates -* `service/athena`: Updates service API and documentation - * This release adds DataManifestLocation field indicating the location and file name of the data manifest file. Users can get a list of files that the Athena query wrote or intended to write from the manifest file. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iam`: Updates service documentation and examples - * Documentation updates for iam -* `service/personalize`: Updates service API and documentation - -### SDK Features -* `service/s3/s3manager`: Add Upload Buffer Provider ([#2792](https://github.com/aws/aws-sdk-go/pull/2792)) - * Adds a new `BufferProvider` member for specifying how part data can be buffered in memory. - * Windows platforms will now default to buffering 1MB per part to reduce contention when uploading files. - * Non-Windows platforms will continue to employ a non-buffering behavior. - -### SDK Enhancements -* `awstesting/integration/performance/s3UploadManager`: Extended to support benchmarking and usage of new `BufferProvider` ([#2792](https://github.com/aws/aws-sdk-go/pull/2792)) - -Release v1.23.22 (2019-09-16) -=== - -### Service Client Updates -* `service/eks`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added support for multi-DRM SPEKE with CMAF outputs, MP3 ingest, and options for improved video quality. - -### SDK Enhancements -* `aws/client`: Adds configurations to the default retryer ([#2830](https://github.com/aws/aws-sdk-go/pull/2830)) - * Exposes members of the default retryer. Adds NoOpRetryer to support no retry behavior. - * Updates the underlying logic used by the default retryer to calculate jittered delay for retry. - * Fixes [#2829](https://github.com/aws/aws-sdk-go/issues/2829) - -Release v1.23.21 (2019-09-12) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Fix for FleetActivityStatus and FleetStateCode enum -* `service/elasticloadbalancingv2`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/medialive`: Updates service API and documentation - * AWS Elemental MediaLive now supports High Efficiency Video Coding (HEVC) for standard-definition (SD), high-definition (HD), and ultra-high-definition (UHD) encoding with HDR support.Encoding with HEVC offers a number of advantages. While UHD video requires an advanced codec beyond H.264 (AVC), high frame rate (HFR) or High Dynamic Range (HDR) content in HD also benefit from HEVC's advancements. In addition, benefits can be achieved with HD and SD content even if HDR and HFR are not needed. -* `service/workmailmessageflow`: Adds new service - -### SDK Enhancements -* `aws`: Add value/pointer conversion functions for all basic number types ([#2740](https://github.com/aws/aws-sdk-go/pull/2740)) - * Adds value and pointer conversion utilities for the remaining set of integer and float number types. - -Release v1.23.20 (2019-09-11) -=== - -### Service Client Updates -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * This release adds support for new data fields and log format in VPC flow logs. -* `service/email`: Updates service documentation - * Updated API documentation to correct broken links, and to update content based on customer feedback. -* `service/mediaconnect`: Updates service API and documentation -* `service/rds`: Updates service API and documentation - * This release allows customers to specify a custom parameter group when creating a Read Replica, for DB engines which support this feature. -* `service/states`: Updates service API and documentation - * Fixing letter case in Map history event details to be small case - -### SDK Enhancements -* Enabled verbose logging for continuous integration tests ([#2815](https://github.com/aws/aws-sdk-go/pull/2815)) - -Release v1.23.19 (2019-09-10) -=== - -### Service Client Updates -* `service/storagegateway`: Updates service API and documentation - * The CloudWatchLogGroupARN parameter of the UpdateGatewayInformation API allows for configuring the gateway to use a CloudWatch log-group where Storage Gateway health events will be logged. - -Release v1.23.18 (2019-09-09) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `service/appstream`: Updates service API and documentation - * IamRoleArn support in CreateFleet, UpdateFleet, CreateImageBuilder APIs -* `service/ec2`: Updates service API and documentation - * This release expands Site-to-Site VPN tunnel options to allow customers to restrict security algorithms and configure timer settings for VPN connections. Customers can specify these new options while creating new VPN connections, or they can modify the tunnel options on existing connections using a new API. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/marketplacecommerceanalytics`: Updates service API and documentation - * Add FDP+FPS (monthly_revenue_field_demonstration_usage + monthly_revenue_flexible_payment_schedule) to Marketplace Commerce Analytics Service -* `service/qldb`: Adds new service -* `service/qldb-session`: Adds new service -* `service/robomaker`: Updates service API and documentation - -### SDK Bugs -* Fixed failing tests when executed as a module dependency ([#2817](https://github.com/aws/aws-sdk-go/pull/2817)) -Release v1.23.17 (2019-09-06) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kinesisanalytics`: Updates service documentation - * Documentation updates for kinesisanalytics - -### SDK Bugs -* `awstesting`: Fixes AssertXML to correctly assert on differences ([#2804](https://github.com/aws/aws-sdk-go/pull/2804)) -Release v1.23.16 (2019-09-05) -=== - -### Service Client Updates -* `service/config`: Updates service API, documentation, and paginators -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.23.15 (2019-09-04) -=== - -### Service Client Updates -* `service/eks`: Updates service API, documentation, and paginators -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/states`: Updates service API and documentation - * Added support for new history events -* `service/transcribe`: Updates service API and documentation - -Release v1.23.14 (2019-09-03) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for attaching Amazon Elastic Inference accelerators to your containers. This enables you to run deep learning inference workloads with hardware acceleration in a more efficient way. -* `service/gamelift`: Updates service API and documentation - * You can now make use of PKI resources to provide more secure connections between your game clients and servers. To learn more, please refer to the public Amazon GameLift documentation. -* `service/resourcegroupstaggingapi`: Updates service documentation - * Documentation updates for resourcegroupstaggingapi - -Release v1.23.13 (2019-08-30) -=== - -### Service Client Updates -* `service/apigatewaymanagementapi`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for modifying the cluster settings for existing clusters, which enables you to toggle whether Container Insights is enabled or not. Support is also introduced for custom log routing using the ECS FireLens integration. -* `service/mq`: Updates service API and documentation - * Adds support for updating security groups selection of an Amazon MQ broker. - -### SDK Bugs -* `aws/csm`: Fix metricChan's unsafe atomic operations ([#2785](https://github.com/aws/aws-sdk-go/pull/2785)) - * Fixes [#2784](https://github.com/aws/aws-sdk-go/issues/2784) test failure caused by the metricChan.paused member being a value instead of a pointer. If the metricChan value was ever copied the atomic operations performed on paused would be invalid. -* `aws/client`: Updates logic for request retry delay calculation ([#2796](https://github.com/aws/aws-sdk-go/pull/2796)) - * Updates logic for calculating the delay after which a request can be retried. Retry delay now includes the Retry-After duration specified in a request. Fixes broken test for retry delays for throttled exceptions. - * Fixes [#2795](https://github.com/aws/aws-sdk-go/issues/2795) -Release v1.23.12 (2019-08-29) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API, documentation, and paginators -* `service/codepipeline`: Updates service API and documentation - * Introducing pipeline execution trigger details in ListPipelineExecutions API. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for including Docker container IDs in the API response when describing and stopping tasks. This enables customers to easily map containers to the tasks they are associated with. -* `service/elasticache`: Updates service API and documentation - * Amazon ElastiCache for Redis now supports encryption at rest using customer managed customer master keys (CMKs) in AWS Key Management Service (KMS). Amazon ElastiCache now supports cluster names upto 40 characters for replicationGoups and upto 50 characters for cacheClusters. -* `service/lambda`: Updates service API, documentation, and paginators - * Adds a "MaximumBatchingWindowInSeconds" parameter to event source mapping api's. Usable by Dynamodb and Kinesis event sources. - -### SDK Enhancements -* `aws/ec2metadata`: Add marketplaceProductCodes to EC2 Instance Identity Document - * Adds `MarketplaceProductCodes` to the EC2 Instance Metadata's Identity Document. The ec2metadata client will now retrieve these values if they are available. - * Fixes [#2781](https://github.com/aws/aws-sdk-go/issues/2781) -* `private/protocol`: Add support for parsing fractional time ([#2760](https://github.com/aws/aws-sdk-go/pull/2760)) - * Fixes the SDK's ability to parse fractional unix timestamp values and added tests. - * Fixes [#1448](https://github.com/aws/aws-sdk-go/pull/1448) - -Release v1.23.11 (2019-08-28) -=== - -### Service Client Updates -* `service/globalaccelerator`: Updates service API and documentation -* `service/mediaconvert`: Updates service API and documentation - * This release adds the ability to send a job to an on-demand queue while simulating the performance of a job sent to a reserved queue. Use this setting to estimate the number of reserved transcoding slots (RTS) you need for a reserved queue. -* `service/sqs`: Updates service API and documentation - * Added support for message system attributes, which currently lets you send AWS X-Ray trace IDs through Amazon SQS. - -Release v1.23.10 (2019-08-27) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/organizations`: Updates service documentation - * Documentation updates for organizations - -### SDK Bugs -* `service/ec2`: Fix int overflow in minTime on 386 and arm ([#2787](https://github.com/aws/aws-sdk-go/pull/2787)) - * Fixes [2786](https://github.com/aws/aws-sdk-go/issues/2786) int overflow issue on 32-bit platforms like 386 and arm. -Release v1.23.9 (2019-08-26) -=== - -### Service Client Updates -* `service/securityhub`: Updates service API -* `service/ssm`: Updates service API and documentation - * This feature adds "default tier" to the AWS Systems Manager Parameter Store for parameter creation and update. AWS customers can now set the "default tier" to one of the following values: Standard (default), Advanced or Intelligent-Tiering. This allows customers to create advanced parameters or parameters in corresponding tiers with one setting rather than code change to specify parameter tiers. - -Release v1.23.8 (2019-08-23) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release of EC2 VM Import Export adds support for exporting Amazon Machine Image(AMI)s to a VM file -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediapackage-vod`: Updates service API and documentation -* `service/transcribe`: Updates service API and documentation - -### SDK Enhancements -* `aws/session`: Add support for CSM options from shared config file ([#2768](https://github.com/aws/aws-sdk-go/pull/2768)) - * Adds support for enabling and controlling the Client Side Metrics (CSM) reporting from the shared configuration files in addition to the environment variables. - -### SDK Bugs -* `service/s3/s3crypto`: Fix tmp file not being deleted after upload ([#2776](https://github.com/aws/aws-sdk-go/pull/2776)) - * Fixes the s3crypto's getWriterStore utiliy's send handler not cleaning up the temporary file after Send completes. -* `private/protocol`: Add protocol tests for blob types and headers ([#2770](https://github.com/aws/aws-sdk-go/pull/2770)) - * Adds RESTJSON and RESTXML protocol tests for blob headers. - * Related to [#750](https://github.com/aws/aws-sdk-go/issues/750) -* `service/dynamodb/expression`: Improved reporting of bad key conditions ([#2775](https://github.com/aws/aws-sdk-go/pull/2775)) - * Improved error reporting when invalid key conditions are constructed using KeyConditionBuilder -Release v1.23.7 (2019-08-22) -=== - -### Service Client Updates -* `service/datasync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * This release allows users to enable RDS Data API while creating Aurora Serverless databases. - -### SDK Bugs -* `aws/request`: Fix IsErrorRetryable returning true for nil error ([#2774](https://github.com/aws/aws-sdk-go/pull/2774)) - * Fixes [#2773](https://github.com/aws/aws-sdk-go/pull/2773) where the IsErrorRetryable helper was incorrectly returning true for nil errors passed in. IsErrorRetryable will now correctly return false when the passed in error is nil like documented. - -Release v1.23.6 (2019-08-21) -=== - -### Service Client Updates -* `service/elasticache`: Updates service API and documentation - * ElastiCache extends support for Scale down for Redis Cluster-mode enabled and disabled replication groups -* `service/forecast`: Adds new service -* `service/forecastquery`: Adds new service -* `service/personalize-runtime`: Updates service API -* `service/rekognition`: Updates service documentation - * Documentation updates for Amazon Rekognition. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker now supports Amazon EFS and Amazon FSx for Lustre file systems as data sources for training machine learning models. Amazon SageMaker now supports running training jobs on ml.p3dn.24xlarge instance type. This instance type is offered as a limited private preview for certain SageMaker customers. If you are interested in joining the private preview, please reach out to the SageMaker Product Management team via AWS Support." -* `service/sqs`: Updates service API and documentation - * This release provides a way to add metadata tags to a queue when it is created. You can use tags to organize and identify your Amazon SQS queues for cost allocation. - -### SDK Enhancements -* `aws/session`: Ignore invalid shared config file when not used ([#2731](https://github.com/aws/aws-sdk-go/pull/2731)) - * Updates the Session to not fail to load when credentials are provided via the environment variable, the AWS_PROFILE/Option.Profile have not been specified, and the shared config has not been enabled. - * Fixes [#2455](https://github.com/aws/aws-sdk-go/issues/2455) - -Release v1.23.5 (2019-08-20) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/appstream`: Updates service API and documentation - * Includes API updates to support streaming through VPC endpoints for image builders and stacks. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker introduces Managed Spot Training. Increases the maximum number of metric definitions to 40 for SageMaker Training and Hyperparameter Tuning Jobs. SageMaker Neo adds support for Acer aiSage and Qualcomm QCS605 and QCS603. -* `service/transfer`: Updates service API and documentation - * New field in response of TestIdentityProvider - -Release v1.23.4 (2019-08-19) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `service/cur`: Updates service API and documentation - * New IAM permission required for editing AWS Cost and Usage Reports - Starting today, you can allow or deny IAM users permission to edit Cost & Usage Reports through the API and the Billing and Cost Management console. To allow users to edit Cost & Usage Reports, ensure that they have 'cur: ModifyReportDefinition' permission. Refer to the technical documentation (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_cur_ModifyReportDefinition.html) for additional details. - -Release v1.23.3 (2019-08-16) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for controlling the usage of swap space on a per-container basis for Linux containers. -* `service/elasticmapreduce`: Updates service API and documentation - * Amazon EMR has introduced an account level configuration called Block Public Access that allows you to block clusters with ports open to traffic from public IP sources (i.e. 0.0.0.0/0 for IPv4 and ::/0 for IPv6) from launching. Individual ports or port ranges can be added as exceptions to allow public access. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/robomaker`: Updates service API and documentation - -Release v1.23.2 (2019-08-15) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `service/athena`: Updates service API and documentation - * This release adds support for querying S3 Requester Pays buckets. Users can enable this feature through their Workgroup settings. -* `service/codecommit`: Updates service API and documentation - * This release adds an API, BatchGetCommits, that allows retrieval of metadata for multiple commits in an AWS CodeCommit repository. -* `service/ec2`: Updates service API and documentation - * This release adds an option to use private certificates from AWS Certificate Manager (ACM) to authenticate a Site-to-Site VPN connection's tunnel endpoints and customer gateway device. -* `service/glue`: Updates service API, documentation, and paginators - * GetJobBookmarks API is withdrawn. -* `service/storagegateway`: Updates service API and documentation - * CreateSnapshotFromVolumeRecoveryPoint API supports new parameter: Tags (to be attached to the created resource) - -### SDK Enhancements -* `service/kinesis`: Add support for retrying service specific API errors ([#2751](https://github.com/aws/aws-sdk-go/pull/2751) - * Adds support for retrying the Kinesis API error, LimitExceededException. - * Fixes [#1376](https://github.com/aws/aws-sdk-go/issues/1376) -* `aws/credentials/stscreds`: Add STS and Assume Role specific retries ([#2752](https://github.com/aws/aws-sdk-go/pull/2752)) - * Adds retries to specific STS API errors to the STS AssumeRoleWithWebIdentity credential provider, and STS API operations in general. - -Release v1.23.1 (2019-08-14) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds a new API called SendDiagnosticInterrupt, which allows you to send diagnostic interrupts to your EC2 instance. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.23.0 (2019-08-13) -=== - -### Service Client Updates -* `service/appsync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -### SDK Features -* SDK code generation will no longer remove stutter from operations and type names in service API packages. New API operations and types will not have the service's name removed from them. The SDK was previously squashing API types if removing stutter from a type resulted in a name of a type that already existed. The existing type would be deleted. Only the renamed type remained. This has been fixed, and previously deleted types are now available. - * `AWS Glue`'s `GlueTable` with `Table`. The API's previously deleted `Table` is available as `TableData`. - * `AWS IoT Events`'s `IotEventsAction` with `Action`. The previously deleted `Action` is available as `ActionData`. - -### SDK Bugs -* `private/model/api`: Fix broken shape stutter rename during generation ([#2747](https://github.com/aws/aws-sdk-go/pull/2747)) - * Fixes the SDK's code generation incorrectly renaming types and operations. The code generation would incorrectly rename an API type by removing the service's name from the type's name. This was done without checking for if a type with the new name already existed. Causing the SDK to replace the existing type with the renamed one. - * Fixes [#2741](https://github.com/aws/aws-sdk-go/issues/2741) -* `private/model/api`: Fix API doc being generated with wrong value ([#2748](https://github.com/aws/aws-sdk-go/pull/2748)) - * Fixes the SDK's generated API documentation for structure member being generated with the wrong documentation value when the member was included multiple times in the model doc-2.json file, but under different types. -Release v1.22.4 (2019-08-12) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service documentation -* `service/autoscaling`: Updates service documentation - * Amazon EC2 Auto Scaling now supports a new Spot allocation strategy "capacity-optimized" that fulfills your request using Spot Instance pools that are optimally chosen based on the available Spot capacity. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/monitoring`: Updates service documentation - * Documentation updates for monitoring -* `service/rekognition`: Updates service API - * Adding new Emotion, Fear - -Release v1.22.3 (2019-08-09) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/guardduty`: Updates service API and documentation - * New "evidence" field in the finding model to provide evidence information explaining why the finding has been triggered. Currently only threat-intelligence findings have this field. Some documentation updates. -* `service/iot`: Updates service API and documentation - * This release adds Quality of Service (QoS) support for AWS IoT rules engine republish action. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert has added support for multi-DRM SPEKE with CMAF outputs, MP3 ingest, and options for improved video quality. -* `service/redshift`: Updates service API and documentation - * Add expectedNextSnapshotScheduleTime and expectedNextSnapshotScheduleTimeStatus to redshift cluster object. -* `service/runtime.lex`: Updates service API and documentation - -Release v1.22.2 (2019-08-08) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * CodeBuild adds CloudFormation support for SourceCredential -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API, documentation, and paginators - * You can now use AWS Glue to find matching records across dataset even without identifiers to join on by using the new FindMatches ML Transform. Find related products, places, suppliers, customers, and more by teaching a custom machine learning transformation that you can use to identify matching matching records as part of your analysis, data cleaning, or master data management project by adding the FindMatches transformation to your Glue ETL Jobs. If your problem is more along the lines of deduplication, you can use the FindMatches in much the same way to identify customers who have signed up more than ones, products that have accidentally been added to your product catalog more than once, and so forth. Using the FindMatches MLTransform, you can teach a Transform your definition of a duplicate through examples, and it will use machine learning to identify other potential duplicates in your dataset. As with data integration, you can then use your new Transform in your deduplication projects by adding the FindMatches transformation to your Glue ETL Jobs. This release also contains additional APIs that support AWS Lake Formation. -* `service/lakeformation`: Adds new service -* `service/opsworkscm`: Updates service API - * This release adds support for Chef Automate 2 specific engine attributes. - -Release v1.22.1 (2019-08-07) -=== - -### Service Client Updates -* `service/application-insights`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.22.0 (2019-08-06) -=== - -### Service Client Updates -* `service/batch`: Updates service documentation - * Documentation updates for AWS Batch - -### SDK Features -* `aws/session`: Corrected order of SDK environment and shared config loading. - * Environment credentials have precedence over shared config credentials even if the AWS_PROFILE environment credentials are present. The session.Options.Profile value needs to be used to specify a profile for shared config to have precedence over environment credentials. #2694 incorrectly gave AWS_PROFILE for shared config precedence over environment credentials as well. - -### SDK Bugs -* `aws/session`: Fix credential loading order for env and shared config ([#2729](https://github.com/aws/aws-sdk-go/pull/2729)) - * Fixes the credential loading order for environment credentials, when the presence of an AWS_PROFILE value is also provided. The environment credentials have precedence over the AWS_PROFILE. - * Fixes [#2727](https://github.com/aws/aws-sdk-go/issues/2727) -Release v1.21.10 (2019-08-05) -=== - -### Service Client Updates -* `service/datasync`: Updates service API and documentation -* `service/ec2`: Updates service API - * Amazon EC2 now supports a new Spot allocation strategy "Capacity-optimized" that fulfills your request using Spot Instance pools that are optimally chosen based on the available Spot capacity. -* `service/iot`: Updates service API and documentation - * In this release, AWS IoT Device Defender introduces audit mitigation actions that can be applied to audit findings to help mitigate security issues. - -Release v1.21.9 (2019-08-02) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/sts`: Updates service documentation - * Documentation updates for sts - -### SDK Enhancements -* `aws/endpoints`: Expose DNSSuffix for partitions ([#2711](https://github.com/aws/aws-sdk-go/pull/2711)) - * Exposes the underlying partition metadata's DNSSuffix value via the `DNSSuffix` method on the endpoint's `Partition` type. This allows access to the partition's DNS suffix, e.g. "amazon.com". - * Fixes [#2710](https://github.com/aws/aws-sdk-go/issues/2710) - -Release v1.21.8 (2019-07-30) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * MediaConvert adds support for specifying priority (-50 to 50) on jobs submitted to on demand or reserved queues -* `service/polly`: Updates service API and documentation - * Amazon Polly adds support for Neural text-to-speech engine. -* `service/route53`: Updates service API and documentation - * Amazon Route 53 now supports the Middle East (Bahrain) Region (me-south-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. - -Release v1.21.7 (2019-07-29) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * This release supports better exception handling for merges. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.21.6 (2019-07-26) -=== - -### Service Client Updates -* `service/batch`: Updates service API, documentation, and paginators - * AWS Batch now supports SDK auto-pagination and Job-level docker devices. -* `service/ce`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * You can now create EC2 Capacity Reservations using Availability Zone ID or Availability Zone name. You can view usage of Amazon EC2 Capacity Reservations per AWS account. -* `service/glue`: Updates service API, documentation, and paginators - * This release provides GetJobBookmark and GetJobBookmarks APIs. These APIs enable users to look at specific versions or all versions of the JobBookmark for a specific job. This release also enables resetting the job bookmark to a specific run via an enhancement of the ResetJobBookmark API. -* `service/greengrass`: Updates service API and documentation - * Greengrass OTA service supports openwrt/aarch64 and openwrt/armv7l platforms. -* `service/logs`: Updates service API and documentation - * Allow for specifying multiple log groups in an Insights query, and deprecate storedByte field for LogStreams and interleaved field for FilterLogEventsRequest. -* `service/mediaconnect`: Updates service API and documentation - -Release v1.21.5 (2019-07-25) -=== - -### Service Client Updates -* `service/ecr`: Updates service API and documentation - * This release adds support for immutable image tags. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert has added several features including support for: audio normalization using ITU BS.1770-3, 1770-4 algorithms, extension of job progress indicators, input cropping rectangle & output position rectangle filters per input, and dual SCC caption mapping to additional codecs and containers. -* `service/medialive`: Updates service API and documentation - * AWS Elemental MediaLive is adding Input Clipping, Immediate Mode Input Switching, and Dynamic Inputs. - -Release v1.21.4 (2019-07-24) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release introduces support for split tunnel with AWS Client VPN, and also adds support for opt-in Regions in DescribeRegions API. In addition, customers can now also tag Launch Templates on creation. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * This release provides GlueVersion option for Job APIs and WorkerType option for DevEndpoint APIs. Job APIs enable users to pick specific GlueVersion for a specific job and pin the job to a specific runtime environment. DevEndpoint APIs enable users to pick different WorkerType for memory intensive workload. -* `service/pinpoint`: Updates service API and documentation - * This release adds support for programmatic access to many of the same campaign metrics that are displayed on the Amazon Pinpoint console. You can now use the Amazon Pinpoint API to monitor and assess performance data for campaigns, and integrate metrics data with other reporting tools. We update the metrics data continuously, resulting in a data latency timeframe that is limited to approximately two hours. -* `service/sts`: Updates service API and documentation - * New STS GetAccessKeyInfo API operation that returns the account identifier for the specified access key ID. - -Release v1.21.3 (2019-07-23) -=== - -### Service Client Updates -* `service/secretsmanager`: Updates service API and documentation - * This release increases the maximum allowed size of SecretString or SecretBinary from 7KB to 10KB in the CreateSecret, UpdateSecret, PutSecretValue and GetSecretValue APIs. This release also increases the maximum allowed size of ResourcePolicy from 4KB to 20KB in the GetResourcePolicy and PutResourcePolicy APIs. -* `service/ssm`: Updates service API and documentation - * You can now use Maintenance Windows to select a resource group as the target. By selecting a resource group as the target of a Maintenance Window, customers can perform routine tasks across different resources such as Amazon Elastic Compute Cloud (AmazonEC2) instances, Amazon Elastic Block Store (Amazon EBS) volumes, and Amazon Simple Storage Service(Amazon S3) buckets within the same recurring time window. - -Release v1.21.2 (2019-07-22) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mq`: Updates service API and documentation - * Adds support for AWS Key Management Service (KMS) to offer server-side encryption. You can now select your own customer managed CMK, or use an AWS managed CMK in your KMS account. -* `service/shield`: Updates service API and documentation - * Adding new VectorType (HTTP_Reflection) and related top contributor types to describe WordPress Pingback DDoS attacks. - -### SDK Enhancements -* Fixup SDK source formating, test error checking, and simplify type conervsions - * [#2703](https://github.com/aws/aws-sdk-go/pull/2703), [#2704](https://github.com/aws/aws-sdk-go/pull/2704), [#2705](https://github.com/aws/aws-sdk-go/pull/2705), [#2706](https://github.com/aws/aws-sdk-go/pull/2706), [#2707](https://github.com/aws/aws-sdk-go/pull/2707), [#2708](https://github.com/aws/aws-sdk-go/pull/2708) - -### SDK Bugs -* `aws/request`: Fix SDK error checking when seeking readers ([#2696](https://github.com/aws/aws-sdk-go/pull/2696)) - * Fixes the SDK handling of seeking a reader to ensure errors are not lost, and are bubbled up. - * In several places the SDK ignored Seek errors when attempting to determine a reader's length, or rewinding the reader for retry attempts. - * Related to [#2525](https://github.com/aws/aws-sdk-go/issues/2525) -Release v1.21.1 (2019-07-19) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iotevents`: Updates service API and documentation -* `service/sqs`: Updates service documentation - * This release updates the information about the availability of FIFO queues and includes miscellaneous fixes. - -Release v1.21.0 (2019-07-18) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service documentation - * Documentation updates for codedeploy -* `service/comprehend`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for cluster settings. Cluster settings specify whether CloudWatch Container Insights is enabled or disabled for the cluster. -* `service/elasticache`: Updates service documentation - * Updates for Elasticache - -### SDK Features -* `aws/session`: Add support for assuming role via Web Identity Token ([#2667](https://github.com/aws/aws-sdk-go/pull/2667)) - * Adds support for assuming an role via the Web Identity Token. Allows for OIDC token files to be used by specifying the token path through the AWS_WEB_IDENTITY_TOKEN_FILE, and AWS_ROLE_ARN environment variables. - -### SDK Bugs -* `aws/session`: Fix SDK AWS_PROFILE and static environment credential behavior () - * Fixes the SDK's behavior when determining the source of credentials to load. Previously the SDK would ignore the AWS_PROFILE environment, if static environment credentials were also specified. - * If both AWS_PROFILE and static environment credentials are defined, the SDK will load any credentials from the shared config/credentials file for the AWS_PROFILE first. Only if there are no credentials defined in the shared config/credentials file will the SDK use the static environment credentials instead. -Release v1.20.21 (2019-07-17) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service documentation - * Documentation updates for autoscaling -* `service/config`: Updates service API -* `service/dms`: Updates service API and documentation - * S3 endpoint settings update: 1) Option to append operation column to full-load files. 2) Option to add a commit timestamp column to full-load and cdc files. Updated DescribeAccountAttributes to include UniqueAccountIdentifier. - -Release v1.20.20 (2019-07-12) -=== - -### Service Client Updates -* `service/apigatewayv2`: Updates service API -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/es`: Updates service API - * Amazon Elasticsearch Service now supports M5, C5, and R5 instance types. -* `service/iam`: Updates service API - * Removed exception that was indicated but never thrown for IAM GetAccessKeyLastUsed API -* `service/robomaker`: Updates service API and documentation - -Release v1.20.19 (2019-07-11) -=== - -### Service Client Updates -* `service/eventbridge`: Adds new service -* `service/events`: Updates service API and documentation - * Adds APIs for partner event sources, partner event buses, and custom event buses. These new features are managed in the EventBridge service. - -### SDK Enhancements -* `aws/session`: Add Assume role for credential process from aws shared config ([#2674](https://github.com/aws/aws-sdk-go/pull/2674)) - * Adds support for assuming role using credential process from the shared config file. Also updated SDK's environment testing and added SDK's CI testing with Windows. -* `aws/csm`: Add support for AWS_CSM_HOST env option ([#2677](https://github.com/aws/aws-sdk-go/pull/2677)) - * Adds support for a host to be configured for the SDK's metric reporting Client Side Metrics (CSM) client via the AWS_CSM_HOST environment variable. - -Release v1.20.18 (2019-07-10) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glacier`: Updates service documentation - * Documentation updates for glacier -* `service/quicksight`: Updates service API and documentation - * Amazon QuickSight now supports embedding dashboards for all non-federated QuickSight users. This includes IAM users, AD users and users from the QuickSight user pool. The get-dashboard-embed-url API accepts QUICKSIGHT as identity type with a user ARN to authenticate the embeddable dashboard viewer as a non-federated user. -* `service/servicecatalog`: Updates service API and documentation - * This release adds support for Parameters in ExecuteProvisionedProductServiceAction and adds functionality to get the default parameter values for a Self-Service Action execution against a Provisioned Product via DescribeServiceActionExecutionParameters - -Release v1.20.17 (2019-07-09) -=== - -### Service Client Updates -* `service/amplify`: Updates service API and documentation -* `service/config`: Updates service API and documentation -* `service/elasticfilesystem`: Updates service API and documentation - * EFS customers can now enable Lifecycle Management for all file systems. You can also now select from one of four Lifecycle Management policies (14, 30, 60 and 90 days), to automatically move files that have not been accessed for the period of time defined by the policy, from the EFS Standard storage class to the EFS Infrequent Access (IA) storage class. EFS IA provides price/performance that is cost-optimized for files that are not accessed every day. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/gamelift`: Updates service API and documentation - * GameLift FlexMatch now supports matchmaking of up to 200 players per game session, and FlexMatch can now automatically backfill your game sessions whenever there is an open slot. -* `service/kinesis-video-archived-media`: Updates service API, documentation, and paginators -* `service/kinesisvideo`: Updates service API and paginators - * Add "GET_DASH_STREAMING_SESSION_URL" as an API name to the GetDataEndpoint API. -* `service/monitoring`: Updates service API and documentation - * This release adds three new APIs (PutAnomalyDetector, DeleteAnomalyDetector, and DescribeAnomalyDetectors) to support the new feature, CloudWatch Anomaly Detection. In addition, PutMetricAlarm and DescribeAlarms APIs are updated to support management of Anomaly Detection based alarms. -* `service/waf`: Updates service API and documentation - * Updated SDK APIs to add tags to WAF Resources: WebACL, Rule, Rulegroup and RateBasedRule. Tags can also be added during creation of these resources. -* `service/waf-regional`: Updates service API and documentation - -Release v1.20.16 (2019-07-08) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.20.15 (2019-07-03) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * AssignPrivateIpAddresses response includes two new fields: AssignedPrivateIpAddresses, NetworkInterfaceId -* `service/rds`: Updates service API and documentation - * This release supports Cross-Account Cloning for Amazon Aurora clusters. -* `service/s3`: Updates service API, documentation, and examples - * Add S3 x-amz-server-side-encryption-context support. -* `service/swf`: Updates service API and documentation - * This release adds APIs that allow adding and removing tags to a SWF domain, and viewing tags for a domain. It also enables adding tags when creating a domain. - -Release v1.20.14 (2019-07-02) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Adding ImageBuilderName in Fleet API and Documentation updates for AppStream. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediastore`: Updates service API, documentation, and paginators - * This release adds support for tagging, untagging, and listing tags for AWS Elemental MediaStore containers. - -Release v1.20.13 (2019-07-01) -=== - -### Service Client Updates -* `service/docdb`: Updates service API and documentation - * This release provides support for cluster delete protection and the ability to stop and start clusters. -* `service/ec2`: Updates service API and documentation - * This release adds support for specifying a maximum hourly price for all On-Demand and Spot instances in both Spot Fleet and EC2 Fleet. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/organizations`: Updates service API and documentation - * Specifying the tag key and tag value is required for tagging requests. -* `service/rds`: Updates service API and documentation - * This release adds support for RDS DB Cluster major version upgrade - -Release v1.20.12 (2019-06-28) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * You can now launch 8xlarge and 16xlarge instance sizes on the general purpose M5 and memory optimized R5 instance types. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service API and documentation - * ClusterAvailabilityStatus: The availability status of the cluster for queries. Possible values are the following: Available, Unavailable, Maintenance, Modifying, Failed. -* `service/workspaces`: Updates service API and documentation - * Minor API fixes for WorkSpaces. - -Release v1.20.11 (2019-06-27) -=== - -### Service Client Updates -* `service/directconnect`: Updates service API and documentation - * Tags will now be included in the API responses of all supported resources (Virtual interfaces, Connections, Interconnects and LAGs). You can also add tags while creating these resources. -* `service/ec2-instance-connect`: Adds new service -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/pinpoint`: Updates service API and documentation - * This release includes editorial updates for the Amazon Pinpoint API documentation. -* `service/workspaces`: Updates service API and documentation - * Added support for the WorkSpaces restore feature and copying WorkSpaces Images across AWS Regions. - -Release v1.20.10 (2019-06-27) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service documentation and examples - * Documentation updates for dynamodb -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.20.9 (2019-06-26) -=== - -### Service Client Updates -* `service/apigatewayv2`: Updates service API and documentation -* `service/codecommit`: Updates service API and documentation - * This release supports better exception handling for merges. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.20.8 (2019-06-25) -=== - -### Service Client Updates -* `service/ec2`: Updates service API, documentation, and paginators - * Starting today, you can use Traffic Mirroring to copy network traffic from an elastic network interface of Amazon EC2 instances and then send it to out-of-band security and monitoring appliances for content inspection, threat monitoring, and troubleshooting. These appliances can be deployed as individual instances, or as a fleet of instances behind a Network Load Balancer with a User Datagram Protocol (UDP) listener. Traffic Mirroring supports filters and packet truncation, so that you only extract the traffic of interest to monitor by using monitoring tools of your choice. -* `service/eks`: Updates service API - -Release v1.20.7 (2019-06-24) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Customers can pick different security policies (TLS version + cipher suite) for custom domains in API Gateway -* `service/apigatewayv2`: Updates service API and documentation - * Customers can get information about security policies set on custom domain resources in API Gateway -* `service/application-insights`: Adds new service -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/fsx`: Updates service API and documentation -* `service/resourcegroupstaggingapi`: Updates service API, documentation, and paginators - * Updated service APIs and documentation. -* `service/securityhub`: Updates service API, documentation, and paginators -* `service/service-quotas`: Adds new service -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager now supports deleting a specific version of a SSM Document. - -Release v1.20.6 (2019-06-21) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service documentation - * This release includes updated documentation about the default timeout value for test runs and remote access sessions. This release also includes miscellaneous bug fixes for the documentation. -* `service/iam`: Updates service API, documentation, and examples - * We are making it easier for you to manage your permission guardrails i.e. service control policies by enabling you to retrieve the last timestamp when an AWS service was accessed within an account or AWS Organizations entity. -* `service/kinesis-video-media`: Updates service documentation -* `service/mediapackage`: Updates service API and documentation - * Added two new origin endpoint fields for configuring which SCTE-35 messages are treated as advertisements. - -Release v1.20.5 (2019-06-20) -=== - -### Service Client Updates -* `service/acm-pca`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API, documentation, and paginators - * Starting today, you can now use workflows in AWS Glue to author directed acyclic graphs (DAGs) of Glue triggers, crawlers and jobs. Workflows enable orchestration of your ETL workloads by building dependencies between Glue entities (triggers, crawlers and jobs). You can visually track status of the different nodes in the workflows on the console making it easier to monitor progress and troubleshoot issues. Also, you can share parameters across entities in the workflow. -* `service/health`: Updates service API and documentation - * API improvements for the AWS Health service. -* `service/iotevents-data`: Updates service API and documentation -* `service/opsworks`: Updates service documentation - * Documentation updates for OpsWorks Stacks. -* `service/rds`: Updates service API and documentation - * This release adds support for RDS storage autoscaling - -Release v1.20.4 (2019-06-19) -=== - -### Service Client Updates -* `service/eks`: Updates service documentation - -Release v1.20.3 (2019-06-18) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * You can now launch new 12xlarge, 24xlarge, and metal instance sizes on the Amazon EC2 compute optimized C5 instance types featuring 2nd Gen Intel Xeon Scalable Processors. -* `service/resourcegroupstaggingapi`: Updates service API, documentation, and paginators - * You can use tag policies to help standardize on tags across your organization's resources. - -Release v1.20.2 (2019-06-17) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/neptune`: Updates service API and documentation - * This release adds a feature to configure Amazon Neptune to publish audit logs to Amazon CloudWatch Logs. -* `service/robomaker`: Updates service API and documentation -* `service/servicecatalog`: Updates service API - * Restrict concurrent calls by a single customer account for CreatePortfolioShare and DeletePortfolioShare when sharing/unsharing to an Organization. - -Release v1.20.1 (2019-06-14) -=== - -### Service Client Updates -* `service/appstream`: Updates service API - * Added 2 new values(WINDOWS_SERVER_2016, WINDOWS_SERVER_2019) for PlatformType enum. -* `service/cloudfront`: Adds new service - * A new datatype in the CloudFront API, AliasICPRecordal, provides the ICP recordal status for CNAMEs associated with distributions. AWS services in China customers must file for an Internet Content Provider (ICP) recordal if they want to serve content publicly on an alternate domain name, also known as a CNAME, that they have added to CloudFront. The status value is returned in the CloudFront response; you cannot configure it yourself. The status is set to APPROVED for all CNAMEs (aliases) in regions outside of China. -* `service/ec2`: Updates service API - * Correction to enumerations in EC2 client. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/personalize`: Updates service documentation - -Release v1.20.0 (2019-06-13) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `service/ec2`: Updates service API - * G4 instances are Amazon EC2 instances based on NVIDIA T4 GPUs and are designed to provide cost-effective machine learning inference for applications, like image classification, object detection, recommender systems, automated speech recognition, and language translation. G4 instances are also a cost-effective platform for building and running graphics-intensive applications, such as remote graphics workstations, video transcoding, photo-realistic design, and game streaming in the cloud. To get started with G4 instances visit https://aws.amazon.com/ec2/instance-types/g4. -* `service/elasticache`: Updates service API and documentation - * This release is to add support for reader endpoint for cluster-mode disabled Amazon ElastiCache for Redis clusters. -* `service/guardduty`: Updates service API, documentation, and paginators - * Support for tagging functionality in Create and Get operations for Detector, IP Set, Threat Intel Set, and Finding Filter resources and 3 new tagging APIs: ListTagsForResource, TagResource, and UntagResource. - -### SDK Features - -* `aws/session`: Add support for chaining assume IAM role from shared config ([#2579](https://github.com/aws/aws-sdk-go/pull/2579)) - * Adds support chaining assume role credentials from the shared config/credentials files. This change allows you to create an assume role chain of multiple levels of assumed IAM roles. The config profile the deepest in the chain must use static credentials, or `credential_source`. If the deepest profile doesn't have either of these the session will fail to load. - * Fixes the SDK's shared config credential source not assuming a role with environment and ECS credentials. EC2 credentials were already supported. - * Fix [#2528](https://github.com/aws/aws-sdk-go/issue/2528) - * Fix [#2385](https://github.com/aws/aws-sdk-go/issue/2385) - -### SDK Enhancements -* `service/s3/s3manager/s3manageriface`: Add missing methods ([#2612](https://github.com/aws/aws-sdk-go/pull/2612)) - * Adds the missing interface and methods from the `s3manager` Uploader, Downloader, and Batch Delete utilities. - -Release v1.19.49 (2019-06-12) -=== - -### Service Client Updates -* `service/servicecatalog`: Updates service API and documentation - * This release adds a new field named Guidance to update provisioning artifact, this field can be set by the administrator to provide guidance to end users about which provisioning artifacts to use. - -Release v1.19.48 (2019-06-11) -=== - -### Service Client Updates -* `service/sagemaker`: Updates service API and documentation - * The default TaskTimeLimitInSeconds of labeling job is increased to 8 hours. Batch Transform introduces a new DataProcessing field which supports input and output filtering and data joining. Training job increases the max allowed input channels from 8 to 20. - -Release v1.19.47 (2019-06-10) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * AWS CodeBuild adds support for source version on project level. -* `service/codecommit`: Updates service API, documentation, and paginators - * This release adds two merge strategies for merging pull requests: squash and three-way. It also adds functionality for resolving merge conflicts, testing merge outcomes, and for merging branches using one of the three supported merge strategies. -* `service/personalize`: Adds new service -* `service/personalize-events`: Adds new service -* `service/personalize-runtime`: Adds new service - -Release v1.19.46 (2019-06-07) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Adds DNS entries and NLB ARNs to describe-vpc-endpoint-connections API response. Adds owner ID to describe-vpc-endpoints and create-vpc-endpoint API responses. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.19.45 (2019-06-06) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service documentation - * Documentation updates for dynamodb -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for launching container instances using supported Amazon EC2 instance types that have increased elastic network interface density. Using these instance types and opting in to the awsvpcTrunking account setting provides increased elastic network interface (ENI) density on newly launched container instances which allows you to place more tasks on each container instance. -* `service/email`: Updates service API and documentation - * You can now specify whether the Amazon Simple Email Service must deliver email over a connection that is encrypted using Transport Layer Security (TLS). -* `service/guardduty`: Updates service API, documentation, paginators, and examples - * Improve FindingCriteria Condition field names, support long-typed conditions and deprecate old Condition field names. -* `service/logs`: Updates service documentation - * Documentation updates for logs -* `service/mediaconnect`: Updates service API and documentation -* `service/organizations`: Updates service API, documentation, and paginators - * You can tag and untag accounts in your organization and view tags on an account in your organization. -* `service/ssm`: Updates service API and documentation - * OpsCenter is a new Systems Manager capability that allows you to view, diagnose, and remediate, operational issues, aka OpsItems, related to various AWS resources by bringing together contextually relevant investigation information. New APIs to create, update, describe, and get OpsItems as well as OpsItems summary API. - -Release v1.19.44 (2019-06-05) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * Support specifying python version for Python shell jobs. A new parameter PythonVersion is added to the JobCommand data type. - -Release v1.19.43 (2019-06-04) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds support for Host Recovery feature which automatically restarts instances on to a new replacement host if failures are detected on Dedicated Host. -* `service/elasticache`: Updates service API, documentation, and paginators - * Amazon ElastiCache now allows you to apply available service updates on demand. Features included: (1) Access to the list of applicable service updates and their priorities. (2) Service update monitoring and regular status updates. (3) Recommended apply-by-dates for scheduling the service updates, which is critical if your cluster is in ElastiCache-supported compliance programs. (4) Ability to stop and later re-apply updates. For more information, see https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Self-Service-Updates.html -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iam`: Updates service API, documentation, and examples - * This release adds validation for policy path field. This field is now restricted to be max 512 characters. -* `service/s3`: Updates service documentation - * Documentation updates for s3 -* `service/storagegateway`: Updates service API and documentation - * AWS Storage Gateway now supports AWS PrivateLink, enabling you to administer and use gateways without needing to use public IP addresses or a NAT/Internet Gateway, while avoiding traffic from going over the internet. - -Release v1.19.42 (2019-06-03) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Amazon EC2 I3en instances are the new storage-optimized instances offering up to 60 TB NVMe SSD instance storage and up to 100 Gbps of network bandwidth. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service documentation - * Amazon RDS Data API is generally available. Removing beta notes in the documentation. - -Release v1.19.41 (2019-05-30) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * This release adds APIs that allow adding and removing tags to a repository, and viewing tags for a repository. It also enables adding tags when creating a repository. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iotanalytics`: Updates service API and documentation -* `service/iotevents`: Adds new service -* `service/iotevents-data`: Adds new service -* `service/kafka`: Updates service API, documentation, and paginators -* `service/pinpoint-email`: Updates service API and documentation -* `service/rds`: Updates service API and documentation - * This release adds support for Activity Streams for database clusters. -* `service/rds-data`: Updates service API, documentation, and examples -* `service/servicecatalog`: Updates service API and documentation - * Service Catalog ListStackInstancesForProvisionedProduct API enables customers to get details of a provisioned product with type "CFN_STACKSET". By passing the provisioned product id, the API will list account, region and status of each stack instances that are associated with this provisioned product. - -Release v1.19.40 (2019-05-29) -=== - -### Service Client Updates -* `service/dlm`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * Customers can now simultaneously take snapshots of multiple EBS volumes attached to an EC2 instance. With this new capability, snapshots guarantee crash-consistency across multiple volumes by preserving the order of IO operations. This new feature is fully integrated with Amazon Data Lifecycle Manager (DLM) allowing customers to automatically manage snapshots by creating lifecycle policies. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iotthingsgraph`: Adds new service -* `service/rds`: Updates service documentation - * Documentation updates for rds -* `service/securityhub`: Updates service API, documentation, and paginators -* `service/ssm`: Updates service documentation - * Systems Manager - Documentation updates - -### SDK Enhancements -* `service/mediastoredata`: Add support for nonseekable io.Reader ([#2622](https://github.com/aws/aws-sdk-go/pull/2622)) - * Updates the SDK's documentation to clarify how you can use the SDK's `aws.ReadSeekCloser` utility function to wrap an io.Reader to be used with an API operation that allows streaming unsigned payload in the operation's request. - * Adds example using ReadSeekCloser with AWS Elemental MediaStore Data's PutObject API operation. -* Update CI validation testing for Go module files ([#2626](https://github.com/aws/aws-sdk-go/pull/2626)) - * Suppress changes to the Go module definition files during CI code generation validation testing. - -### SDK Bugs -* `service/pinpointemail`: Fix client unable to make API requests ([#2625](https://github.com/aws/aws-sdk-go/pull/2625)) - * Fixes the API client's code generation to ignore the `targetPrefix` modeled value. This value is not valid for the REST-JSON protocol. - * Updates the SDK's code generation to ignore the `targetPrefix` for all protocols other than RPCJSON. - -Release v1.19.39 (2019-05-28) -=== - -### Service Client Updates -* `service/chime`: Updates service API and documentation - * This release adds the ability to search and order toll free phone numbers for Voice Connectors. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/groundstation`: Adds new service -* `service/pinpoint-email`: Updates service API, documentation, and paginators -* `service/rds`: Updates service API and documentation - * Add a new output field Status to DBEngineVersion which shows the status of the engine version (either available or deprecated). Add a new parameter IncludeAll to DescribeDBEngineVersions to make it possible to return both available and deprecated engine versions. These changes enable a user to create a Read Replica of an DB instance on a deprecated engine version. -* `service/robomaker`: Updates service API and documentation -* `service/storagegateway`: Updates service API and documentation - * Introduce AssignTapePool operation to allow customers to migrate tapes between pools. -* `service/sts`: Updates service documentation -* `service/transcribe`: Updates service API -* `service/waf`: Updates service documentation - * Documentation updates for waf - -Release v1.19.38 (2019-05-24) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * AWS CodeDeploy now supports tagging for the application and deployment group resources. -* `service/mediastore-data`: Updates service API, documentation, and paginators -* `service/opsworkscm`: Updates service documentation - * Documentation updates for OpsWorks for Chef Automate; attribute values updated for Chef Automate 2.0 release. - -### SDK Bugs -* `service/dynamodb/expression`: Fix Builder with KeyCondition example ([#2618](https://github.com/aws/aws-sdk-go/pull/2618)) - * Fixes the ExampleBuilder_WithKeyCondition example to include the ExpressionAttributeNames member being set. - * Related to [aws/aws-sdk-go-v2#285](https://github.com/aws/aws-sdk-go-v2/issues/285) -* `private/model/api`: Improve SDK API reference doc generation ([#2617](https://github.com/aws/aws-sdk-go/pull/2617)) - * Improves the SDK's generated documentation for API client, operation, and types. This fixes several bugs in the doc generation causing poor formatting, an difficult to read reference documentation. - * Fixes [#2572](https://github.com/aws/aws-sdk-go/pull/2572) - * Fixes [#2374](https://github.com/aws/aws-sdk-go/pull/2374) - -Release v1.19.37 (2019-05-23) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * New APIs to enable EBS encryption by default feature. Once EBS encryption by default is enabled in a region within the account, all new EBS volumes and snapshot copies are always encrypted -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/waf-regional`: Updates service documentation - -Release v1.19.36 (2019-05-22) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * This release adds support for tagging of Amazon API Gateway resources. -* `service/budgets`: Updates service API and documentation - * Added new datatype PlannedBudgetLimits to Budget model, and updated examples for AWS Budgets API for UpdateBudget, CreateBudget, DescribeBudget, and DescribeBudgets -* `service/devicefarm`: Updates service API and documentation - * This release introduces support for tagging, tag-based access control, and resource-based access control. -* `service/ec2`: Updates service API and documentation - * This release adds idempotency support for associate, create route and authorization APIs for AWS Client VPN Endpoints. -* `service/elasticfilesystem`: Updates service API and documentation - * AWS EFS documentation updated to reflect the minimum required value for ProvisionedThroughputInMibps is 1 from the previously documented 0. The service has always required a minimum value of 1, therefor service behavior is not changed. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service documentation - * Documentation updates for rds -* `service/servicecatalog`: Updates service API and documentation - * Service Catalog UpdateProvisionedProductProperties API enables customers to manage provisioned product ownership. Administrators can now update the user associated to a provisioned product to another user within the same account allowing the new user to describe, update, terminate and execute service actions in that Service Catalog resource. New owner will also be able to list and describe all past records executed for that provisioned product. -* `service/worklink`: Updates service API, documentation, and paginators - -Release v1.19.35 (2019-05-21) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/datasync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.19.34 (2019-05-20) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kafka`: Updates service API, documentation, and paginators -* `service/mediapackage-vod`: Adds new service -* `service/meteringmarketplace`: Updates service documentation - * Documentation updates for meteringmarketplace - -### SDK Enhancements -* Add raw error message bytes to SerializationError errors ([#2600](https://github.com/aws/aws-sdk-go/pull/2600)) - * Updates the SDK's API error message SerializationError handling to capture the original error message byte, and include it in the SerializationError error value. - * Fixes [#2562](https://github.com/aws/aws-sdk-go/issues/2562), [#2411](https://github.com/aws/aws-sdk-go/issues/2411), [#2315](https://github.com/aws/aws-sdk-go/issues/2315) - -### SDK Bugs -* `service/s3/s3manager`: Fix uploader to check for empty part before max parts check (#2556) - * Fixes the S3 Upload manager's behavior for uploading exactly MaxUploadParts * PartSize to S3. The uploader would previously return an error after the full content was uploaded, because the assert on max upload parts was occurring before the check if there were any more parts to upload. - * Fixes [#2557](https://github.com/aws/aws-sdk-go/issues/2557) - -Release v1.19.33 (2019-05-17) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Includes APIs for managing subscriptions to AppStream 2.0 usage reports and configuring idle disconnect timeouts on AppStream 2.0 fleets. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.19.32 (2019-05-16) -=== - -### Service Client Updates -* `service/medialive`: Updates service waiters and paginators - * Added channel state waiters to MediaLive. -* `service/s3`: Updates service API, documentation, and examples - * This release updates the Amazon S3 PUT Bucket replication API to include a new optional field named token, which allows you to add a replication configuration to an S3 bucket that has Object Lock enabled. - -Release v1.19.31 (2019-05-15) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service API, documentation, and paginators - * This feature includes new APIs to add, edit, remove and view tags for pipeline, custom action type and webhook resources. You can also add tags while creating these resources. -* `service/ec2`: Updates service API and documentation - * Adding tagging support for VPC Endpoints and VPC Endpoint Services. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediapackage`: Updates service API and documentation - * Adds optional configuration for DASH SegmentTemplateFormat to refer to segments by Number with Duration, rather than Number or Time with SegmentTimeline. -* `service/rds`: Updates service documentation - * In the RDS API and CLI documentation, corrections to the descriptions for Boolean parameters to avoid references to TRUE and FALSE. The RDS CLI does not allow TRUE and FALSE values values for Boolean parameters. -* `service/transcribe`: Updates service API - -Release v1.19.30 (2019-05-14) -=== - -### Service Client Updates -* `service/chime`: Updates service API and documentation - * Amazon Chime private bots GA release. -* `service/comprehend`: Updates service API, documentation, and paginators -* `service/ec2`: Updates service API, documentation, and paginators - * Pagination support for ec2.DescribeSubnets, ec2.DescribeDhcpOptions -* `service/storagegateway`: Updates service API and documentation - * Add Tags parameter to CreateSnapshot and UpdateSnapshotSchedule APIs, used for creating tags on create for one off snapshots and scheduled snapshots. - -Release v1.19.29 (2019-05-13) -=== - -### Service Client Updates -* `service/datasync`: Updates service API and documentation -* `service/iotanalytics`: Updates service API and documentation -* `service/lambda`: Updates service API and waiters - * AWS Lambda now supports Node.js v10 - -Release v1.19.28 (2019-05-10) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * AWS Glue now supports specifying existing catalog tables for a crawler to examine as a data source. A new parameter CatalogTargets is added to the CrawlerTargets data type. -* `service/sts`: Updates service API, documentation, and examples - * AWS Security Token Service (STS) now supports passing IAM Managed Policy ARNs as session policies when you programmatically create temporary sessions for a role or federated user. The Managed Policy ARNs can be passed via the PolicyArns parameter, which is now available in the AssumeRole, AssumeRoleWithWebIdentity, AssumeRoleWithSAML, and GetFederationToken APIs. The session policies referenced by the PolicyArn parameter will only further restrict the existing permissions of an IAM User or Role for individual sessions. - -Release v1.19.27 (2019-05-08) -=== - -### Service Client Updates -* `service/eks`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot1click-projects`: Updates service paginators -* `service/kinesisanalytics`: Updates service API and documentation - * Kinesis Data Analytics APIs now support tagging on applications. -* `service/kinesisanalyticsv2`: Updates service API and documentation -* `service/sagemaker`: Updates service API and documentation - * Workteams now supports notification configurations. Neo now supports Jetson Nano as a target device and NumberOfHumanWorkersPerDataObject is now included in the ListLabelingJobsForWorkteam response. -* `service/servicecatalog`: Updates service API and documentation - * Adds "Parameters" field in UpdateConstraint API, which will allow Admin user to update "Parameters" in created Constraints. - -Release v1.19.26 (2019-05-07) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/appsync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/ssm`: Updates service API and documentation - * Patch Manager adds support for Microsoft Application Patching. -* `service/storagegateway`: Updates service API and documentation - * Add optional field AdminUserList to CreateSMBFileShare and UpdateSMBFileShare APIs. - -Release v1.19.25 (2019-05-06) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service documentation - * Documentation updates for codepipeline -* `service/config`: Updates service API and documentation -* `service/iam`: Updates service documentation - * Documentation updates for iam -* `service/sts`: Updates service documentation - * Documentation updates for sts - -Release v1.19.24 (2019-05-03) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * DASH output groups using DRM encryption can now enable a playback device compatibility mode to correct problems with playback on older devices. -* `service/medialive`: Updates service API and documentation - * You can now switch the channel mode of your channels from standard to single pipeline and from single pipeline to standard. In order to switch a channel from single pipeline to standard all inputs attached to the channel must support two encoder pipelines. -* `service/workmail`: Updates service API, documentation, and paginators - * Amazon WorkMail is releasing two new actions: 'GetMailboxDetails' and 'UpdateMailboxQuota'. They add insight into how much space is used by a given mailbox (size) and what its limit is (quota). A mailbox quota can be updated, but lowering the value will not influence WorkMail per user charges. For a closer look at the actions please visit https://docs.aws.amazon.com/workmail/latest/APIReference/API_Operations.html - -Release v1.19.23 (2019-05-02) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kms`: Updates service API and documentation - * AWS Key Management Service (KMS) can return an INTERNAL_ERROR connection error code if it cannot connect a custom key store to its AWS CloudHSM cluster. INTERNAL_ERROR is one of several connection error codes that help you to diagnose and fix a problem with your custom key store. - -Release v1.19.22 (2019-05-01) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds an API for the modification of a VPN Connection, enabling migration from a Virtual Private Gateway (VGW) to a Transit Gateway (TGW), while preserving the VPN endpoint IP addresses on the AWS side as well as the tunnel options. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces additional task definition parameters that enable you to define secret options for Docker log configuration, a per-container list contains secrets stored in AWS Systems Manager Parameter Store or AWS Secrets Manager. -* `service/xray`: Updates service API, documentation, and paginators - * AWS X-Ray now includes Analytics, an interactive approach to analyzing user request paths (i.e., traces). Analytics will allow you to easily understand how your application and its underlying services are performing. With X-Ray Analytics, you can quickly detect application issues, pinpoint the root cause of the issue, determine the severity of the issues, and identify which end users were impacted. With AWS X-Ray Analytics you can explore, analyze, and visualize traces, allowing you to find increases in response time to user requests or increases in error rates. Metadata around peak periods, including frequency and actual times of occurrence, can be investigated by applying filters with a few clicks. You can then drill down on specific errors, faults, and response time root causes and view the associated traces. - -Release v1.19.21 (2019-04-30) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service API and documentation - * This release contains an update to the PipelineContext object that includes the Pipeline ARN, and the Pipeline Execution Id. The ActionContext object is also updated to include the Action Execution Id. -* `service/directconnect`: Updates service API and documentation - * This release adds support for AWS Direct Connect customers to use AWS Transit Gateway with AWS Direct Connect gateway to route traffic between on-premise networks and their VPCs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/managedblockchain`: Adds new service -* `service/neptune`: Updates service API, documentation, and examples - * Adds a feature to allow customers to specify a custom parameter group when restoring a database cluster. -* `service/s3control`: Updates service API, documentation, and paginators - * Add support for Amazon S3 Batch Operations. -* `service/servicecatalog`: Updates service API, documentation, and paginators - * Admin users can now associate/disassociate aws budgets with a portfolio or product in Service Catalog. End users can see the association by listing it or as part of the describe portfolio/product output. A new optional boolean parameter, "DisableTemplateValidation", is added to ProvisioningArtifactProperties data type. The purpose of the parameter is to enable or disable the CloudFormation template validtion when creating a product or a provisioning artifact. - -Release v1.19.20 (2019-04-29) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Adds support for Elastic Fabric Adapter (EFA) ENIs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/transfer`: Updates service API, documentation, and paginators - * This release adds support for per-server host-key management. You can now specify the SSH RSA private key used by your SFTP server. - -Release v1.19.19 (2019-04-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iam`: Updates service API, documentation, waiters, and examples - * AWS Security Token Service (STS) enables you to request session tokens from the global STS endpoint that work in all AWS Regions. You can configure the global STS endpoint to vend session tokens that are compatible with all AWS Regions using the new IAM SetSecurityTokenServicePreferences API. -* `service/sns`: Updates service API and documentation - * With this release AWS SNS adds tagging support for Topics. - -Release v1.19.18 (2019-04-25) -=== - -### Service Client Updates -* `service/batch`: Updates service documentation - * Documentation updates for AWS Batch. -* `service/dynamodb`: Updates service API and documentation - * This update allows you to tag Amazon DynamoDB tables when you create them. Tags are labels you can attach to AWS resources to make them easier to manage, search, and filter. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/gamelift`: Updates service API and documentation - * This release introduces the new Realtime Servers feature, giving game developers a lightweight yet flexible solution that eliminates the need to build a fully custom game server. The AWS SDK updates provide support for scripts, which are used to configure and customize Realtime Servers. -* `service/inspector`: Updates service API and documentation - * AWS Inspector - Improve the ListFindings API response time and decreases the maximum number of agentIDs from 500 to 99. -* `service/lambda`: Updates service API and documentation - * AWS Lambda now supports the GetLayerVersionByArn API. -* `service/workspaces`: Updates service documentation - * Documentation updates for workspaces - -Release v1.19.17 (2019-04-24) -=== - -### Bug Fixes -* `aws/endpoints`: Fix incorrect AWS Organizations global endpoint - * Fixes the endpoint metadata for the AWS Organization in [Release v1.19.16](https://github.com/aws/aws-sdk-go/releases/tag/v1.19.16) - -Release v1.19.16 (2019-04-24) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/cloudformation`: Updates service documentation - * Documentation updates for cloudformation -* `service/ec2`: Updates service API - * You can now launch the new Amazon EC2 general purpose burstable instance types T3a that feature AMD EPYC processors. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconnect`: Updates service API, documentation, and paginators -* `service/mediatailor`: Updates service API and documentation -* `service/rds`: Updates service API and documentation - * A new parameter "feature-name" is added to the add-role and remove-role db cluster APIs. The value for the parameter is optional for Aurora MySQL compatible database clusters, but mandatory for Aurora PostgresQL. You can find the valid list of values using describe db engine versions API. -* `service/route53`: Updates service API and documentation - * Amazon Route 53 now supports the Asia Pacific (Hong Kong) Region (ap-east-1) for latency records, geoproximity records, and private DNS for Amazon VPCs in that region. -* `service/ssm`: Updates service API and documentation - * This release updates AWS Systems Manager APIs to allow customers to configure parameters to use either the standard-parameter tier (the default tier) or the advanced-parameter tier. It allows customers to create parameters with larger values and attach parameter policies to an Advanced Parameter. -* `service/storagegateway`: Updates service API, documentation, and paginators - * AWS Storage Gateway now supports Access Control Lists (ACLs) on File Gateway SMB shares, enabling you to apply fine grained access controls for Active Directory users and groups. -* `service/textract`: Updates service API and documentation - -Release v1.19.15 (2019-04-19) -=== - -### Service Client Updates -* `service/resource-groups`: Updates service API and documentation -* `service/transcribe`: Updates service API -* `service/workspaces`: Updates service API and documentation - * Added a new reserved field. - -Release v1.19.14 (2019-04-18) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service documentation -* `service/discovery`: Updates service API - * The Application Discovery Service's DescribeImportTasks and BatchDeleteImportData APIs now return additional statuses for error reporting. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kafka`: Updates service API and documentation -* `service/organizations`: Updates service API and documentation - * AWS Organizations is now available in the AWS GovCloud (US) Regions, and we added a new API action for creating accounts in those Regions. For more information, see CreateGovCloudAccount in the AWS Organizations API Reference. -* `service/rds`: Updates service API and documentation - * This release adds the TimeoutAction parameter to the ScalingConfiguration of an Aurora Serverless DB cluster. You can now configure the behavior when an auto-scaling capacity change can't find a scaling point. -* `service/worklink`: Updates service API, documentation, and paginators -* `service/workspaces`: Updates service documentation - * Documentation updates for workspaces - -Release v1.19.13 (2019-04-17) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds support for requester-managed Interface VPC Endpoints (powered by AWS PrivateLink). The feature prevents VPC endpoint owners from accidentally deleting or otherwise mismanaging the VPC endpoints of some AWS VPC endpoint services. -* `service/polly`: Updates service API - * Amazon Polly adds Arabic language support with new female voice - "Zeina" - -Release v1.19.12 (2019-04-16) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API, documentation, and paginators -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/monitoring`: Updates service documentation - * Documentation updates for monitoring -* `service/mq`: Updates service API and documentation - * This release adds the ability to retrieve information about broker engines and broker instance options. See Broker Engine Types and Broker Instance Options in the Amazon MQ REST API Reference. -* `service/organizations`: Updates service documentation - * Documentation updates for organizations -* `service/redshift`: Updates service API and documentation - * DescribeResize can now return percent of data transferred from source cluster to target cluster for a classic resize. -* `service/storagegateway`: Updates service API and documentation - * This change allows you to select either a weekly or monthly maintenance window for your volume or tape gateway. It also allows you to tag your tape and volume resources on creation by adding a Tag value on calls to the respective api endpoints. - -### SDK Enhancements -* `example/service/dynamodb`: Add custom unmarshaller error example for TransactWriteItems ([#2548](https://github.com/aws/aws-sdk-go/pull/2548)) - * Adds an example for building and using a custom unmarshaller to unmarshal TransactionCancelledExceptions from the error response of TransactWriteItems operation. - -Release v1.19.11 (2019-04-05) -=== - -### Service Client Updates -* `service/comprehend`: Updates service API and documentation -* `service/glue`: Updates service API and documentation - * AWS Glue now supports workerType choices in the CreateJob, UpdateJob, and StartJobRun APIs, to be used for memory-intensive jobs. -* `service/iot1click-devices`: Updates service API and documentation -* `service/mediaconvert`: Updates service API - * Rectify incorrect modelling of DisassociateCertificate method -* `service/medialive`: Updates service API, documentation, and paginators - * Today AWS Elemental MediaLive (https://aws.amazon.com/medialive/) adds the option to create "Single Pipeline" channels, which offers a lower-cost option compared to Standard channels. MediaLive Single Pipeline channels have a single encoding pipeline rather than the redundant dual Availability Zone (AZ) pipelines that MediaLive provides with a "Standard" channel. - -Release v1.19.10 (2019-04-04) -=== - -### Service Client Updates -* `service/eks`: Updates service API and documentation -* `service/iam`: Updates service documentation - * Documentation updates for iam - -Release v1.19.9 (2019-04-03) -=== - -### Service Client Updates -* `service/batch`: Updates service API and documentation - * Support for GPU resource requirement in RegisterJobDefinition and SubmitJob -* `service/comprehend`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.19.8 (2019-04-02) -=== - -### Service Client Updates -* `service/acm`: Updates service documentation - * Documentation updates for acm -* `service/ec2`: Updates service paginators - * Add paginators. -* `service/securityhub`: Updates service API and documentation - -Release v1.19.7 (2019-04-01) -=== - -### Service Client Updates -* `service/elasticmapreduce`: Updates service API, documentation, and paginators - * Amazon EMR adds the ability to modify instance group configurations on a running cluster through the new "configurations" field in the ModifyInstanceGroups API. -* `service/ssm`: Updates service documentation - * March 2019 documentation updates for Systems Manager. - -Release v1.19.6 (2019-03-29) -=== - -### Service Client Updates -* `service/comprehend`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/greengrass`: Updates service API and documentation - * Greengrass APIs now support tagging operations on resources -* `service/monitoring`: Updates service API and documentation - * Added 3 new APIs, and one additional parameter to PutMetricAlarm API, to support tagging of CloudWatch Alarms. - -Release v1.19.5 (2019-03-28) -=== - -### Service Client Updates -* `service/medialive`: Updates service API and documentation - * This release adds a new output locking mode synchronized to the Unix epoch. -* `service/pinpoint-email`: Updates service API and documentation -* `service/servicecatalog`: Updates service API and documentation - * Adds "Tags" field in UpdateProvisionedProduct API. The product should have a new RESOURCE_UPDATE Constraint with TagUpdateOnProvisionedProduct field set to ALLOWED for it to work. See API docs for CreateConstraint for more information -* `service/workspaces`: Updates service API and documentation - * Amazon WorkSpaces adds tagging support for WorkSpaces Images, WorkSpaces directories, WorkSpaces bundles and IP Access control groups. - -Release v1.19.4 (2019-03-27) -=== - -### Service Client Updates -* `service/directconnect`: Updates service API and documentation - * Direct Connect gateway enables you to establish connectivity between your on-premise networks and Amazon Virtual Private Clouds (VPCs) in any commercial AWS Region (except in China) using AWS Direct Connect connections at any AWS Direct Connect location. This release enables multi-account support for Direct Connect gateway, with multi-account support for Direct Connect gateway, you can associate up to ten VPCs from any AWS account with a Direct Connect gateway. The AWS accounts owning VPCs and the Direct Connect gateway must belong to the same AWS payer account ID. This release also enables Direct Connect Gateway owners to allocate allowed prefixes from each associated VPCs. -* `service/fms`: Updates service API, documentation, and paginators -* `service/iotanalytics`: Updates service API and documentation -* `service/mediaconvert`: Updates service API and documentation - * This release adds support for detailed job progress status and S3 server-side output encryption. In addition, the anti-alias filter will now be automatically applied to all outputs -* `service/robomaker`: Updates service API, documentation, and paginators -* `service/transcribe`: Updates service API and documentation - -Release v1.19.3 (2019-03-27) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API, documentation, and paginators -* `service/ec2`: Updates service API - * You can now launch the new Amazon EC2 R5ad and M5ad instances that feature local NVMe attached SSD instance storage (up to 3600 GB). M5ad and R5ad feature AMD EPYC processors that offer a 10% cost savings over the M5d and R5d EC2 instances. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for external deployment controllers for ECS services with the launch of task set management APIs. Task sets are a new primitive for controlled management of application deployments within a single ECS service. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/s3`: Updates service API, documentation, and examples - * S3 Glacier Deep Archive provides secure, durable object storage class for long term data archival. This SDK release provides API support for this new storage class. -* `service/storagegateway`: Updates service API and documentation - * This change allows you to select a pool for archiving virtual tapes. Pools are associated with S3 storage classes. You can now choose to archive virtual tapes in either S3 Glacier or S3 Glacier Deep Archive storage class. CreateTapes API now takes a new PoolId parameter which can either be GLACIER or DEEP_ARCHIVE. Tapes created with this parameter will be archived in the corresponding storage class. -* `service/transfer`: Updates service API and documentation - * This release adds PrivateLink support to your AWS SFTP server endpoint, enabling the customer to access their SFTP server within a VPC, without having to traverse the internet. Customers can now can create a server and specify an option whether they want the endpoint to be hosted as public or in their VPC, and with the in VPC option, SFTP clients and users can access the server only from the customer's VPC or from their on-premises environments using DX or VPN. This release also relaxes the SFTP user name requirements to allow underscores and hyphens. - -Release v1.19.2 (2019-03-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * This new feature will now allow customers to add a customized csv classifier with classifier API. They can specify a custom delimiter, quote symbol and control other behavior they'd like crawlers to have while recognizing csv files -* `service/workmail`: Updates service API and documentation - * Documentation updates for Amazon WorkMail. - -Release v1.19.1 (2019-03-22) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot1click-projects`: Updates service API and documentation -* `service/transcribe`: Updates service API and documentation - -Release v1.19.0 (2019-03-21) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service documentation - * Documentation updates for Amazon EC2 Auto Scaling -* `service/cognito-idp`: Updates service API and documentation -* `service/events`: Updates service API and documentation - * Added 3 new APIs, and one additional parameter to the PutRule API, to support tagging of CloudWatch Events rules. -* `service/iot`: Updates service API and documentation - * This release adds the GetStatistics API for the AWS IoT Fleet Indexing Service, which allows customers to query for statistics about registered devices that match a search query. This release only supports the count statistics. For more information about this API, see https://docs.aws.amazon.com/iot/latest/apireference/API_GetStatistics.html -* `service/lightsail`: Updates service API and documentation - * This release adds the DeleteKnownHostKeys API, which enables Lightsail's browser-based SSH or RDP clients to connect to the instance after a host key mismatch. - -### SDK Features -* `aws/credentials/stscreds`: Update StdinTokenProvider to prompt on stder ([#2481](https://github.com/aws/aws-sdk-go/pull/2481)) - * Updates the `stscreds` package default MFA token provider, `StdinTokenProvider`, to prompt on `stderr` instead of `stdout`. This is to make it possible to redirect/pipe output when using `StdinTokenProvider` and still seeing the prompt text. - -Release v1.18.6 (2019-03-20) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service API and documentation - * Add support for viewing details of each action execution belonging to past and latest pipeline executions that have occurred in customer's pipeline. The details include start/updated times, action execution results, input/output artifacts information, etc. Customers also have the option to add pipelineExecutionId in the input to filter the results down to a single pipeline execution. -* `service/cognito-identity`: Updates service API and documentation -* `service/meteringmarketplace`: Updates service API and documentation - * This release increases AWS Marketplace Metering Service maximum usage quantity to 2147483647 and makes parameters usage quantity and dryrun optional. - -### SDK Bugs -* `private/protocol`: Use correct Content-Type for rest json protocol ([#2497](https://github.com/aws/aws-sdk-go/pull/2497)) - * Updates the SDK to use the correct `application/json` content type for all rest json protocol based AWS services. This fixes the bug where the jsonrpc protocol's `application/x-amz-json-X.Y` content type would be used for services like Pinpoint SMS. - -Release v1.18.5 (2019-03-19) -=== - -### Service Client Updates -* `service/config`: Updates service API and documentation -* `service/eks`: Updates service API and documentation - -Release v1.18.4 (2019-03-18) -=== - -### Service Client Updates -* `service/chime`: Updates service API, documentation, and paginators - * This release adds support for the Amazon Chime Business Calling and Voice Connector features. -* `service/dms`: Updates service API, documentation, and paginators - * S3 Endpoint Settings added support for 1) Migrating to Amazon S3 as a target in Parquet format 2) Encrypting S3 objects after migration with custom KMS Server-Side encryption. Redshift Endpoint Settings added support for encrypting intermediate S3 objects during migration with custom KMS Server-Side encryption. -* `service/ec2`: Updates service API and documentation - * DescribeFpgaImages API now returns a new DataRetentionSupport attribute to indicate if the AFI meets the requirements to support DRAM data retention. DataRetentionSupport is a read-only attribute. - -Release v1.18.3 (2019-03-14) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * AWS Certificate Manager has added a new API action, RenewCertificate. RenewCertificate causes ACM to force the renewal of any private certificate which has been exported. -* `service/acm-pca`: Updates service API, documentation, and paginators -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * This release adds tagging support for Dedicated Host Reservations. -* `service/iot`: Updates service API and documentation - * In this release, AWS IoT introduces support for tagging OTA Update and Stream resources. For more information about tagging, see the AWS IoT Developer Guide. -* `service/monitoring`: Updates service API, documentation, and paginators - * New Messages parameter for the output of GetMetricData, to support new metric search functionality. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker Automatic Model Tuning now supports random search and hyperparameter scaling. - -Release v1.18.2 (2019-03-13) -=== - -### Service Client Updates -* `service/config`: Updates service API, documentation, and paginators -* `service/logs`: Updates service documentation - * Documentation updates for logs - -Release v1.18.1 (2019-03-12) -=== - -### Service Client Updates -* `service/serverlessrepo`: Updates service API and documentation - -Release v1.18.0 (2019-03-11) -=== - -### Service Client Updates -* `service/ce`: Updates service API -* `service/elasticbeanstalk`: Updates service API and documentation - * Elastic Beanstalk added support for tagging, and tag-based access control, of all Elastic Beanstalk resources. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * CreateDevEndpoint and UpdateDevEndpoint now support Arguments to configure the DevEndpoint. -* `service/iot`: Updates service documentation - * Documentation updates for iot -* `service/quicksight`: Updates service API and documentation - * Amazon QuickSight user and group operation results now include group principal IDs and user principal IDs. This release also adds "DeleteUserByPrincipalId", which deletes users given their principal ID. The update also improves role session name validation. -* `service/rekognition`: Updates service documentation - * Documentation updates for Amazon Rekognition - -### SDK Features -* `service/kinesis`: Enable support for SubscribeToStream API operation ([#2402](https://github.com/aws/aws-sdk-go/pull/2402)) - * Adds support for Kinesis's SubscribeToStream API operation. The API operation response type, `SubscribeToStreamOutput` member, EventStream has a method `Events` which returns a channel to read Kinesis record events from. - -Release v1.17.14 (2019-03-08) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * CodeBuild also now supports Git Submodules. CodeBuild now supports opting out of Encryption for S3 Build Logs. By default these logs are encrypted. -* `service/s3`: Updates service documentation and examples - * Documentation updates for s3 -* `service/sagemaker`: Updates service API and documentation - * SageMaker notebook instances now support enabling or disabling root access for notebook users. SageMaker Neo now supports rk3399 and rk3288 as compilation target devices. - -Release v1.17.13 (2019-03-07) -=== - -### Service Client Updates -* `service/appmesh`: Adds new service -* `service/autoscaling`: Updates service documentation - * Documentation updates for autoscaling -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces additional task definition parameters that enable you to define dependencies for container startup and shutdown, a per-container start and stop timeout value, as well as an AWS App Mesh proxy configuration which eases the integration between Amazon ECS and AWS App Mesh. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/gamelift`: Updates service API and documentation - * Amazon GameLift-hosted instances can now securely access resources on other AWS services using IAM roles. See more details at https://aws.amazon.com/releasenotes/amazon-gamelift/. -* `service/greengrass`: Updates service API and documentation - * Greengrass group UID and GID settings can now be configured to use a provided default via FunctionDefaultConfig. If configured, all Lambda processes in your deployed Greengrass group will by default start with the provided UID and/or GID, rather than by default starting with UID "ggc_user" and GID "ggc_group" as they would if not configured. Individual Lambdas can also be configured to override the defaults if desired via each object in the Functions list of your FunctionDefinitionVersion. -* `service/medialive`: Updates service API and documentation - * This release adds a MediaPackage output group, simplifying configuration of outputs to AWS Elemental MediaPackage. -* `service/rds`: Updates service API and documentation - * You can configure your Aurora database cluster to automatically copy tags on the cluster to any automated or manual database cluster snapshots that are created from the cluster. This allows you to easily set metadata on your snapshots to match the parent cluster, including access policies. You may enable or disable this functionality while creating a new cluster, or by modifying an existing database cluster. - -Release v1.17.12 (2019-03-06) -=== - -### Service Client Updates -* `service/directconnect`: Updates service API and documentation - * Exposed a new available port speeds field in the DescribeLocation api call. -* `service/ec2`: Updates service API, documentation, and paginators - * This release adds pagination support for ec2.DescribeVpcs, ec2.DescribeInternetGateways and ec2.DescribeNetworkAcls APIs -* `service/elasticfilesystem`: Updates service examples - * Documentation updates for elasticfilesystem adding new examples for EFS Lifecycle Management feature. - -Release v1.17.11 (2019-03-05) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service documentation - * Documentation updates for codedeploy -* `service/medialive`: Updates service API and documentation - * This release adds support for pausing and unpausing one or both pipelines at scheduled times. -* `service/storagegateway`: Updates service API and documentation - * ActivateGateway, CreateNFSFileShare and CreateSMBFileShare APIs support a new parameter: Tags (to be attached to the created resource). Output for DescribeNFSFileShare, DescribeSMBFileShare and DescribeGatewayInformation APIs now also list the Tags associated with the resource. Minimum length of a KMSKey is now 7 characters. -* `service/textract`: Adds new service - -Release v1.17.10 (2019-03-04) -=== - -### Service Client Updates -* `service/mediapackage`: Updates service API and documentation - * This release adds support for user-defined tagging of MediaPackage resources. Users may now call operations to list, add and remove tags from channels and origin-endpoints. Users can also specify tags to be attached to these resources during their creation. Describe and list operations on these resources will now additionally return any tags associated with them. -* `service/ssm`: Updates service API and documentation - * This release updates AWS Systems Manager APIs to support service settings for AWS customers. A service setting is a key-value pair that defines how a user interacts with or uses an AWS service, and is typically created and consumed by the AWS service team. AWS customers can read a service setting via GetServiceSetting API and update the setting via UpdateServiceSetting API or ResetServiceSetting API, which are introduced in this release. For example, if an AWS service charges money to the account based on a feature or service usage, then the AWS service team might create a setting with the default value of "false". This means the user can't use this feature unless they update the setting to "true" and intentionally opt in for a paid feature. - -Release v1.17.9 (2019-03-01) -=== - -### Service Client Updates -* `service/autoscaling-plans`: Updates service documentation -* `service/ec2`: Updates service API and documentation - * This release adds support for modifying instance event start time which allows users to reschedule EC2 events. - -### SDK Enhancements -* `example/service/s3`: Add example of S3 download with progress ([#2456](https://github.com/aws/aws-sdk-go/pull/2456)) - * Adds a new example to the S3 service's examples. This example shows how you could use the S3's GetObject API call in conjunction with a custom writer keeping track of progress. - * Related to [#1868](https://github.com/aws/aws-sdk-go/pull/1868), [#2468](https://github.com/aws/aws-sdk-go/pull/2468) - -### SDK Bugs -* `aws/session`: Allow HTTP Proxy with custom CA bundle ([#2343](https://github.com/aws/aws-sdk-go/pull/2343)) - * Ensures Go HTTP Client's `ProxyFromEnvironment` functionality is still enabled when custom CA bundles are used with the SDK. - * Fix [#2287](https://github.com/aws/aws-sdk-go/pull/2287) - -Release v1.17.8 (2019-02-28) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/apigatewayv2`: Updates service API and documentation -* `service/application-autoscaling`: Updates service documentation -* `service/ssm`: Updates service API and documentation - -Release v1.17.7 (2019-02-28) -=== - -### Service Client Updates -* `service/waf`: Updates service documentation - * Documentation updates for waf -* `service/waf-regional`: Updates service documentation - -### SDK Bugs -* `aws/request`: Fix RequestUserAgent tests to be stable ([#2462](https://github.com/aws/aws-sdk-go/pull/2462)) - * Fixes the request User-Agent unit tests to be stable across all platforms and environments. - * Fixes [#2366](https://github.com/aws/aws-sdk-go/issues/2366) -* `aws/ec2metadata`: Fix EC2 Metadata client panic with debug logging ([#2461](https://github.com/aws/aws-sdk-go/pull/2461)) - * Fixes a panic that could occur witihin the EC2 Metadata client when both `AWS_EC2_METADATA_DISABLED` env var is set and log level is LogDebugWithHTTPBody. -* `private/protocol/rest`: Trim space in header key and value ([#2460](https://github.com/aws/aws-sdk-go/pull/2460)) - * Updates the REST protocol marshaler to trip leading and trailing space from header keys and values before setting the HTTP request header. Fixes a bug when using S3 metadata where metadata values with leading spaces would trigger request signature validation errors when the request is received by the service. - * Fixes [#2448](https://github.com/aws/aws-sdk-go/issues/2448) - -Release v1.17.6 (2019-02-26) -=== - -### Service Client Updates -* `service/cur`: Updates service API, documentation, and examples - * Adding support for Athena and new report preferences to the Cost and Usage Report API. -* `service/discovery`: Updates service documentation - * Documentation updates for discovery -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added several features including support for: auto-rotation or user-specified rotation of 0, 90, 180, or 270 degrees; multiple output groups with DRM; ESAM XML documents to specify ad insertion points; Offline Apple HLS FairPlay content protection. -* `service/opsworkscm`: Updates service documentation - * Documentation updates for opsworkscm -* `service/organizations`: Updates service documentation - * Documentation updates for AWS Organizations -* `service/pinpoint`: Updates service API and documentation - * This release adds support for the Amazon Resource Groups Tagging API to Amazon Pinpoint, which means that you can now add and manage tags for Amazon Pinpoint projects (apps), campaigns, and segments. A tag is a label that you optionally define and associate with Amazon Pinpoint resource. Tags can help you categorize and manage these types of resources in different ways, such as by purpose, owner, environment, or other criteria. For example, you can use tags to apply policies or automation, or to identify resources that are subject to certain compliance requirements. A project, campaign, or segment can have as many as 50 tags. For more information about using and managing tags in Amazon Pinpoint, see the Amazon Pinpoint Developer Guide at https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html. For more information about the Amazon Resource Group Tagging API, see the Amazon Resource Group Tagging API Reference at https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/Welcome.html. -* `service/resource-groups`: Updates service documentation - -Release v1.17.5 (2019-02-25) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Added support for passing an empty SpotMaxPrice parameter to remove a value previously set when updating an Amazon EC2 Auto Scaling group. -* `service/ce`: Updates service documentation -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/mediastore`: Updates service API and documentation - * This release adds support for access logging, which provides detailed records for the requests that are made to objects in a container. - -Release v1.17.4 (2019-02-22) -=== - -### Service Client Updates -* `service/athena`: Updates service API and documentation - * This release adds tagging support for Workgroups to Amazon Athena. Use these APIs to add, remove, or list tags on Workgroups, and leverage the tags for various authorization and billing scenarios. -* `service/cloud9`: Updates service API and documentation - * Adding EnvironmentLifecycle to the Environment data type. -* `service/glue`: Updates service API, documentation, and paginators - * AWS Glue adds support for assigning AWS resource tags to jobs, triggers, development endpoints, and crawlers. Each tag consists of a key and an optional value, both of which you define. With this capacity, customers can use tags in AWS Glue to easily organize and identify your resources, create cost allocation reports, and control access to resources. -* `service/states`: Updates service API and documentation - * This release adds support for tag-on-create. You can now add tags when you create AWS Step Functions activity and state machine resources. For more information about tagging, see AWS Tagging Strategies. - -Release v1.17.3 (2019-02-21) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Add support for CodeBuild local caching feature -* `service/kinesis-video-archived-media`: Updates service API and documentation -* `service/kinesis-video-media`: Updates service documentation -* `service/kinesisvideo`: Updates service documentation - * Documentation updates for Kinesis Video Streams -* `service/monitoring`: Updates service documentation - * Documentation updates for monitoring -* `service/organizations`: Updates service documentation - * Documentation updates for organizations -* `service/transfer`: Updates service API and documentation - * Bug fix: increased the max length allowed for request parameter NextToken when paginating List operations -* `service/workdocs`: Updates service documentation - * Documentation updates for workdocs - -Release v1.17.2 (2019-02-20) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * This release adds an API for adding / updating / deleting / copying / moving / setting file modes for one or more files directly to an AWS CodeCommit repository without requiring a Git client. -* `service/directconnect`: Updates service API and documentation - * Documentation updates for AWS Direct Connect -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/medialive`: Updates service API and documentation - * This release adds support for VPC inputs, allowing you to push content from your Amazon VPC directly to MediaLive. - -Release v1.17.1 (2019-02-19) -=== - -### Service Client Updates -* `service/ds`: Updates service API and documentation - * This release adds support for tags during directory creation (CreateDirectory, CreateMicrosoftAd, ConnectDirectory). -* `service/elasticfilesystem`: Updates service API, documentation, and examples - * Amazon EFS now supports adding tags to file system resources as part of the CreateFileSystem API . Using this capability, customers can now more easily enforce tag-based authorization for EFS file system resources. -* `service/iot`: Updates service API and documentation - * AWS IoT - AWS IoT Device Defender adds support for configuring behaviors in a security profile with statistical thresholds. Device Defender also adds support for configuring multiple data-point evaluations before a violation is either created or cleared. -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager now supports adding tags when creating Activations, Patch Baselines, Documents, Parameters, and Maintenance Windows - -Release v1.17.0 (2019-02-18) -=== - -### Service Client Updates -* `service/athena`: Updates service API, documentation, and paginators - * This release adds support for Workgroups to Amazon Athena. Use Workgroups to isolate users, teams, applications or workloads in the same account, control costs by setting up query limits and creating Amazon SNS alarms, and publish query-related metrics to Amazon CloudWatch. -* `service/secretsmanager`: Updates service API and documentation - * This release increases the maximum allowed size of SecretString or SecretBinary from 4KB to 7KB in the CreateSecret, UpdateSecret, PutSecretValue and GetSecretValue APIs. - -### SDK Features -* `service/s3/s3manager`: Update S3 Upload Multipart location ([#2453](https://github.com/aws/aws-sdk-go/pull/2453)) - * Updates the Location returned value of S3 Upload's Multipart UploadOutput type to be consistent with single part upload URL. This update also brings the multipart upload Location inline with the S3 object URLs created by the SDK - * Fix [#1385](https://github.com/aws/aws-sdk-go/issues/1385) - -### SDK Enhancements -* `service/s3`: Update BucketRegionError message to include more information ([#2451](https://github.com/aws/aws-sdk-go/pull/2451)) - * Updates the BucketRegionError error message to include information about the endpoint and actual region the bucket is in if known. This error message is created by the SDK, but could produce a confusing error message if the user provided a region that doesn't match the endpoint. - * Fix [#2426](https://github.com/aws/aws-sdk-go/pull/2451) - -Release v1.16.36 (2019-02-15) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/chime`: Updates service documentation - * Documentation updates for Amazon Chime -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API and documentation - * In this release, IoT Device Defender introduces support for tagging Scheduled Audit resources. - -Release v1.16.35 (2019-02-14) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds tagging and ARN support for AWS Client VPN Endpoints.You can now run bare metal workloads on EC2 M5 and M5d instances. m5.metal and m5d.metal instances are powered by custom Intel Xeon Scalable Processors with a sustained all core frequency of up to 3.1 GHz. m5.metal and m5d.metal offer 96 vCPUs and 384 GiB of memory. With m5d.metal, you also have access to 3.6 TB of NVMe SSD-backed instance storage. m5.metal and m5d.metal instances deliver 25 Gbps of aggregate network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking, as well as 14 Gbps of bandwidth to EBS.You can now run bare metal workloads on EC2 z1d instances. z1d.metal instances are powered by custom Intel Xeon Scalable Processors with a sustained all core frequency of up to 4.0 GHz. z1d.metal offers 48 vCPUs, 384 GiB of memory, and 1.8 TB of NVMe SSD-backed instance storage. z1d.metal instances deliver 25 Gbps of aggregate network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking, as well as 14 Gbps of bandwidth to EBS. -* `service/kinesisvideo`: Updates service API and documentation - * Adds support for Tag-On-Create for Kinesis Video Streams. A list of tags associated with the stream can be created at the same time as the stream creation. - -Release v1.16.34 (2019-02-13) -=== - -### Service Client Updates -* `service/elasticfilesystem`: Updates service API and documentation - * Customers can now use the EFS Infrequent Access (IA) storage class to more cost-effectively store larger amounts of data in their file systems. EFS IA is cost-optimized storage for files that are not accessed every day. You can create a new file system and enable Lifecycle Management to automatically move files that have not been accessed for 30 days from the Standard storage class to the IA storage class. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediatailor`: Updates service API and documentation -* `service/rekognition`: Updates service API and documentation - * GetContentModeration now returns the version of the moderation detection model used to detect unsafe content. - -Release v1.16.33 (2019-02-12) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lambda`: Updates service documentation - * Documentation updates for AWS Lambda - -Release v1.16.32 (2019-02-11) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This update enables customers to find the start time, max expiration time, and connection status associated with AppStream streaming session. -* `service/codebuild`: Updates service API and documentation - * Add customized webhook filter support -* `service/mediapackage`: Updates service API and documentation - * Adds optional configuration for DASH to compact the manifest by combining duplicate SegmentTemplate tags. Adds optional configuration for DASH SegmentTemplate format to refer to segments by "Number" (default) or by "Time". - -Release v1.16.31 (2019-02-08) -=== - -### Service Client Updates -* `service/discovery`: Updates service documentation - * Documentation updates for the AWS Application Discovery Service. -* `service/dlm`: Updates service API and documentation -* `service/ecs`: Updates service API, documentation, and examples - * Amazon ECS introduces the PutAccountSettingDefault API, an API that allows a user to set the default ARN/ID format opt-in status for all the roles and users in the account. Previously, setting the account's default opt-in status required the use of the root user with the PutAccountSetting API. - -Release v1.16.30 (2019-02-07) -=== - -### Service Client Updates -* `service/es`: Updates service API and documentation - * Feature: Support for three Availability Zone deployments -* `service/gamelift`: Updates service API and documentation - * This release delivers a new API action for deleting unused matchmaking rule sets. More details are available at https://aws.amazon.com/releasenotes/?tag=releasenotes%23keywords%23amazon-gamelift. -* `service/medialive`: Updates service API and documentation - * This release adds tagging of channels, inputs, and input security groups. -* `service/robomaker`: Updates service API and documentation - -Release v1.16.29 (2019-02-06) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Add Linux with SQL Server Standard, Linux with SQL Server Web, and Linux with SQL Server Enterprise to the list of allowed instance platforms for On-Demand Capacity Reservations. -* `service/fsx`: Updates service API and documentation - -Release v1.16.28 (2019-02-05) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * ec2.DescribeVpcPeeringConnections pagination support -* `service/servicecatalog`: Updates service documentation - * Service Catalog Documentation Update for ProvisionedProductDetail -* `service/shield`: Updates service API and documentation - * The DescribeProtection request now accepts resource ARN as valid parameter. - -Release v1.16.27 (2019-02-04) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service documentation -* `service/codecommit`: Updates service API - * This release supports a more graceful handling of the error case when a repository is not associated with a pull request ID in a merge request in AWS CodeCommit. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for GPU workloads by enabling you to create clusters with GPU-enabled container instances. -* `service/workspaces`: Updates service API - * This release sets ClientProperties as a required parameter. - -Release v1.16.26 (2019-01-25) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * The PutFile API will now throw new exception FilePathConflictsWithSubmodulePathException when a submodule exists at the input file path; PutFile API will also throw FolderContentSizeLimitExceededException when the total size of any folder on the path exceeds the limit as a result of the operation. -* `service/devicefarm`: Updates service API and documentation - * Introduces a new rule in Device Pools - "Availability". Customers can now ensure they pick devices that are available (i.e., not being used by other customers). -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconnect`: Updates service API and documentation -* `service/medialive`: Updates service API and documentation - * This release adds support for Frame Capture output groups and for I-frame only manifests (playlists) in HLS output groups. - -Release v1.16.25 (2019-01-24) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * This release adds support for cross-account ECR images and private registry authentication. -* `service/ecr`: Updates service API - * Amazon ECR updated the default endpoint URL to support AWS Private Link. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/logs`: Updates service documentation - * Documentation updates for CloudWatch Logs -* `service/rds`: Updates service API and documentation - * The Amazon RDS API allows you to add or remove Identity and Access Management (IAM) role associated with a specific feature name with an RDS database instance. This helps with capabilities such as invoking Lambda functions from within a trigger in the database, load data from Amazon S3 and so on -* `service/sms-voice`: Updates service API and documentation - -Release v1.16.24 (2019-01-23) -=== - -### Service Client Updates -* `service/acm-pca`: Updates service API, documentation, and waiters -* `service/apigatewaymanagementapi`: Updates service API -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/worklink`: Adds new service - -### SDK Enhancements -* `aws`: Update Context to be an alias of context.Context for Go 1.9 ([#2412](https://github.com/aws/aws-sdk-go/pull/2412)) - * Updates aws.Context interface to be an alias of the standard libraries context.Context type instead of redefining the interface. This will allow IDEs and utilities to interpret the aws.Context as the exactly same type as the standard libraries context.Context. - -Release v1.16.23 (2019-01-21) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update includes support for tagging Stack, Fleet, and ImageBuilder resources at creation time. -* `service/discovery`: Updates service API, documentation, and paginators - * The Application Discovery Service's import APIs allow you to import information about your on-premises servers and applications into ADS so that you can track the status of your migrations through the Migration Hub console. -* `service/dms`: Updates service waiters - * Update for DMS TestConnectionSucceeds waiter -* `service/fms`: Updates service API and documentation -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager State Manager now supports configuration management of all AWS resources through integration with Automation. - -Release v1.16.22 (2019-01-18) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Adjust EC2's available instance types. -* `service/glue`: Updates service API and documentation - * AllocatedCapacity field is being deprecated and replaced with MaxCapacity field - -Release v1.16.21 (2019-01-17) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lambda`: Updates service documentation and examples - * Documentation updates for AWS Lambda -* `service/lightsail`: Updates service API and documentation - * This release adds functionality to the CreateDiskSnapshot API that allows users to snapshot instance root volumes. It also adds various documentation updates. -* `service/pinpoint`: Updates service API and documentation - * This release updates the PutEvents operation. AppPackageName, AppTitle, AppVersionCode, SdkName fields will now be accepted as a part of the event when submitting events. -* `service/rekognition`: Updates service API and documentation - * GetLabelDetection now returns bounding box information for common objects and a hierarchical taxonomy of detected labels. The version of the model used for video label detection is also returned. DetectModerationLabels now returns the version of the model used for detecting unsafe content. - -### SDK Enhancements -* `aws/request: Improve error handling in shouldRetryCancel ([#2298](https://github.com/aws/aws-sdk-go/pull/2298)) - * Simplifies and improves SDK's detection of HTTP request errors that should be retried. Previously the SDK would incorrectly attempt to retry `EHOSTDOWN` connection errors. This change fixes this, by using the `Temporary` interface when available. - -Release v1.16.20 (2019-01-16) -=== - -### Service Client Updates -* `service/backup`: Adds new service -* `service/ce`: Updates service documentation -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB now integrates with AWS Backup, a centralized backup service that makes it easy for customers to configure and audit the AWS resources they want to backup, automate backup scheduling, set retention policies, and monitor all recent backup and restore activity. AWS Backup provides a fully managed, policy-based backup solution, simplifying your backup management, and helping you meet your business and regulatory backup compliance requirements. For more information, see the Amazon DynamoDB Developer Guide. - -Release v1.16.19 (2019-01-14) -=== - -### Service Client Updates -* `service/mediaconvert`: Updates service API and documentation - * IMF decode from a Composition Playlist for IMF specializations App #2 and App #2e; up to 99 input clippings; caption channel selection for MXF; and updated rate control for CBR jobs. Added support for acceleration in preview -* `service/storagegateway`: Updates service API and documentation - * JoinDomain API supports two more parameters: organizational unit(OU) and domain controllers. Two new APIs are introduced: DetachVolume and AttachVolume. - -### SDK Enhancements -* `aws/endpoints`: Add customization for AWS GovCloud (US) Application Autoscalling ([#2395](https://github.com/aws/aws-sdk-go/pull/2395)) - * Adds workaround to correct the endpoint for Application Autoscaling running in AWS GovCloud (US). - * Fixes [#2391](https://github.com/aws/aws-sdk-go/issues/2391) - -Release v1.16.18 (2019-01-11) -=== - -### Service Client Updates -* `service/elasticmapreduce`: Updates service API and documentation - * Documentation updates for Amazon EMR -* `service/rds-data`: Updates service API, documentation, paginators, and examples - -Release v1.16.17 (2019-01-10) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service documentation - * Documentation updates for codedeploy -* `service/ec2`: Updates service API and documentation - * EC2 Spot: a) CreateFleet support for Single AvailabilityZone requests and b) support for paginated DescribeSpotInstanceRequests. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API and documentation - * This release adds tagging support for rules of AWS IoT Rules Engine. Tags enable you to categorize your rules in different ways, for example, by purpose, owner, or environment. For more information about tagging, see AWS Tagging Strategies (https://aws.amazon.com/answers/account-management/aws-tagging-strategies/). For technical documentation, look for the tagging operations in the AWS IoT Core API reference or User Guide (https://docs.aws.amazon.com/iot/latest/developerguide/tagging-iot.html). -* `service/sagemaker`: Updates service API and documentation - * SageMaker Training Jobs now support Inter-Container traffic encryption. - -Release v1.16.16 (2019-01-09) -=== - -### Service Client Updates -* `service/docdb`: Adds new service - * Amazon DocumentDB (with MongoDB compatibility) is a fast, reliable, and fully-managed database service. Amazon DocumentDB makes it easy for developers to set up, run, and scale MongoDB-compatible databases in the cloud. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service API and documentation - * DescribeSnapshotSchedules returns a list of snapshot schedules. With this release, this API will have a list of clusters and number of clusters associated with the schedule. - -Release v1.16.15 (2019-01-07) -=== - -### Service Client Updates -* `service/appmesh`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.16.14 (2019-01-04) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * "This release provides support for running Appium Node.js and Appium Ruby tests on AWS Device Farm. -* `service/ecs`: Updates service documentation - * Documentation updates for Amazon ECS tagging feature. - -Release v1.16.13 (2019-01-03) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iotanalytics`: Updates service API and documentation - -### SDK Enhancements -* `aws/credentials`: Add support for getting credential's ExpiresAt. ([#2375](https://github.com/aws/aws-sdk-go/pull/2375)) - * Adds an Expirer interface that Providers can implement, and add a suitable implementation to Expiry class used by most Providers. Add a method on Credentials to get the expiration time of the underlying Provider, if Expirer is supported, without exposing Provider to callers. - * Fix [#1329](https://github.com/aws/aws-sdk-go/pull/1329) - -### SDK Bugs -* `aws/ec2metadata`: bounds check region identifier before split ([#2380](https://github.com/aws/aws-sdk-go/pull/2380)) - * Adds empty response checking to ec2metadata's Region request to prevent a out of bounds panic if empty response received. -* Fix SDK's generated API reference doc page's constants section links ([#2373](https://github.com/aws/aws-sdk-go/pull/2373)) - * Fixes the SDK's generated API reference documentation page's constants section links to to be clickable. - -Release v1.16.12 (2019-01-03) -=== - -### Service Client Updates -* `service/opsworkscm`: Updates service documentation - * Documentation updates for opsworkscm - -Release v1.16.11 (2018-12-21) -=== - -### Service Client Updates -* `service/acm-pca`: Updates service documentation, waiters, paginators, and examples -* `service/dynamodb`: Updates service API and documentation - * Added provisionedThroughPut exception on the request level for transaction APIs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/sms-voice`: Updates service API and documentation -* `service/states`: Updates service API and documentation - * This release adds support for cost allocation tagging. You can now create, delete, and list tags for AWS Step Functions activity and state machine resources. For more information about tagging, see AWS Tagging Strategies. - -Release v1.16.10 (2018-12-20) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/comprehend`: Updates service API and documentation -* `service/firehose`: Updates service API and documentation - * Support for specifying customized s3 keys and supplying a separate prefix for failed-records -* `service/medialive`: Updates service API and documentation - * This release provides support for ID3 tags and video quality setting for subgop_length. -* `service/transcribe`: Updates service API and documentation - -### SDK Enhancements -* `service/dynamodb/expression`: Clarify expression examples ([#2367](https://github.com/aws/aws-sdk-go/pull/2367)) - * Clarifies the expression package's examples to distinguish the pkg expression from a expr value. - -Release v1.16.9 (2018-12-19) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release adds support for specifying partition as a strategy for EC2 Placement Groups. This new strategy allows one to launch instances into partitions that do not share certain underlying hardware between partitions, to assist with building and deploying highly available replicated applications. -* `service/sagemaker`: Updates service API and documentation - * Batch Transform Jobs now supports TFRecord as a Split Type. ListCompilationJobs API action now supports SortOrder and SortBy inputs. -* `service/waf`: Updates service API and documentation - * This release adds rule-level control for rule group. If a rule group contains a rule that blocks legitimate traffic, previously you had to override the entire rule group to COUNT in order to allow the traffic. You can now use the UpdateWebACL API to exclude specific rules within a rule group. Excluding rules changes the action for the individual rules to COUNT. Excluded rules will be recorded in the new "excludedRules" attribute of the WAF logs. -* `service/waf-regional`: Updates service API and documentation - -Release v1.16.8 (2018-12-18) -=== - -### Service Client Updates -* `service/apigatewaymanagementapi`: Adds new service -* `service/apigatewayv2`: Adds new service - * This is the initial SDK release for the Amazon API Gateway v2 APIs. This SDK will allow you to manage and configure APIs in Amazon API Gateway; this first release provides the capabilities that allow you to programmatically setup and manage WebSocket APIs end to end. -* `service/ec2`: Updates service API and documentation - * Client VPN, is a client-based VPN service. With Client VPN, you can securely access resources in AWS as well as access resources in on-premises from any location using OpenVPN based devices. With Client VPN, you can set network based firewall rules that can restrict access to networks based on Active Directory groups. -* `service/elasticbeanstalk`: Updates service API and documentation - * This release adds a new resource that Elastic Beanstalk will soon support, EC2 launch template, to environment resource descriptions. -* `service/globalaccelerator`: Updates service documentation - -Release v1.16.7 (2018-12-17) -=== - -### Service Client Updates -* `service/ecr`: Updates service API and documentation - * This release adds support for ECR repository tagging. -* `service/quicksight`: Updates service API and documentation - * Amazon QuickSight's RegisterUser API now generates a user invitation URL when registering a user with the QuickSight identity type. This URL can then be used by the registered QuickSight user to complete the user registration process. This release also corrects some HTTP return status codes. - -Release v1.16.6 (2018-12-14) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/cloudformation`: Updates service documentation - * Documentation updates for cloudformation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service documentation - * Documentation updates for Amazon Redshift - -### SDK Bugs -* `private/mode/api`: Fix idempotency members not to require validation [#2353](https://github.com/aws/aws-sdk-go/pull/2353) - * Fixes the SDK's usage of API operation request members marked as idempotency tokens to not require validation. These fields will be auto populated by the SDK if the user does not provide a value. The SDK was requiring the user to provide a value or disable validation to use these APIs. -* deps: Update Go Deps lock file to correct tracking hash [#2354](https://github.com/aws/aws-sdk-go/pull/2354) - -Release v1.16.5 (2018-12-13) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/organizations`: Updates service documentation - * Documentation updates for AWS Organizations -* `service/pinpoint-email`: Updates service API, documentation, and paginators - -Release v1.16.4 (2018-12-12) -=== - -### Service Client Updates -* `service/eks`: Updates service API and documentation -* `service/glue`: Updates service API and documentation - * API Update for Glue: this update enables encryption of password inside connection objects stored in AWS Glue Data Catalog using DataCatalogEncryptionSettings. In addition, a new "HidePassword" flag is added to GetConnection and GetConnections to return connections without passwords. -* `service/route53`: Updates service API and documentation - * You can now specify a new region, eu-north-1 (in Stockholm, Sweden), as a region for latency-based or geoproximity routing. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker Automatic Model Tuning now supports early stopping of training jobs. With early stopping, training jobs that are unlikely to generate good models will be automatically stopped during a Hyperparameter Tuning Job. - -Release v1.16.3 (2018-12-11) -=== - -### Service Client Updates -* `service/connect`: Updates service API and documentation -* `service/ecs`: Updates service documentation - * Documentation updates for Amazon ECS. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediastore`: Updates service API and documentation - * This release adds Delete Object Lifecycling to AWS MediaStore Containers. - -### SDK Bugs -* `private/model/api`: Fix SDK's unmarshaling of unmodeled response payload ([#2340](https://github.com/aws/aws-sdk-go/pull/2340)) - * Fixes the SDK's unmarshaling of API operation response payloads for operations that are unmodeled. Prevents the SDK due to unexpected response payloads causing errors in the API protocol unmarshaler. - * Fixes [#2332](https://github.com/aws/aws-sdk-go/issues/2332) - -Release v1.16.2 (2018-12-07) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/ec2`: Updates service API - * You can now launch the larger-sized P3dn.24xlarge instance that features NVIDIA Tesla V100s with double the GPU memory, 100Gbps networking and local NVMe storage. -* `service/iam`: Updates service API, documentation, and examples - * We are making it easier for you to manage your AWS Identity and Access Management (IAM) policy permissions by enabling you to retrieve the last timestamp when an IAM entity (e.g., user, role, or a group) accessed an AWS service. This feature also allows you to audit service access for your entities. -* `service/servicecatalog`: Updates service documentation - * Documentation updates for servicecatalog. - -### SDK Enhancements -* `aws/signer/v4`: Always sign a request with the current time. ([#2336](https://github.com/aws/aws-sdk-go/pull/2336)) - * Updates the SDK's v4 request signer to always sign requests with the current time. For the first request attempt, the request's creation time was used in the request's signature. In edge cases this allowed the signature to expire before the request was sent if there was significant delay between creating the request and sending it, (e.g. rate limiting). -* `aws/endpoints`: Deprecate endpoint service ID generation. ([#2338](https://github.com/aws/aws-sdk-go/pull/2338)) - * Deprecates the service ID generation. The list of service IDs do not directly 1:1 relate to a AWS service. The set of ServiceIDs is confusing, and inaccurate. Instead users should use the EndpointID value defined in each service client's package - -Release v1.16.1 (2018-12-06) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Support personal access tokens for GitHub source and app passwords for Bitbucket source -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/medialive`: Updates service API and documentation - * This release enables the AWS Elemental MediaConnect input type in AWS Elemental MediaLive. This can then be used to automatically create and manage AWS Elemental MediaConnect Flow Outputs when you create a channel using those inputs. -* `service/rds`: Updates service documentation - * Documentation updates for Amazon RDS - -Release v1.16.0 (2018-12-05) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/mediatailor`: Updates service API and documentation -* `service/mq`: Updates service API and documentation - * This release adds support for cost allocation tagging. You can now create, delete, and list tags for AmazonMQ resources. For more information about tagging, see AWS Tagging Strategies. - -### SDK Features -* `aws/credential`: Add credential_process provider ([#2217](https://github.com/aws/aws-sdk-go/pull/2217)) - * Adds support for the shared configuration file's `credential_process` property. This property allows the application to execute a command in order to retrieve AWS credentials for AWS service API request. In order to use this feature your application must enable the SDK's support of the shared configuration file. See, https://docs.aws.amazon.com/sdk-for-go/api/aws/session/#hdr-Sessions_from_Shared_Config for more information on enabling shared config support. - -### SDK Enhancements -* `service/sqs`: Add batch checksum validation test ([#2307](https://github.com/aws/aws-sdk-go/pull/2307)) - * Adds additional test of the SQS batch checksum validation. -* `aws/awsutils`: Update not to retrun sensitive fields for StringValue ([#2310](https://github.com/aws/aws-sdk-go/pull/2310)) -* Update SDK client integration tests to be code generated. ([#2308](https://github.com/aws/aws-sdk-go/pull/2308)) -* private/mode/api: Update SDK to require URI path members not be empty ([#2323](https://github.com/aws/aws-sdk-go/pull/2323)) - * Updates the SDK's validation to require that members serialized to URI path must not have empty (zero length) values. Generally these fields are modeled as required, but not always. Fixing this will prevent bugs with REST URI paths requests made for unexpected resources. - -### SDK Bugs -* aws/session: Fix formatting bug in doc. ([#2294](https://github.com/aws/aws-sdk-go/pull/2294)) - * Fixes a minor issue in aws/session/doc.go where mistakenly used format specifiers in logger.Println. -* Fix SDK model cleanup to remove old model folder ([#2324](https://github.com/aws/aws-sdk-go/pull/2324)) - * Fixes the SDK's model cleanup to remove the entire old model folder not just the api-2.json file. -* Fix SDK's vet usage to use go vet with build tags ([#2300](https://github.com/aws/aws-sdk-go/pull/2300)) - * Updates the SDK's usage of vet to use go vet instead of go tool vet. This allows the SDK to pass build tags and packages instead of just folder paths to the tool. - -Release v1.15.90 (2018-12-04) -=== - -### Service Client Updates -* `service/health`: Updates service API and documentation - * AWS Health API DescribeAffectedEntities operation now includes a field that returns the URL of the affected entity. -* `service/s3`: Updates service API - * S3 Inventory reports can now be generated in Parquet format by setting the Destination Format to be 'Parquet'. - -Release v1.15.89 (2018-12-03) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * Customers can now schedule runs without a need to create a Device Pool. They also get realtime information on public device availability. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service documentation - * Documentation updates for mediaconvert -* `service/servicecatalog`: Updates service documentation - * Documentation updates for servicecatalog -* `service/storagegateway`: Updates service API and documentation - * API list-local-disks returns a list of the gateway's local disks. This release adds a field DiskAttributeList to these disks. - -Release v1.15.88 (2018-11-29) -=== - -### Service Client Updates -* `service/s3`: Updates service documentation - * Fixed issue with Content-MD5 for S3 PutObjectLegalHold, PutObjectRetention and PutObjectLockConfiguration. - -Release v1.15.87 (2018-11-29) -=== - -### Service Client Updates -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/events`: Updates service API and documentation - * Support for Managed Rules (rules that are created and maintained by the AWS services in your account) is added. -* `service/kafka`: Adds new service -* `service/lambda`: Updates service API and documentation - * AWS Lambda now supports Lambda Layers and Ruby as a runtime. Lambda Layers are a new type of artifact that contains arbitrary code and data, and may be referenced by zero, one, or more functions at the same time. You can also now develop your AWS Lambda function code using the Ruby programming language. -* `service/s3`: Updates service API and examples - * Fixed issue with ObjectLockRetainUntilDate in S3 PutObject -* `service/serverlessrepo`: Updates service API, documentation, and paginators -* `service/states`: Updates service API and documentation - * AWS Step Functions is now integrated with eight additional AWS services: Amazon ECS, AWS Fargate, Amazon DynamoDB, Amazon SNS, Amazon SQS, AWS Batch, AWS Glue, and Amazon SageMaker. To learn more, please see https://docs.aws.amazon.com/step-functions/index.html -* `service/xray`: Updates service API and documentation - * GetTraceSummaries - Now provides additional information regarding your application traces such as Availability Zone, Instance ID, Resource ARN details, Revision, Entry Point, Root Cause Exceptions and Root Causes for Fault, Error and Response Time. - -Release v1.15.86 (2018-11-29) -=== - -### Service Client Updates -* `service/appmesh`: Adds new service -* `service/ec2`: Updates service API and documentation - * Adds the following updates: 1. You can now hibernate and resume Amazon-EBS backed instances using the StopInstances and StartInstances APIs. For more information about using this feature and supported instance types and operating systems, visit the user guide. 2. Amazon Elastic Inference accelerators are resources that you can attach to current generation EC2 instances to accelerate your deep learning inference workloads. With Amazon Elastic Inference, you can configure the right amount of inference acceleration to your deep learning application without being constrained by fixed hardware configurations and limited GPU selection. 3. AWS License Manager makes it easier to manage licenses in AWS and on premises when customers run applications using existing licenses from a variety of software vendors including Microsoft, SAP, Oracle, and IBM. -* `service/license-manager`: Adds new service -* `service/lightsail`: Updates service API and documentation - * This update adds the following features: 1. Copy instance and disk snapshots within the same AWS Region or from one region to another in Amazon Lightsail. 2. Export Lightsail instance and disk snapshots to Amazon Elastic Compute Cloud (Amazon EC2). 3. Create an Amazon EC2 instance from an exported Lightsail instance snapshot using AWS CloudFormation stacks. 4. Apply tags to filter your Lightsail resources, or organize your costs, or control access. -* `service/sagemaker`: Updates service API, documentation, and paginators - * Amazon SageMaker now has Algorithm and Model Package entities that can be used to create Training Jobs, Hyperparameter Tuning Jobs and hosted Models. Subscribed Marketplace products can be used on SageMaker to create Training Jobs, Hyperparameter Tuning Jobs and Models. Notebook Instances and Endpoints can leverage Elastic Inference accelerator types for on-demand GPU computing. Model optimizations can be performed with Compilation Jobs. Labeling Jobs can be created and supported by a Workforce. Models can now contain up to 5 containers allowing for inference pipelines within Endpoints. Code Repositories (such as Git) can be linked with SageMaker and loaded into Notebook Instances. Network isolation is now possible on Models, Training Jobs, and Hyperparameter Tuning Jobs, which restricts inbound/outbound network calls for the container. However, containers can talk to their peers in distributed training mode within the same security group. A Public Beta Search API was added that currently supports Training Jobs. -* `service/servicediscovery`: Updates service API and documentation - * AWS Cloud Map lets you define friendly names for your cloud resources so that your applications can quickly and dynamically discover them. When a resource becomes available (for example, an Amazon EC2 instance running a web server), you can register a Cloud Map service instance. Then your application can discover service instances by submitting DNS queries or API calls. - -Release v1.15.85 (2018-11-28) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB now supports the following features: DynamoDB on-demand and transactions. DynamoDB on-demand is a flexible new billing option for DynamoDB capable of serving thousands of requests per second without capacity planning. DynamoDB on-demand offers simple pay-per-request pricing for read and write requests so that you only pay for what you use, making it easy to balance costs and performance. Transactions simplify the developer experience of making coordinated, all-or-nothing changes to multiple items both within and across tables. The new transactional APIs provide atomicity, consistency, isolation, and durability (ACID) in DynamoDB, helping developers support sophisticated workflows and business logic that requires adding, updating, or deleting multiple items using native, server-side transactions. For more information, see the Amazon DynamoDB Developer Guide. -* `service/fsx`: Adds new service -* `service/rds`: Updates service API, documentation, and paginators - * Amazon Aurora Global Database. This release introduces support for Global Database, a feature that allows a single Amazon Aurora database to span multiple AWS regions. Customers can use the feature to replicate data with no impact on database performance, enable fast local reads with low latency in each region, and improve disaster recovery from region-wide outages. You can create, modify and describe an Aurora Global Database, as well as add or remove regions from your Global Database. -* `service/securityhub`: Adds new service - -Release v1.15.84 (2018-11-28) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * Support for Amazon ECS service deployment - AWS CodeDeploy now supports the deployment of Amazon ECS services. An Amazon ECS deployment uses an Elastic Load Balancer, two Amazon ECS target groups, and a listener to reroute production traffic from your Amazon ECS service's original task set to a new replacement task set. The original task set is terminated when the deployment is complete. Success of a deployment can be validated using Lambda functions that are referenced by the deployment. This provides the opportunity to rollback if necessary. You can use the new ECSService, ECSTarget, and ECSTaskSet data types in the updated SDK to create or retrieve an Amazon ECS deployment. -* `service/comprehendmedical`: Adds new service -* `service/ec2`: Updates service API and documentation - * With VPC sharing, you can now allow multiple accounts in the same AWS Organization to launch their application resources, like EC2 instances, RDS databases, and Redshift clusters into shared, centrally managed VPCs. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for blue/green deployment feature. Customers can now update their ECS services in a blue/green deployment pattern via using AWS CodeDeploy. -* `service/kinesisanalytics`: Updates service API and documentation - * Improvements to error messages, validations, and more to the Kinesis Data Analytics APIs. -* `service/kinesisanalyticsv2`: Adds new service -* `service/logs`: Updates service API and documentation - * Six new APIs added to support CloudWatch Logs Insights. The APIs are StartQuery, StopQuery, GetQueryResults, GetLogRecord, GetLogGroupFields, and DescribeQueries. -* `service/mediaconnect`: Adds new service -* `service/meteringmarketplace`: Updates service API, documentation, and paginators - * RegisterUsage operation added to AWS Marketplace Metering Service, allowing sellers to meter and entitle Docker container software use with AWS Marketplace. For details on integrating Docker containers with RegisterUsage see: https://docs.aws.amazon.com/marketplace/latest/userguide/entitlement-and-metering-for-paid-products.html -* `service/translate`: Updates service API and documentation - -Release v1.15.83 (2018-11-27) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Adds the following updates: 1. Transit Gateway helps easily scale connectivity across thousands of Amazon VPCs, AWS accounts, and on-premises networks. 2. Amazon EC2 A1 instance is a new Arm architecture based general purpose instance. 3. You can now launch the new Amazon EC2 compute optimized C5n instances that can utilize up to 100 Gbps of network bandwidth. -* `service/globalaccelerator`: Adds new service -* `service/greengrass`: Updates service API and documentation - * Support Greengrass Connectors and allow Lambda functions to run without Greengrass containers. -* `service/iot`: Updates service API and documentation - * As part of this release, we are extending capability of AWS IoT Rules Engine to support IoT Events rule action. The IoT Events rule action lets you send messages from IoT sensors and applications to IoT Events for pattern recognition and event detection. -* `service/iotanalytics`: Updates service API and documentation -* `service/kms`: Updates service API and documentation - * AWS Key Management Service (KMS) now enables customers to create and manage dedicated, single-tenant key stores in addition to the default KMS key store. These are known as custom key stores and are deployed using AWS CloudHSM clusters. Keys that are created in a KMS custom key store can be used like any other customer master key in KMS. -* `service/s3`: Updates service API and documentation - * Four new Amazon S3 Glacier features help you reduce your storage costs by making it even easier to build archival applications using the Amazon S3 Glacier storage class. S3 Object Lock enables customers to apply Write Once Read Many (WORM) protection to objects in S3 in order to prevent object deletion for a customer-defined retention period. S3 Inventory now supports fields for reporting on S3 Object Lock. "ObjectLockRetainUntilDate", "ObjectLockMode", and "ObjectLockLegalHoldStatus" are now available as valid optional fields. -* `service/sms`: Updates service API, documentation, and paginators - * In this release, AWS Server Migration Service (SMS) has added multi-server migration support to simplify the application migration process. Customers can migrate all their application-specific servers together as a single unit as opposed to moving individual server one at a time. The new functionality includes - 1. Ability to group on-premises servers into applications and application tiers. 2. Auto-generated CloudFormation Template and Stacks for launching migrated servers into EC2. 3. Ability to run post-launch configuration scripts to configure servers and applications in EC2. In order for SMS to launch servers into your AWS account using CloudFormation Templates, we have also updated the ServerMigrationServiceRole IAM policy to include appropriate permissions. Refer to Server Migration Service documentation for more details. - -### SDK Enhancements -* `service/s3/s3manager`: Generate Upload Manager's UploadInput structure ([#2296](https://github.com/aws/aws-sdk-go/pull/2296)) - * Updates the SDK's code generation to also generate the S3 Upload Manager's UploadInput structure type based on the modeled S3 PutObjectInput. This ensures parity between the two types, and the S3 manager does not fall behind the capabilities of PutObject. - -### SDK Bugs -* `private/model/api`: Fix model loading to not require docs model. ([#2303](https://github.com/aws/aws-sdk-go/pull/2303)) - * Fixes the SDK's model loading to not require that the docs model be present. This model isn't explicitly required. -* Fixup endpoint discovery unit test to be stable ([#2305](https://github.com/aws/aws-sdk-go/pull/2305)) - * Fixes the SDK's endpoint discovery async unit test to be stable, and produce consistent unit test results. - -Release v1.15.82 (2018-11-26) -=== - -### Service Client Updates -* `service/amplify`: Adds new service -* `service/datasync`: Adds new service -* `service/robomaker`: Adds new service -* `service/s3`: Updates service API, documentation, and examples - * The INTELLIGENT_TIERING storage class is designed to optimize storage costs by automatically moving data to the most cost effective storage access tier, without performance impact or operational overhead. This SDK release provides API support for this new storage class. -* `service/snowball`: Updates service API and documentation - * AWS announces the availability of AWS Snowball Edge Compute Optimized to run compute-intensive applications is disconnected and physically harsh environments. It comes with 52 vCPUs, 208GB memory, 8TB NVMe SSD, and 42TB S3-compatible storage to accelerate local processing and is well suited for use cases such as full motion video processing, deep IoT analytics, and continuous machine learning in bandwidth-constrained locations. It features new instances types called SBE-C instances that are available in eight sizes and multiple instances can be run on the device at the same time. Optionally, developers can choose the compute optimized device to include a GPU and use SBE-G instances for accelerating their application performance. -* `service/transfer`: Adds new service - * AWS Transfer for SFTP is a fully managed service that enables transfer of secure data over the internet into and out of Amazon S3. SFTP is deeply embedded in data exchange workflows across different industries such as financial services, healthcare, advertising, and retail, among others. - -Release v1.15.81 (2018-11-21) -=== - -### Service Client Updates -* `service/rekognition`: Updates service API and documentation - * This release updates the DetectFaces and IndexFaces operation. When the Attributes input parameter is set to ALL, the face location landmarks includes 5 new landmarks: upperJawlineLeft, midJawlineLeft, chinBottom, midJawlineRight, upperJawlineRight. - -Release v1.15.80 (2018-11-20) -=== - -### Service Client Updates -* `service/appsync`: Updates service API and documentation -* `service/autoscaling-plans`: Updates service API and documentation -* `service/cloudfront`: Adds new service - * With Origin Failover capability in CloudFront, you can setup two origins for your distributions - primary and secondary, such that your content is served from your secondary origin if CloudFront detects that your primary origin is unavailable. These origins can be any combination of AWS origins or non-AWS custom HTTP origins. For example, you can have two Amazon S3 buckets that serve as your origin that you independently upload your content to. If an object that CloudFront requests from your primary bucket is not present or if connection to your primary bucket times-out, CloudFront will request the object from your secondary bucket. So, you can configure CloudFront to trigger a failover in response to either HTTP 4xx or 5xx status codes. -* `service/devicefarm`: Updates service API and documentation - * Disabling device filters -* `service/medialive`: Updates service API and documentation - * You can now include the media playlist(s) from both pipelines in the HLS master manifest for seamless failover. -* `service/monitoring`: Updates service API and documentation - * Amazon CloudWatch now supports alarms on metric math expressions. -* `service/quicksight`: Adds new service - * Amazon QuickSight is a fully managed, serverless, cloud business intelligence system that allows you to extend data and insights to every user in your organization. The first release of APIs for Amazon QuickSight introduces embedding and user/group management capabilities. The get-dashboard-embed-url API allows you to obtain an authenticated dashboard URL that can be embedded in application domains whitelisted for QuickSight dashboard embedding. User APIs allow you to programmatically expand and manage your QuickSight deployments while group APIs allow easier permissions management for resources within QuickSight. -* `service/rds-data`: Adds new service -* `service/redshift`: Updates service documentation - * Documentation updates for redshift -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager Distributor helps you securely distribute and install software packages. -* `service/xray`: Updates service API and documentation - * Groups build upon X-Ray filter expressions to allow for fine tuning trace summaries and service graph results. You can configure groups by using the AWS X-Ray console or by using the CreateGroup API. The addition of groups has extended the available request fields to the GetServiceGraph API. You can now specify a group name or group ARN to retrieve its service graph. - -Release v1.15.79 (2018-11-20) -=== - -### Service Client Updates -* `service/batch`: Updates service API and documentation - * Adding multinode parallel jobs, placement group support for compute environments. -* `service/cloudformation`: Updates service API and documentation - * Use the CAPABILITY_AUTO_EXPAND capability to create or update a stack directly from a stack template that contains macros, without first reviewing the resulting changes in a change set first. -* `service/cloudtrail`: Updates service API and documentation - * This release supports creating a trail in CloudTrail that logs events for all AWS accounts in an organization in AWS Organizations. This helps enable you to define a uniform event logging strategy for your organization. An organization trail is applied automatically to each account in the organization and cannot be modified by member accounts. To learn more, please see the AWS CloudTrail User Guide https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html -* `service/config`: Updates service API and documentation -* `service/devicefarm`: Updates service API and documentation - * Customers can now schedule runs without a need to create a Device Pool. They also get realtime information on public device availability. -* `service/ec2`: Updates service API and documentation - * Adding AvailabilityZoneId to DescribeAvailabilityZones -* `service/iot`: Updates service API and documentation - * IoT now supports resource tagging and tag based access control for Billing Groups, Thing Groups, Thing Types, Jobs, and Security Profiles. IoT Billing Groups help you group devices to categorize and track your costs. AWS IoT Device Management also introduces three new features: 1. Dynamic thing groups. 2. Jobs dynamic rollouts. 3. Device connectivity indexing. Dynamic thing groups lets you to create a group of devices using a Fleet Indexing query. The devices in your group will be automatically added or removed when they match your specified query criteria. Jobs dynamic rollout allows you to configure an exponentially increasing rate of deployment for device updates and define failure criteria to cancel your job. Device connectivity indexing allows you to index your devices' lifecycle events to discover whether devices are connected or disconnected to AWS IoT. -* `service/lambda`: Updates service API and documentation - * AWS Lambda now supports python3.7 and the Kinesis Data Streams (KDS) enhanced fan-out and HTTP/2 data retrieval features for Kinesis event sources. -* `service/lightsail`: Updates service API - * Add Managed Database operations to OperationType enum. -* `service/mediaconvert`: Updates service API and documentation - * AWS Elemental MediaConvert SDK has added several features including support for: SPEKE full document encryption, up to 150 elements for input stitching, input and motion image insertion, AWS CLI path arguments in S3 links including special characters, AFD signaling, additional caption types, and client-side encrypted input files. -* `service/rds`: Updates service API and documentation - * This release adds a new parameter to specify VPC security groups for restore from DB snapshot, restore to point int time and create read replica operations. For more information, see Amazon RDS Documentation. -* `service/workdocs`: Updates service API and documentation - * With this release, clients can now use the GetResources API to fetch files and folders from the user's SharedWithMe collection. And also through this release, the existing DescribeActivities API has been enhanced to support additional filters such as the ActivityType and the ResourceId. -* `service/workspaces`: Updates service API and documentation - * Added new APIs to Modify and Describe WorkSpaces client properties for users in a directory. With the new APIs, you can enable/disable remember me option in WorkSpaces client for users in a directory. - -### SDK Bugs -* `internal/ini`: trimSpaces not trimming rhs properly (#2282) - * Fixes trimSpaces to behave properly by removing the necessary rhs spaces of a literal. - -Release v1.15.78 (2018-11-16) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/comprehend`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for additional Docker flags as Task Definition parameters. Customers can now configure their ECS Tasks to use pidMode (pid) and ipcMode (ipc) Docker flags. -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager Automation now allows you to execute and manage Automation workflows across multiple accounts and regions. -* `service/workspaces`: Updates service API and documentation - * Added new Bring Your Own License (BYOL) automation APIs. With the new APIs, you can list available management CIDR ranges for dedicated tenancy, enable your account for BYOL, describe BYOL status of your account, and import BYOL images. Added new APIs to also describe and delete WorkSpaces images. - -Release v1.15.77 (2018-11-16) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Adding queue phase and configurable queue timeout to CodeBuild. -* `service/comprehend`: Updates service API and documentation -* `service/directconnect`: Updates service API and documentation - * This release enables DirectConnect customers to have logical redundancy on virtual interfaces within supported DirectConnect locations. -* `service/dms`: Updates service API, documentation, and waiters - * Settings structures have been added to our DMS endpoint APIs to support Kinesis and Elasticsearch as targets. We are introducing the ability to configure custom DNS name servers on a replication instance as a beta feature. -* `service/ecs`: Updates service API, documentation, and examples - * In this release, Amazon ECS introduces multiple features. First, ECS now supports integration with Systems Manager Parameter Store for injecting runtime secrets. Second, ECS introduces support for resources tagging. Finally, ECS introduces a new ARN and ID Format for its resources, and provides new APIs for opt-in to the new formats. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iam`: Updates service API, documentation, and examples - * We are making it easier for you to manage your AWS Identity and Access Management (IAM) resources by enabling you to add tags to your IAM principals (users and roles). Adding tags on IAM principals will enable you to write fewer policies for permissions management and make policies easier to comprehend. Additionally, tags will also make it easier for you to grant access to AWS resources. -* `service/pinpoint`: Updates service API and documentation - * 1. With Amazon Pinpoint Voice, you can use text-to-speech technology to deliver personalized voice messages to your customers. Amazon Pinpoint Voice is a great way to deliver transactional messages -- such as one-time passwords and identity confirmations -- to customers. 2. Adding support for Campaign Event Triggers. With Campaign Event Triggers you can now schedule campaigns to execute based on incoming event data and target just the source of the event. -* `service/ram`: Adds new service -* `service/rds`: Updates service API, documentation, and paginators - * Introduces DB Instance Automated Backups for the MySQL, MariaDB, PostgreSQL, Oracle and Microsoft SQL Server database engines. You can now retain Amazon RDS automated backups (system snapshots and transaction logs) when you delete a database instance. This allows you to restore a deleted database instance to a specified point in time within the backup retention period even after it has been deleted, protecting you against accidental deletion of data. For more information, see Amazon RDS Documentation. -* `service/redshift`: Updates service API and documentation - * With this release, Redshift is providing API's for better snapshot management by supporting user defined automated snapshot schedules, retention periods for manual snapshots, and aggregate snapshot actions including batch deleting user snapshots, viewing account level snapshot storage metrics, and better filtering and sorting on the describe-cluster-snapshots API. Automated snapshots can be scheduled to be taken at a custom interval and the schedule created can be reused across clusters. Manual snapshot retention periods can be set at the cluster, snapshot, and cross-region-copy level. The retention period set on a manual snapshot indicates how many days the snapshot will be retained before being automatically deleted. -* `service/route53resolver`: Adds new service -* `service/s3`: Updates service API, documentation, and examples - * Add support for new S3 Block Public Access bucket-level APIs. The new Block Public Access settings allow bucket owners to prevent public access to S3 data via bucket/object ACLs or bucket policies. -* `service/s3control`: Adds new service - * Add support for new S3 Block Public Access account-level APIs. The Block Public Access settings allow account owners to prevent public access to S3 data via bucket/object ACLs or bucket policies. -* `service/sms-voice`: Adds new service -* `service/transcribe`: Updates service API and documentation - -Release v1.15.76 (2018-11-14) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * EC2 Auto Scaling now allows users to provision and automatically scale instances across purchase options (Spot, On-Demand, and RIs) and instance types in a single Auto Scaling group (ASG). -* `service/ec2`: Updates service API and documentation - * Amazon EC2 Fleet now supports a new request type "Instant" that you can use to provision capacity synchronously across instance types & purchase models and CreateFleet will return the instances launched in the API response. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediatailor`: Updates service API and documentation -* `service/resource-groups`: Updates service API and documentation -* `service/sagemaker`: Updates service API and documentation - * SageMaker now makes the final set of metrics published from training jobs available in the DescribeTrainingJob results. Automatic Model Tuning now supports warm start of hyperparameter tuning jobs. Notebook instances now support a larger number of instance types to include instances from the ml.t3, ml.m5, ml.c4, ml.c5 families. -* `service/servicecatalog`: Updates service API and documentation - * Adds support for Cloudformation StackSets in Service Catalog -* `service/sns`: Updates service API and documentation - * Added an optional request parameter, named Attributes, to the Amazon SNS CreateTopic API action. For more information, see the Amazon SNS API Reference (https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html). - -Release v1.15.75 (2018-11-13) -=== - -### Service Client Updates -* `service/budgets`: Updates service documentation - * Doc Update: 1. Available monthly-budgets maximal history data points from 12 to 13. 2. Added 'Amazon Elasticsearch' costfilters support. -* `service/chime`: Updates service API and documentation - * This release adds support in ListUsers API to filter the list by an email address. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service API and documentation - * Amazon Redshift provides the option to defer non-mandatory maintenance updates to a later date. - -Release v1.15.74 (2018-11-12) -=== - -### Service Client Updates -* `service/batch`: Updates service API and documentation - * Adding EC2 Launch Template support in AWS Batch Compute Environments. -* `service/budgets`: Updates service API and documentation - * 1. Added budget performance history, enabling you to see how well your budgets matched your actual costs and usage. 2. Added budget performance history, notification state, and last updated time, enabling you to see how well your budgets matched your actual costs and usage, how often your budget alerts triggered, and when your budget was last updated. -* `service/cloudformation`: Updates service API, documentation, and paginators - * The Drift Detection feature enables customers to detect whether a stack's actual configuration differs, or has drifted, from its expected configuration as defined within AWS CloudFormation. -* `service/codepipeline`: Updates service API and documentation - * Add support for cross-region pipeline with accompanying definitions as needed in the AWS CodePipeline API Guide. -* `service/firehose`: Updates service API and documentation - * With this release, Amazon Kinesis Data Firehose allows you to enable/disable server-side encryption(SSE) for your delivery streams ensuring encryption of data at rest. For technical documentation, look at https://docs.aws.amazon.com/firehose/latest/dev/encryption.html -* `service/polly`: Updates service API - * Amazon Polly adds new female voices: Italian - Bianca, Castilian Spanish - Lucia and new language: Mexican Spanish with new female voice - Mia. -* `service/rds`: Updates service API and documentation - * API Update for RDS: this update enables Custom Endpoints, a new feature compatible with Aurora Mysql, Aurora PostgreSQL and Neptune that allows users to configure a customizable endpoint that will provide access to their instances in a cluster. - -### SDK Bugs -* `internal/ini`: allowing LHS of equal expression to contain spaces (#2265) - * Fixes a backward compatibility issue where LHS of equal expr could contain spaces - -Release v1.15.73 (2018-11-09) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediapackage`: Updates service API and documentation - * As a part of SPEKE DRM encryption, MediaPackage now supports encrypted content keys. You can enable this enhanced content protection in an OriginEndpoint's encryption settings. When this is enabled, MediaPackage indicates to the key server that it requires an encrypted response. To use this, your DRM key provider must support content key encryption. For details on this feature, see the AWS MediaPackage User Guide at https://docs.aws.amazon.com/mediapackage/latest/ug/what-is.html. - -Release v1.15.72 (2018-11-08) -=== - -### Service Client Updates -* `service/dlm`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/events`: Updates service documentation - * Documentation updates for events -* `service/medialive`: Updates service API and documentation - * You can now switch a live channel between preconfigured inputs. This means assigned inputs for a running channel can be changed according to a defined schedule. You can also use MP4 files as inputs. - -Release v1.15.71 (2018-11-07) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/dms`: Updates service waiters - * Update the DMS TestConnectionSucceeds waiter. -* `service/ec2`: Updates service API and documentation - * VM Import/Export now supports generating encrypted EBS snapshots, as well as AMIs backed by encrypted EBS snapshots during the import process. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.15.70 (2018-11-06) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * AWS WAF integration with APIGW. Changes for adding webAclArn as a part of Stage output. When the user calls a get-stage or get-stages, webAclArn will also be returned as a part of the output. -* `service/codebuild`: Updates service documentation - * Documentation updates for codebuild -* `service/ec2`: Updates service API and paginators - * You can now launch the new Amazon EC2 memory optimized R5a and general purpose M5a instances families that feature AMD EPYC processors. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/pinpoint`: Updates service API and documentation - * This update adds the ability to send transactional email by using the SendMessage API. Transactional emails are emails that you send directly to specific email addresses. Unlike campaign-based email that you send from Amazon Pinpoint, you don't have to create segments and campaigns in order to send transactional email. -* `service/pinpoint-email`: Adds new service -* `service/waf-regional`: Updates service API and documentation - -Release v1.15.69 (2018-11-05) -=== - -### Service Client Updates -* `service/eks`: Updates service waiters -* `service/serverlessrepo`: Updates service API and documentation - -Release v1.15.68 (2018-11-02) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * ListObjectParents API now supports a bool parameter IncludeAllLinksToEachParent, which if set to true, will return a ParentLinks list instead of a Parents map; BatchRead API now supports ListObjectParents operation. -* `service/rekognition`: Updates service API and documentation - * This release updates the DetectLabels operation. Bounding boxes are now returned for certain objects, a hierarchical taxonomy is now available for labels, and you can now get the version of the detection model used for detection. - -### SDK Bugs -* `internal/ini`: profile names did not allow for ':' character (#2247) - * Fixes an issue where profile names would return an error if the name contained a ':' - -Release v1.15.67 (2018-11-01) -=== - -### Service Client Updates -* `service/servicecatalog`: Updates service API, documentation, and paginators - * Service Catalog integration with AWS Organizations, enables customers to more easily create and manage a portfolio of IT services across an organization. Administrators can now take advantage of the AWS account structure and account groupings configured in AWS Organizations to share Service Catalog Portfolios increasing agility and reducing risk. With this integration the admin user will leverage the trust relationship that exists within the accounts of the Organization to share portfolios to the entire Organization, a specific Organizational Unit or a specific Account. - -### SDK Bugs -* `internal/ini`: removing // comments (#2240) - * removes // comments since that was never supported previously. - -Release v1.15.66 (2018-10-31) -=== - -### Service Client Updates -* `service/config`: Updates service API -* `service/greengrass`: Updates service API and documentation - * Greengrass APIs now support bulk deployment operations, and APIs that list definition versions now support pagination. -* `service/mediastore-data`: Updates service API and documentation -* `service/secretsmanager`: Updates service documentation - * Documentation updates for AWS Secrets Manager. - -Release v1.15.65 (2018-10-30) -=== - -### Service Client Updates -* `service/chime`: Adds new service - * This is the initial release for the Amazon Chime AWS SDK. In this release, Amazon Chime adds support for administrative actions on users and accounts. API Documentation is also updated on https://docs.aws.amazon.com/chime/index.html -* `service/dms`: Updates service waiters - * Add waiters for TestConnectionSucceeds, EndpointDeleted, ReplicationInstanceAvailable, ReplicationInstanceDeleted, ReplicationTaskReady, ReplicationTaskStopped, ReplicationTaskRunning and ReplicationTaskDeleted. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * This release adds the listener connection endpoint for SQL Server Always On to the list of fields returned when performing a describe-db-instances operation. - -Release v1.15.64 (2018-10-26) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service documentation -* `service/sagemaker`: Updates service API and documentation - * SageMaker notebook instances can now have a volume size configured. -* `service/ssm`: Updates service API and documentation - * Compliance Severity feature release for State Manager. Users now have the ability to select compliance severity to their association in state manager console or CLI. - -Release v1.15.63 (2018-10-25) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * As part of this release we are introducing EC2 On-Demand Capacity Reservations. With On-Demand Capacity Reservations, customers can reserve the exact EC2 capacity they need, and can keep it only for as long as they need it. - -Release v1.15.62 (2018-10-24) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/codestar`: Updates service API and documentation - * This release lets you create projects from source code and a toolchain definition that you provide. - -Release v1.15.61 (2018-10-23) -=== - -### Service Client Updates -* `service/ec2`: Updates service API, documentation, and examples - * Provides customers the ability to Bring Your Own IP (BYOIP) prefix. You can bring part or all of your public IPv4 address range from your on-premises network to your AWS account. You continue to own the address range, but AWS advertises it on the internet. - -Release v1.15.60 (2018-10-22) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/inspector`: Updates service API and documentation - * Finding will be decorated with ec2 related metadata -* `service/shield`: Updates service API and documentation - * AWS Shield Advanced API introduced a new service-specific AccessDeniedException which will be thrown when accessing individual attack information without sufficient permission. - -Release v1.15.59 (2018-10-19) -=== - -### Service Client Updates -* `service/ssm`: Updates service API and documentation - * Rate Control feature release for State Manager. Users now have the ability to apply rate control parameters similar to run command to their association in state manager console or CLI. -* `service/workspaces`: Updates service API - * Added support for PowerPro and GraphicsPro WorkSpaces bundles. - -### SDK Enhancements -* `aws/request`: Add private ini package (#2210) - * Get rids of go-ini dependency in favor of `internal/ini` package. - -Release v1.15.58 (2018-10-18) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update adds support for creating, managing, and deleting users in the AppStream 2.0 user pool. -* `service/medialive`: Updates service API and documentation - * This release allows you to now turn on Quality-Defined Variable Bitrate (QVBR) encoding for your AWS Elemental MediaLive channels. You can now deliver a consistently high-quality video viewing experience while reducing overall distribution bitrates by using Quality-Defined Variable Bitrate (QVBR) encoding with AWS Elemental MediaLive. QVBR is a video compression technique that automatically adjusts output bitrates to the complexity of source content and only use the bits required to maintain a defined level of quality. This means using QVBR encoding, you can save on distribution cost, while maintaining, or increasing video quality for your viewers. -* `service/route53`: Updates service API and documentation - * This change allows customers to disable health checks. - -Release v1.15.57 (2018-10-17) -=== - -### Service Client Updates -* `service/apigateway`: Updates service documentation - * Documentation updates for API Gateway -* `service/events`: Updates service API and documentation - * AWS Events - AWS Organizations Support in Event-Bus Policies. This release introduces a new parameter in the PutPermission API named Condition. Using the Condition parameter, customers can allow one or more AWS Organizations to access their CloudWatch Events Event-Bus resource. - -Release v1.15.56 (2018-10-16) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * New Glue APIs for creating, updating, reading and deleting Data Catalog resource-based policies. -* `service/lightsail`: Updates service API and documentation - * Adds support for Lightsail managed databases. -* `service/resource-groups`: Updates service API and documentation - -Release v1.15.55 (2018-10-15) -=== - -### Service Client Updates -* `service/lambda`: Updates service API and documentation - * Documentation updates for lambda -* `service/rds`: Updates service API and documentation - * This release adds a new parameter to specify the DB instance or cluster parameter group for restore from DB snapshot and restore to point int time operations. For more information, see Amazon RDS Documentation. -* `service/servicecatalog`: Updates service API, documentation, and paginators - * AWS Service Catalog enables you to reduce administrative maintenance and end-user training while adhering to compliance and security measures. With service actions, you as the administrator can enable end users to perform operational tasks, troubleshoot issues, run approved commands, or request permissions within Service Catalog. Service actions are defined using AWS Systems Manager documents, where you have access to pre-defined actions that implement AWS best practices, such asEC2 stop and reboot, as well as the ability to define custom actions. - -Release v1.15.54 (2018-10-12) -=== - -### Service Client Updates -* `service/cloudtrail`: Updates service API and documentation - * The LookupEvents API now supports two new attribute keys: ReadOnly and AccessKeyId - -### SDK Enhancements -* `aws/session`: Add support for credential source(#2201) - * Allows for shared config file to contain `credential_source` with any of the given values `EcsContainer`, `Environment` or `Ec2InstanceMetadata` - -Release v1.15.53 (2018-10-11) -=== - -### Service Client Updates -* `service/athena`: Updates service API and documentation - * 1. GetQueryExecution API changes to return statementType of a submitted Athena query. 2. GetQueryResults API changes to return the number of rows added to a table when a CTAS query is executed. -* `service/directconnect`: Updates service API and documentation - * This release adds support for Jumbo Frames over AWS Direct Connect. You can now set MTU value when creating new virtual interfaces. This release also includes a new API to modify MTU value of existing virtual interfaces. -* `service/ec2`: Updates service API - * You can now launch the smaller-sized G3 instance called g3s.xlarge. G3s.xlarge provides 4 vCPU, 30.5 GB RAM and a NVIDIA Tesla M60 GPU. It is ideal for remote workstations, engineering and architectural applications, and 3D visualizations and rendering for visual effects. -* `service/mediaconvert`: Updates service paginators - * Added Paginators for all the MediaConvert list operations -* `service/transcribe`: Updates service API and documentation - -Release v1.15.52 (2018-10-10) -=== - -### Service Client Updates -* `service/comprehend`: Updates service API -* `service/es`: Updates service API and documentation - * Amazon Elasticsearch Service now supports customer-scheduled service software updates. When new service software becomes available, you can request an update to your domain and benefit from new features more quickly. If you take no action, we update the service software automatically after a certain time frame. -* `service/transcribe`: Updates service API and documentation - -Release v1.15.51 (2018-10-09) -=== - -### Service Client Updates -* `service/ssm`: Updates service API and documentation - * Adds StartDate, EndDate, and ScheduleTimezone to CreateMaintenanceWindow and UpdateMaintenanceWindow; Adds NextExecutionTime to GetMaintenanceWindow and DescribeMaintenanceWindows; Adds CancelMaintenanceWindowExecution, DescribeMaintenanceWindowSchedule and DescribeMaintenanceWindowsForTarget APIs. - -Release v1.15.50 (2018-10-08) -=== - -### Service Client Updates -* `service/iot`: Updates service API and documentation - * We are releasing job execution timeout functionalities to customers. Customer now can set job execution timeout on the job level when creating a job. -* `service/iot-jobs-data`: Updates service API and documentation - -Release v1.15.49 (2018-10-05) -=== - -### Service Client Updates -* `service/ds`: Updates service API and documentation - * SDK changes to create a new type of trust for active directory - -Release v1.15.48 (2018-10-04) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Adding support for multi-value parameters in TestInvokeMethod and TestInvokeAuthorizer. -* `service/codebuild`: Updates service API and documentation - * Add resolved source version field in build output -* `service/ssm`: Updates service API and documentation - * Adds RejectedPatchesAction to baseline to enable stricted validation of the rejected Patches List ; Add InstalledRejected and InstallOverrideList to compliance reporting -* `service/storagegateway`: Updates service API and documentation - * AWS Storage Gateway now enables you to specify folders and subfolders when you update your file gateway's view of your S3 objects using the Refresh Cache API. - -Release v1.15.47 (2018-10-02) -=== - -### Service Client Updates -* `service/sagemaker`: Updates service waiters - * Waiter for SageMaker Batch Transform Jobs. -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -### SDK Enhancements -* `aws/config`: fix typo in Config struct documentation (#2169) - * fix typo in Config struct documentation in aws-sdk-go/aws/config.go -* `internal/csm`: Add region to api call metrics (#2175) -* `private/model/api`: Use modeled service signing version in code generation (#2162) - * Updates the SDK's code generate to make use of the model's service signature version when generating the client for the service. This allows the SDK to generate a client using the correct signature version, e.g v4 vs s3v4 without the need for additional customizations. - -### SDK Bugs -* `service/cloudfront/sign`: Do not Escape HTML when encode the cloudfront sign policy (#2164) - * Fixes the signer escaping HTML elements `<`, `>`, and `&` in the signature policy incorrectly. Allows use of multiple query parameters in the URL to be signed. - * Fixes #2163 - -Release v1.15.46 (2018-10-01) -=== - -### Service Client Updates -* `service/guardduty`: Updates service API and documentation - * Support optional FindingPublishingFrequency parameter in CreateDetector and UpdateDetector operations, and ClientToken on Create* operations -* `service/rekognition`: Updates service documentation - * Documentation updates for Amazon Rekognition - -Release v1.15.45 (2018-09-28) -=== - -### Service Client Updates -* `service/codestar`: Updates service API and documentation - * This release enables tagging CodeStar Projects at creation. The CreateProject API now includes optional tags parameter. -* `service/ec2`: Updates service API - * You can now use EC2 High Memory instances with 6 TiB memory (u-6tb1.metal), 9 TiB memory (u-9tb1.metal), and 12 TiB memory (u-12tb1.metal), which are ideal for running large in-memory databases, including production deployments of SAP HANA. These instances offer 448 logical processors, where each logical processor is a hyperthread on 224 cores. These instance deliver high networking throughput and lower latency with up to 25 Gbps of aggregate network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking. These instances are EBS-Optimized by default, and support encrypted and unencrypted EBS volumes. This instance is only available in host-tenancy. You will need an EC2 Dedicated Host for this instance type to launch an instance. - -Release v1.15.44 (2018-09-27) -=== - -### Service Client Updates -* `service/apigateway`: Updates service documentation - * Adding support for OpenAPI 3.0 import and export. -* `service/codecommit`: Updates service API and documentation - * This release adds API support for getting the contents of a file, getting the contents of a folder, and for deleting a file in an AWS CodeCommit repository. -* `service/mq`: Updates service API and documentation - * Amazon MQ supports ActiveMQ 5.15.6, in addition to 5.15.0. Automatic minor version upgrades can be toggled. Updated the documentation. - -Release v1.15.43 (2018-09-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * AWS Glue now supports data encryption at rest for ETL jobs and development endpoints. With encryption enabled, when you run ETL jobs, or development endpoints, Glue will use AWS KMS keys to write encrypted data at rest. You can also encrypt the metadata stored in the Glue Data Catalog using keys that you manage with AWS KMS. Additionally, you can use AWS KMS keys to encrypt the logs generated by crawlers and ETL jobs as well as encrypt ETL job bookmarks. Encryption settings for Glue crawlers, ETL jobs, and development endpoints can be configured using the security configurations in Glue. Glue Data Catalog encryption can be enabled via the settings for the Glue Data Catalog. -* `service/opsworkscm`: Updates service API and documentation - * This release introduces a new API called ExportServerEngineAttribute to Opsworks-CM. You can use this API call to export engine specific attributes like the UserData script used for unattended bootstrapping of new nodes that connect to the server. -* `service/rds`: Updates service API and documentation - * This release includes Deletion Protection for RDS databases. -* `service/sqs`: Updates service API and documentation - * Documentation updates for Amazon SQS. - -### SDK Enhancements -* `private/protocol/restjson/restjson`: Use json.Decoder to decrease memory allocation (#2141) - * Update RESTJSON protocol unmarshaler to use json.Decoder instead of ioutil.ReadAll to reduce allocations. -* `private/protocol/jsonrpc/jsonrpc`: Use json.Decoder to decrease memory allocation (#2142) - * Update JSONPRC protocol unmarshaler to use json.Decoder instead of ioutil.ReadAll to reduce allocations. - -Release v1.15.42 (2018-09-25) -=== - -### Service Client Updates -* `service/cloudfront`: Updates service documentation - * Documentation updates for cloudfront -* `service/ds`: Updates service API and documentation - * API changes related to launch of cross account for Directory Service. -* `service/ec2`: Updates service API and documentation - * Add pagination support for ec2.describe-route-tables API. - -Release v1.15.41 (2018-09-24) -=== - -### Service Client Updates -* `service/connect`: Updates service API, documentation, and paginators -* `service/rds`: Updates service API and documentation - * Adds DB engine version requirements for option group option settings, and specifies if an option setting requires a value. - -Release v1.15.40 (2018-09-21) -=== - -### Service Client Updates -* `service/mediaconvert`: Updates service API and documentation - * To offer lower prices for predictable, non-urgent workloads, we propose the concept of Reserved Transcode pricing. Reserved Transcode pricing Reserved Transcoding pricing would offer the customer access to a fixed parallel processing capacity for a fixed monthly rate. This capacity would be stated in terms of number of Reserved Transcode Slots (RTSs). One RTS would be able to process one job at a time for a fixed monthly fee. - -Release v1.15.39 (2018-09-20) -=== - -### Service Client Updates -* `service/ds`: Updates service API and documentation - * Added CreateLogSubscription, DeleteLogSubscription, and ListLogSubscriptions APIs for Microsoft AD. Customers can now opt in to have Windows security event logs from the domain controllers forwarded to a log group in their account. -* `service/ec2`: Updates service API - * You can now launch f1.4xlarge, a new instance size within the existing f1 family which provides two Xilinx Virtex Field Programmable Arrays (FPGAs) for acceleration. FPGA acceleration provide additional performance and time sensitivity for specialized accelerated workloads such as clinical genomics and real-time video processing. F1.4xlarge instances are available in the US East (N. Virginia), US West (Oregon), GovCloud (US), and EU West (Dublin) AWS Regions. -* `service/rds`: Updates service API and documentation - * This launch enables RDS start-db-cluster and stop-db-cluster. Stopping and starting Amazon Aurora clusters helps you manage costs for development and test environments. You can temporarily stop all the DB instances in your cluster, instead of setting up and tearing down all the DB instances each time that you use the cluster. - -Release v1.15.38 (2018-09-19) -=== - -### Service Client Updates -* `service/monitoring`: Updates service API and documentation - * Amazon CloudWatch adds the ability to request png image snapshots of metric widgets using the GetMetricWidgetImage API. -* `service/organizations`: Updates service API and documentation - * Introducing a new exception - AccountOwnerNotVerifiedException which will be returned for InviteAccountToOrganization call for unverified accounts. -* `service/s3`: Updates service API and documentation - * S3 Cross Region Replication now allows customers to use S3 object tags to filter the scope of replication. By using S3 object tags, customers can identify individual objects for replication across AWS Regions for compliance and data protection. Cross Region Replication for S3 enables automatic and asynchronous replication of objects to another AWS Region, and with this release customers can replicate at a bucket level, prefix level or by using object tags. - -Release v1.15.37 (2018-09-18) -=== - -### Service Client Updates -* `service/es`: Updates service API and documentation - * Amazon Elasticsearch Service adds support for node-to-node encryption for new domains running Elasticsearch version 6.0 and above -* `service/rekognition`: Updates service API and documentation - * This release updates the Amazon Rekognition IndexFaces API operation. It introduces a QualityFilter parameter that allows you to automatically filter out detected faces that are deemed to be of low quality by Amazon Rekognition. The quality bar is based on a variety of common use cases. You can filter low-quality detected faces by setting QualityFilter to AUTO, which is also the default setting. To index all detected faces regardless of quality, you can specify NONE. This release also provides a MaxFaces parameter that is useful when you want to only index the most prominent and largest faces in an image and don't want to index other faces detected in the image, such as smaller faces belonging to people standing in the background. - -Release v1.15.36 (2018-09-17) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Support build logs configuration. -* `service/ec2`: Updates service API and documentation - * Added support for customers to tag EC2 Dedicated Hosts on creation. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for additional Docker flags as Task Definition parameters. Customers can now configure their ECS Tasks to use systemControls (sysctl), pseudoTerminal (tty), and interactive (i) Docker flags. -* `service/elasticache`: Updates service API and documentation - * ElastiCache for Redis added support for adding and removing read-replicas from any cluster with no cluster downtime, Shard naming: ElastiCache for Redis customers have the option of allowing ElastiCache to create names for their node groups (shards) or generating their own node group names. For more information, see https:// docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_NodeGroupConfiguration.html, ShardsToRetain: When reducing the number of node groups (shards) in an ElastiCache for Redis (cluster mode enabled) you have the option of specifying which node groups to retain or which node groups to remove. For more information, see https:// docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyReplicationGroupShardConfiguration.html, ReservationARN: ReservedNode includes an ARN, ReservationARN, member which identifies the reserved node. For more information, see https:// docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ReservedCacheNode.html -* `service/elastictranscoder`: Updates service API, documentation, and paginators - * Added support for MP2 container -* `service/monitoring`: Updates service API and documentation - * Amazon CloudWatch adds the ability to publish values and counts using PutMetricData -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -Release v1.15.35 (2018-09-13) -=== - -### Service Client Updates -* `service/polly`: Updates service API and documentation - * Amazon Polly adds Mandarin Chinese language support with new female voice - "Zhiyu" - -Release v1.15.34 (2018-09-12) -=== - -### Service Client Updates -* `service/connect`: Updates service API and documentation -* `service/ec2`: Updates service API, documentation, and paginators - * Pagination Support for DescribeNetworkInterfaces API -* `service/email`: Updates service documentation - * Documentation updates for Amazon Simple Email Service -* `service/fms`: Updates service API and documentation - -Release v1.15.33 (2018-09-11) -=== - -### Service Client Updates -* `service/opsworkscm`: Updates service documentation - * Documentation updates for opsworkscm -* `service/ssm`: Updates service API and documentation - * Session Manager is a fully managed AWS Systems Manager capability that provides interactive one-click access to Amazon EC2 Linux and Windows instances. - -Release v1.15.32 (2018-09-10) -=== - -### Service Client Updates -* `service/cloudhsmv2`: Updates service API and documentation - * With this release, we are adding 2 new APIs. DeleteBackup deletes a specified AWS CloudHSM backup. A backup can be restored up to 7 days after the DeleteBackup request. During this 7-day period, the backup will be in state PENDING_DELETION. Backups can be restored using the RestoreBackup API, which will move the backup from state PENDING_DELETION back to ACTIVE. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service API and documentation - * Adding support to Redshift to change the encryption type after cluster creation completes. - -Release v1.15.31 (2018-09-07) -=== - -### Service Client Updates -* `service/config`: Updates service API and documentation -* `service/logs`: Updates service API and documentation - * * Adding a log prefix parameter for filter log events API and minor updates to the documentation - -### SDK Enhancements -* `private/protocol/json/jsonutil`: Use json.Decoder to decrease memory allocation ([#2115](https://github.com/aws/aws-sdk-go/pull/2115)) - * Updates the SDK's JSON protocol marshaler to use `json.Decoder` instead of `ioutil.ReadAll`. This reduces the memory unmarshaling JSON payloads by about 50%. - * Fix [#2114](https://github.com/aws/aws-sdk-go/pull/2114) - -Release v1.15.29 (2018-09-06) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Add support for Active X-Ray with API Gateway -* `service/codecommit`: Updates service API and documentation - * This release adds additional optional fields to the pull request APIs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediaconvert`: Updates service API and documentation - * This release adds support for Cost Allocation through tagging and also enables adding, editing, and removal of tags from the MediaConvert console. - -### SDK Enhancements -* `private/protocol`: Serialization errors will now be wrapped in `awserr.RequestFailure` types ([#2135](https://github.com/aws/aws-sdk-go/pull/2135)) - * Updates the SDK protocol unmarshaling to handle the `SerializationError` as a request failure allowing for inspection of `requestID`s and status codes. - -Release v1.15.28 (2018-09-05) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Added support for enabling persistent application settings for a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session. -* `service/dynamodb`: Updates service API and documentation - * New feature for Amazon DynamoDB. -* `service/elasticloadbalancing`: Updates service API and documentation -* `service/rds`: Updates service documentation - * Fix broken links in the RDS CLI Reference to the Aurora User Guide -* `service/s3`: Updates service API, documentation, and examples - * Parquet input format support added for the SelectObjectContent API - -### SDK Enhancements -* `private/model/api`: Add "Deprecated" to deprecated API operation and type doc strings ([#2129](https://github.com/aws/aws-sdk-go/pull/2129)) - * Updates the SDK's code generation to include `Deprecated` in the documentation string for API operations and types that are depercated by a service. - * Related to [golang/go#10909](https://github.com/golang/go/issues/10909) - * https://blog.golang.org/godoc-documenting-go-code - -### SDK Bugs -* `service/s3/s3manager`: Fix Download Manager with iterator docs ([#2131](https://github.com/aws/aws-sdk-go/pull/2131)) - * Fixes the S3 Download manager's DownloadWithIterator documentation example. - * Fixes [#1824](https://github.com/aws/aws-sdk-go/issues/1824) - -Release v1.15.27 (2018-09-04) -=== - -### Service Client Updates -* `service/rds`: Updates service documentation - * Updating cross references for the new Aurora User Guide. -* `service/rekognition`: Updates service API and documentation - * This release introduces a new API called DescribeCollection to Amazon Rekognition. You can use DescribeCollection to get information about an existing face collection. Given the ID for a face collection, DescribeCollection returns the following information: the number of faces indexed into the collection, the version of the face detection model used by the collection, the Amazon Resource Name (ARN) of the collection and the creation date/time of the collection. - -Release v1.15.26 (2018-08-31) -=== - -### Service Client Updates -* `service/eks`: Updates service API and documentation -* `service/waf`: Updates service API and documentation - * This change includes support for the WAF FullLogging feature through which Customers will have access to all the logs of requests that are inspected by a WAF WebACL. The new APIs allow Customers to manage association of a WebACL with one or more supported "LogDestination" and redact any request fields from the logs. -* `service/waf-regional`: Updates service API and documentation - -Release v1.15.25 (2018-08-30) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Support multiple sources and artifacts for CodeBuild projects. -* `service/sagemaker`: Updates service API and documentation - * VolumeKmsKeyId now available in Batch Transform Job - -Release v1.15.24 (2018-08-29) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * AWS Glue now supports data encryption at rest for ETL jobs and development endpoints. With encryption enabled, when you run ETL jobs, or development endpoints, Glue will use AWS KMS keys to write encrypted data at rest. You can also encrypt the metadata stored in the Glue Data Catalog using keys that you manage with AWS KMS. Additionally, you can use AWS KMS keys to encrypt the logs generated by crawlers and ETL jobs as well as encrypt ETL job bookmarks. Encryption settings for Glue crawlers, ETL jobs, and development endpoints can be configured using the security configurations in Glue. Glue Data Catalog encryption can be enabled via the settings for the Glue Data Catalog. -* `service/mediapackage`: Updates service API and documentation - * MediaPackage now provides input redundancy. Channels have two ingest endpoints that can receive input from encoders. OriginEndpoints pick one of the inputs receiving content for playback and automatically switch to the other input if the active input stops receiving content. Refer to the User Guide (https://docs.aws.amazon.com/mediapackage/latest/ug/what-is.html) for more details on this feature. -* `service/runtime.sagemaker`: Updates service API and documentation - -Release v1.15.23 (2018-08-28) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * New Glue APIs for creating, updating, reading and deleting Data Catalog resource-based policies. -* `service/xray`: Updates service API and documentation - * Support for new APIs that enable management of sampling rules. - -Release v1.15.22 (2018-08-27) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API and documentation - * This release adds support to create a Stream and Code signing for Amazon FreeRTOS job along with Over-the-air updates. -* `service/iotanalytics`: Updates service API, documentation, and paginators -* `service/redshift`: Updates service documentation - * Documentation updates for redshift -* `service/signer`: Adds new service - * AWS Signer is a new feature that allows Amazon FreeRTOS (AFR) Over The Air (OTA) customers to cryptographically sign code using code-signing certificates managed by AWS Certificate Manager. - -Release v1.15.21 (2018-08-25) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * AWS Glue now supports data encryption at rest for ETL jobs and development endpoints. With encryption enabled, when you run ETL jobs, or development endpoints, Glue will use AWS KMS keys to write encrypted data at rest. You can also encrypt the metadata stored in the Glue Data Catalog using keys that you manage with AWS KMS. Additionally, you can use AWS KMS keys to encrypt the logs generated by crawlers and ETL jobs as well as encrypt ETL job bookmarks. Encryption settings for Glue crawlers, ETL jobs, and development endpoints can be configured using the security configurations in Glue. Glue Data Catalog encryption can be enabled via the settings for the Glue Data Catalog. - -Release v1.15.20 (2018-08-24) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/events`: Updates service API and documentation - * Added Fargate and NetworkConfiguration support to EcsParameters. - -Release v1.15.19 (2018-08-23) -=== - -### Service Client Updates -* `service/iot`: Updates service API and documentation - * This release adds support for IoT Thing Group Indexing and Searching functionality. -* `service/iotanalytics`: Updates service API and documentation -* `service/lex-models`: Updates service API -* `service/medialive`: Updates service API, documentation, and paginators - * Adds two APIs for working with Channel Schedules: BatchUpdateSchedule and DescribeSchedule. These APIs allow scheduling actions for SCTE-35 message insertion and for static image overlays. -* `service/rekognition`: Updates service API, documentation, and examples - * This release introduces a new API called DescribeCollection to Amazon Rekognition. You can use DescribeCollection to get information about an existing face collection. Given the ID for a face collection, DescribeCollection returns the following information: the number of faces indexed into the collection, the version of the face detection model used by the collection, the Amazon Resource Name (ARN) of the collection and the creation date/time of the collection. - -Release v1.15.18 (2018-08-22) -=== - -### Service Client Updates -* `service/snowball`: Updates service API - * Snowball job states allow customers to track the status of the Snowball job. We are launching a new Snowball job state "WithSortingFacility"! When customer returns the Snowball to AWS, the device first goes to a sorting facility before it reaches an AWS data center. Many customers have requested us to add a new state to reflect the presence of the device at the sorting facility for better tracking. Today when a customer returns the Snowball, the state first changes from "InTransitToAWS" to "WithAWS". With the addition of new state, the device will move from "InTransitToAWS" to "WithAWSSortingFacility", and then to "WithAWS". There are no other changes to the API at this time besides adding this new state. - -Release v1.15.17 (2018-08-21) -=== - -### Service Client Updates -* `service/dlm`: Updates service documentation -* `service/ec2`: Updates service API - * Added support for T3 Instance type in EC2. To learn more about T3 instances, please see https://aws.amazon.com/ec2/instance-types/t3/ -* `service/elasticbeanstalk`: Updates service API, documentation, and examples - * Elastic Beanstalk adds the "Privileged" field to the "CPUUtilization" type, to support enhanced health reporting in Windows environments. -* `service/rds`: Updates service paginators - * Adds a paginator for the DescribeDBClusters operation. - -Release v1.15.16 (2018-08-20) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service API and documentation - * Added SSESpecification block to update-table command which allows users to modify table Server-Side Encryption. Added two new fields (SSEType and KMSMasterKeyId) to SSESpecification block used by create-table and update-table commands. Added new SSEDescription Status value UPDATING. -* `service/mediaconvert`: Updates service API - * This release fixes backward-incompatible changes from a previous release. That previous release changed non-required job settings to required, which prevented jobs and job templates from merging correctly. The current change removes validation of required settings from the SDK and instead centralizes the validation in the service API. For information on required settings, see the Resources chapter of the AWS Elemental MediaConvert API Reference https://docs.aws.amazon.com/mediaconvert/latest/apireference/resources.html - -Release v1.15.15 (2018-08-17) -=== - -### Service Client Updates -* `service/dax`: Updates service API - * DAX CreateClusterRequest is updated to include IamRoleArn as a required request parameter. -* `service/sagemaker`: Updates service API and documentation - * Added an optional boolean parameter, 'DisassociateLifecycleConfig', to the UpdateNotebookInstance operation. When set to true, the lifecycle configuration associated with the notebook instance will be removed, allowing a new one to be set via a new 'LifecycleConfigName' parameter. -* `service/secretsmanager`: Updates service documentation - * Documentation updates for Secrets Manager - -Release v1.15.14 (2018-08-16) -=== - -### Service Client Updates -* `service/discovery`: Updates service API, documentation, and paginators - * The Application Discovery Service's Continuous Export APIs allow you to analyze your on-premises server inventory data, including system performance and network dependencies, in Amazon Athena. -* `service/ec2`: Updates service API - * The 'Attribute' parameter DescribeVolumeAttribute request has been marked as required - the API has always required this parameter, but up until now this wasn't reflected appropriately in the SDK. -* `service/mediaconvert`: Updates service API and documentation - * Added WriteSegmentTimelineInRepresentation option for Dash Outputs -* `service/redshift`: Updates service API and documentation - * You can now resize your Amazon Redshift cluster quickly. With the new ResizeCluster action, your cluster is available for read and write operations within minutes -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager Inventory now supports groups to quickly see a count of which managed instances are and arent configured to collect one or more Inventory types - -Release v1.15.13 (2018-08-15) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * Support for running tests in a custom environment with live logs/video streaming, full test features parity and reduction in overall test execution time. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.15.12 (2018-08-14) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Add batch operations for creating/updating and deleting scheduled scaling actions. -* `service/cloudfront`: Adds new service - * Lambda@Edge Now Provides You Access to the Request Body for HTTP POST/PUT Processing. With this feature, you can now offload more origin logic to the edge and improve end-user latency. Developers typically use Web/HTML forms or Web Beacons/Bugs as a mechanism to collect data from the end users and then process that data at their origins servers. For example, if you are collecting end user behavior data through a web beacon on your website, you can use this feature to access the user behavior data and directly log it to an Amazon Kinesis Firehose endpoint from the Lambda function, thereby simplifying your origin infrastructure. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/es`: Updates service API, documentation, and paginators - * Amazon Elasticsearch Service adds support for no downtime, in-place upgrade for Elasticsearch version 5.1 and above. - -Release v1.15.11 (2018-08-13) -=== - -### Service Client Updates -* `service/sagemaker`: Updates service API and documentation - * SageMaker updated the default endpoint URL to support Private Link via the CLI/SDK. - -Release v1.15.10 (2018-08-10) -=== - -### Service Client Updates -* `service/mediaconvert`: Updates service API and documentation - * This release adds support for a new rate control mode, Quality-Defined Variable Bitrate (QVBR) encoding, includes updates to optimize transcoding performance, and resolves previously reported bugs. -* `service/rds`: Updates service documentation - * Documentation updates for rds - -Release v1.15.9 (2018-08-09) -=== - -### Service Client Updates -* `service/dax`: Updates service API and documentation - * Add the SSESpecification field to CreateCluster to allow creation of clusters with server-side encryption, and add the SSEDescription field to DescribeClusters to display the status of server-side encryption for a cluster. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for Docker volumes and Docker volume drivers. Customers can now configure their ECS Tasks to use Docker volumes, enabling stateful and storage-intensive applications to be deployed on ECS. -* `service/rds`: Updates service API, documentation, and examples - * Launch RDS Aurora Serverless - -Release v1.15.8 (2018-08-08) -=== - -### Service Client Updates -* `service/secretsmanager`: Updates service API and documentation - * This release introduces a ForceDeleteWithoutRecovery parameter to the DeleteSecret API enabling customers to force the deletion of a secret without any recovery window -* `service/ssm`: Updates service API and documentation - * AWS Systems Manager Automation is launching two new features for Automation Execution Rate Control based on tags and customized parameter maps. With the first feature, customer can target their resources by specifying a Tag with Key/Value. With the second feature, Parameter maps rate control, customers can benefit from customization of input parameters. - -Release v1.15.7 (2018-08-07) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Release semantic versioning feature for CodeBuild -* `service/ec2`: Updates service API and documentation - * Amazon VPC Flow Logs adds support for delivering flow logs directly to S3 -* `service/logs`: Updates service API and documentation - * Documentation Update -* `service/pinpoint`: Updates service API and documentation - * This release includes a new batch API call for Amazon Pinpoint which can be used to update endpoints and submit events. This call will accept events from clients such as mobile devices and AWS SDKs. This call will accept requests which has multiple endpoints and multiple events attached to those endpoints in a single call. This call will update the endpoints attached and will ingest events for those endpoints. The response from this call will be a multipart response per endpoint/per event submitted. -* `service/ssm`: Updates service API and documentation - * Two new filters ExecutionStage and DocumentName will be added to ListCommands so that customers will have more approaches to query their commands. - -Release v1.15.6 (2018-08-06) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB Point-in-time recovery (PITR) provides continuous backups of your table data. DynamoDB now supports the ability to self-restore a deleted PITR enabled table. Now, when a table with PITR enabled is deleted, a system backup is automatically created and retained for 35 days (at no additional cost). System backups allow you to restore the deleted PITR enabled table to the state it was just before the point of deletion. For more information, see the Amazon DynamoDB Developer Guide. -* `service/health`: Updates service API, documentation, and paginators - * Updates the ARN structure vended by AWS Health API. All ARNs will now include the service and type code of the associated event, as vended by DescribeEventTypes. - -Release v1.15.5 (2018-08-03) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation - -Release v1.15.4 (2018-08-02) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kinesis`: Updates service API, documentation, and paginators - * This update introduces SubscribeToShard and RegisterStreamConsumer APIs which allows for retrieving records on a data stream over HTTP2 with enhanced fan-out capabilities. With this new feature the Java SDK now supports event streaming natively which will allow you to define payload and exception structures on the client over a persistent connection. For more information, see Developing Consumers with Enhanced Fan-Out in the Kinesis Developer Guide. -* `service/polly`: Updates service API and documentation - * Amazon Polly enables female voice Aditi to speak Hindi language -* `service/resource-groups`: Updates service API and documentation -* `service/ssm`: Updates service API and documentation - * This release updates AWS Systems Manager APIs to let customers create and use service-linked roles to register and edit Maintenance Window tasks. - -Release v1.15.3 (2018-08-01) -=== - -### Service Client Updates -* `service/storagegateway`: Updates service API, documentation, and examples - * AWS Storage Gateway now enables you to create stored volumes with AWS KMS support. -* `service/transcribe`: Updates service API and documentation - -Release v1.15.2 (2018-07-31) -=== - -### Service Client Updates -* `service/connect`: Updates service API and documentation -* `service/es`: Updates service API and documentation - * Amazon Elasticsearch Service adds support for enabling Elasticsearch error logs, providing you valuable information for troubleshooting your Elasticsearch domains quickly and easily. These logs are published to the Amazon CloudWatch Logs service and can be turned on or off at will. -* `service/iot`: Updates service API and documentation - * As part of this release we are introducing a new IoT security service, AWS IoT Device Defender, and extending capability of AWS IoT to support Step Functions rule action. The AWS IoT Device Defender is a fully managed service that helps you secure your fleet of IoT devices. For more details on this new service, go to https://aws.amazon.com/iot-device-defender. The Step Functions rule action lets you start an execution of AWS Step Functions state machine from a rule. -* `service/kms`: Updates service API and documentation - * Added a KeyID parameter to the ListAliases operation. This parameter allows users to list only the aliases that refer to a particular AWS KMS customer master key. All other functionality remains intact. -* `service/mediaconvert`: Updates service API and documentation - * Fixes an issue with modeled timestamps being labeled with the incorrect format. - -### SDK Enhancements -* `service/dynamodb/dynamodbattribute`: Add support for custom struct tag keys([#2054](https://github.com/aws/aws-sdk-go/pull/2054)) - * Adds support for (un)marshaling Go types using custom struct tag keys. The new `MarshalOptions.TagKey` allows the user to specify the tag key to use when (un)marshaling struct fields. Adds support for struct tags such as `yaml`, `toml`, etc. Support for these keys are in name only, and require the tag value format and values to be supported by the package's Marshalers. - -### SDK Bugs -* `aws/endpoints`: Add workaround for AWS China Application Autoscaling ([#2080](https://github.com/aws/aws-sdk-go/pull/2080)) - * Adds workaround to correct the endpoint for Application Autoscaling running in AWS China. This will allow your application to make API calls to Application Autoscaling service in AWS China. - * Fixes [#2079](https://github.com/aws/aws-sdk-go/issues/2079) - * Fixes [#1957](https://github.com/aws/aws-sdk-go/issues/1957) -* `private/protocol/xml/xmlutil`: Fix SDK marshaling of empty types ([#2081](https://github.com/aws/aws-sdk-go/pull/2081)) - * Fixes the SDK's marshaling of types without members. This corrects the issue where the SDK would not marshal an XML tag for a type, if that type did not have any exported members. - * Fixes [#2015](https://github.com/aws/aws-sdk-go/issues/2015) - -Release v1.15.1 (2018-07-30) -=== - -### Service Client Updates -* `service/cloudhsmv2`: Updates service API and documentation - * This update to the AWS CloudHSM API adds copy-backup-to-region, which allows you to copy a backup of a cluster from one region to another. The copied backup can be used in the destination region to create a new AWS CloudHSM cluster as a clone of the original cluster. -* `service/directconnect`: Updates service API and documentation - * 1. awsDeviceV2 field is introduced for Connection/Lag/Interconnect/VirtualInterface/Bgp Objects, while deprecating the awsDevice field for Connection/Lag/Interconnect Objects. 2. region field is introduced for VirtualInterface/Location objects -* `service/glacier`: Updates service API and documentation - * Documentation updates for glacier -* `service/glue`: Updates service API and documentation - * Glue Development Endpoints now support association of multiple SSH public keys with a development endpoint. -* `service/iot`: Updates service API and documentation - * get rid of documentParameters field from CreateJob API -* `service/mq`: Updates service API, documentation, and paginators - * Modified the CreateBroker, UpdateBroker, and DescribeBroker operations to support integration with Amazon CloudWatch Logs. Added a field to indicate the IP address(es) that correspond to wire-level endpoints of broker instances. While a single-instance broker has one IP address, an active/standby broker for high availability has 2 IP addresses. Added fields to indicate the time when resources were created. Updated documentation for Amazon MQ. -* `service/sagemaker`: Updates service API and documentation - * Added SecondaryStatusTransitions to DescribeTrainingJob to provide more visibility into SageMaker training job progress and lifecycle. - -Release v1.15.0 (2018-07-26) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Add artifacts encryptionDisabled and build encryptionKey. -* `service/ec2`: Updates service API and documentation - * This change provides the EC2/Spot customers with two new allocation strategies -- LowestN for Spot instances, and OD priority for on-demand instances. -* `service/greengrass`: Updates service documentation - * Documentation updates for Greengrass Local Resource Access feature -* `service/inspector`: Updates service API and documentation - * inspector will return ServiceTemporarilyUnavailableException when service is under stress -* `service/redshift`: Updates service API and documentation - * When we make a new version of Amazon Redshift available, we update your cluster during its maintenance window. By selecting a maintenance track, you control whether we update your cluster with the most recent approved release, or with the previous release. The two values for maintenance track are current and trailing. If you choose the current track, your cluster is updated with the latest approved release. If you choose the trailing track, your cluster is updated with the release that was approved previously.The new API operation for managing maintenance tracks for a cluster is DescribeClusterTracks. In addition, the following API operations have new MaintenanceTrackName parameters: Cluster, PendingModifiedValues, ModifyCluster, RestoreFromClusterSnapshot, CreateCluster, Snapshot -* `service/ssm`: Updates service API and documentation - * This release updates AWS Systems Manager APIs to allow customers to attach labels to history parameter records and reference history parameter records via labels. It also adds Parameter Store integration with AWS Secrets Manager to allow referencing and retrieving AWS Secrets Manager's secrets from Parameter Store. - -### SDK Features -* `private/model/api`: SDK APIs input/output are not consistently generated ([#2073](https://github.com/aws/aws-sdk-go/pull/2073)) - * Updates the SDK's API code generation to generate the API input and output types consistently. This ensures that the SDK will no longer rename input/output types unexpectedly as in [#2070](https://github.com/aws/aws-sdk-go/issues/2070). SDK API input and output parameter types will always be the API name with a suffix of Input and Output. - * Existing service APIs which were incorrectly modeled have been preserved to ensure they do not break. - * Fixes [#2070](https://github.com/aws/aws-sdk-go/issues/2070) - -### SDK Enhancements -* `service/s3/s3manager`: Document default behavior for Upload's MaxNumParts ([#2077](https://github.com/aws/aws-sdk-go/issues/2077)) - * Updates the S3 Upload Manager's default behavior for MaxNumParts, and ensures that the Uploader.MaxNumPart's member value is initialized properly if the type was created via struct initialization instead of using the NewUploader function. - * Fixes [#2015](https://github.com/aws/aws-sdk-go/issues/2015) - -### SDK Bugs -* `private/model/api`: SDK APIs input/output are not consistently generated ([#2073](https://github.com/aws/aws-sdk-go/pull/2073)) - * Fixes EFS service breaking change in v1.14.26 where `FileSystemDescription` was incorrectly renamed to `UpdateFileSystemOutput. - * Fixes [#2070](https://github.com/aws/aws-sdk-go/issues/2070) - -Release v1.14.33 (2018-07-25) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * R5 is the successor to R4 in EC2's memory-optimized instance family. R5d is a variant of R5 that has local NVMe SSD. Z1d instances deliver both high compute and high memory. Z1d instances use custom Intel Xeon Scalable Processors running at up to 4.0 GHz, powered by sustained all-core Turbo Boost. They are available in 6 sizes, with up to 48 vCPUs, 384 GiB of memory, and 1.8 TB of local NVMe storage. -* `service/ecs`: Updates service API and documentation - * This release of Amazon Elastic Container Service (Amazon ECS) introduces support for private registry authentication using AWS Secrets Manager. With private registry authentication, private Docker images can be used in a task definition. -* `service/elasticloadbalancingv2`: Updates service API and documentation - -Release v1.14.32 (2018-07-24) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service API and documentation - * With this SDK update, APIs UpdateGlobalTableSettings and DescribeGlobalTableSettings now allow consistently configuring AutoScaling settings for a DynamoDB global table. Previously, they would only allow consistently setting IOPS. Now new APIs are being released, existing APIs are being extended. - -Release v1.14.31 (2018-07-20) -=== - -### Service Client Updates -* `service/config`: Updates service API -* `service/dlm`: Updates service documentation - -### SDK Enhancements -* `service/s3/s3manager`: Add documentation for sequential download [#2065](https://github.com/aws/aws-sdk-go/pull/2065) - * Adds documentation for downloading object sequentially with the S3 download manager. - -Release v1.14.30 (2018-07-19) -=== - -### Service Client Updates -* `service/mediapackage`: Updates service API and documentation - * Adds support for DASH OriginEnpoints with multiple media presentation description periods triggered by presence of SCTE-35 ad markers in Channel input streams. - -### SDK Enhancements -* `aws/default`: Add helper to get default provider chain list of credential providers ([#2059](https://github.com/aws/aws-sdk-go/issues/2051)) - * Exports the default provider chain list of providers so it can be used to compose custom chains of credential providers. - * Fixes [#2051](https://github.com/aws/aws-sdk-go/issues/2051) - -Release v1.14.29 (2018-07-18) -=== - -### Service Client Updates -* `service/iotanalytics`: Updates service API and documentation - -Release v1.14.28 (2018-07-17) -=== - -### Service Client Updates -* `service/comprehend`: Updates service API and documentation -* `service/polly`: Updates service API, documentation, and paginators - * Amazon Polly adds new API for asynchronous synthesis to S3 -* `service/sagemaker`: Updates service API, documentation, and paginators - * Amazon SageMaker has added the capability for customers to run fully-managed, high-throughput batch transform machine learning models with a simple API call. Batch Transform is ideal for high-throughput workloads and predictions in non-real-time scenarios where data is accumulated over a period of time for offline processing. -* `service/snowball`: Updates service API and documentation - * AWS Snowball Edge announces the availability of Amazon EC2 compute instances that run on the device. AWS Snowball Edge is a 100-TB ruggedized device built to transfer data into and out of AWS with optional support for local Lambda-based compute functions. With this feature, developers and administrators can run their EC2-based applications on the device providing them with an end to end vertically integrated AWS experience. Designed for data pre-processing, compression, machine learning, and data collection applications, these new instances, called SBE1 instances, feature 1.8 GHz Intel Xeon D processors up to 16 vCPUs, and 32 GB of memory. The SBE1 instance type is available in four sizes and multiple instances can be run on the device at the same time. Customers can now run compute instances using the same Amazon Machine Images (AMIs) that are used in Amazon EC2. - -Release v1.14.27 (2018-07-13) -=== - -### Service Client Updates -* `service/appstream`: Updates service API, documentation, and paginators - * This API update adds support for sharing AppStream images across AWS accounts within the same region. -* `service/kinesis-video-archived-media`: Updates service API and documentation -* `service/kinesisvideo`: Updates service API and documentation - * Adds support for HLS video playback of Kinesis Video streams using the KinesisVideo client by including "GET_HLS_STREAMING_SESSION_URL" as an additional APIName parameter in the GetDataEndpoint input. - -Release v1.14.26 (2018-07-12) -=== - -### Service Client Updates -* `service/appsync`: Updates service API and documentation -* `service/codebuild`: Updates service API - * Update CodeBuild CreateProject API - serviceRole is a required input -* `service/dlm`: Adds new service -* `service/elasticfilesystem`: Updates service API and documentation - * Amazon EFS now allows you to instantly provision the throughput required for your applications independent of the amount of data stored in your file system, allowing you to optimize throughput for your applications performance needs. Starting today, you can provision the throughput your applications require quickly with a few simple steps using AWS Console, AWS CLI or AWS API to achieve consistent performance. -* `service/elasticmapreduce`: Updates service API and documentation - * Documentation updates for EMR. -* `service/iam`: Updates service API and documentation - * SDK release to support IAM delegated administrator feature. The feature lets customers attach permissions boundary to IAM principals. The IAM principals cannot operate exceeding the permission specified in permissions boundary. - -### SDK Enhancements -* `aws/credentials/ec2rolecreds`: Avoid unnecessary redirect [#2037](https://github.com/aws/aws-sdk-go/pull/2037) - * This removes the unnecessary redirect for /latest/meta-data/iam/security-credentials/ - -Release v1.14.25 (2018-07-11) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Support for fine grain throttling for API gateway. -* `service/ce`: Updates service API and documentation -* `service/s3`: Updates service API and documentation - * S3 Select support for BZIP2 compressed input files -* `service/ssm`: Updates service API and documentation - * Support Conditional Branching OnFailure for SSM Automation - -Release v1.14.24 (2018-07-10) -=== - -### Service Client Updates -* `service/appstream`: Updates service API, documentation, paginators, and examples - * This API update adds pagination to the DescribeImages API to support future features and enhancements. -* `service/codebuild`: Updates service API and documentation - * API changes to CodeBuild service, support report build status for Github sources -* `service/ec2`: Updates service API and documentation - * Support CpuOptions field in Launch Template data and allow Launch Template name to contain hyphen. -* `service/glue`: Updates service API and documentation - * AWS Glue adds the ability to crawl DynamoDB tables. -* `service/opsworks`: Updates service documentation - * Documentation updates for AWS OpsWorks Stacks. - -Release v1.14.23 (2018-07-10) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service documentation - -Release v1.14.22 (2018-07-09) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API -* `service/ce`: Updates service API and documentation -* `service/dms`: Updates service API and documentation - * Added support for DmsTransfer endpoint type and support for re-validate option in table reload API. -* `service/lambda`: Updates service API - * Add support for .NET Core 2.1 to Lambda. -* `service/transcribe`: Updates service API and documentation - -Release v1.14.21 (2018-07-06) -=== - -### Service Client Updates -* `service/mediaconvert`: Updates service API and documentation - * This release adds support for the following 1) users can specify tags to be attached to queues, presets, and templates during creation of those resources on MediaConvert. 2) users can now view the count of jobs in submitted state and in progressing state on a per queue basis. -* `service/serverlessrepo`: Updates service API and documentation - -Release v1.14.20 (2018-07-05) -=== - -### Service Client Updates -* `service/pinpoint`: Updates service API and documentation - * This release of the Amazon Pinpoint SDK adds the ability to create complex segments and validate phone numbers for SMS messages. It also adds the ability to get or delete endpoints based on user IDs, remove attributes from endpoints, and list the defined channels for an app. -* `service/sagemaker`: Updates service API and documentation - * Amazon SageMaker NotebookInstances supports 'Updating' as a NotebookInstanceStatus. In addition, DescribeEndpointOutput now includes Docker repository digest of deployed Model images. - -Release v1.14.19 (2018-07-03) -=== - -### Service Client Updates -* `service/acm`: Updates service waiters - * Adds a "CertificateValidated" waiter to AWS Certificate Manager clients, which polls on a new certificate's validation state. -* `service/ec2`: Updates service API, documentation, and examples - * Added support for customers to tag EC2 Dedicated Hosts -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/redshift`: Updates service API and documentation - * Feature 1 - On-demand cluster release version - When Amazon Redshift releases a new cluster version, you can choose to upgrade to that version immediately instead of waiting until your next maintenance window. You can also choose to roll back to a previous version. The two new APIs added for managing cluster release version are - ModifyClusterDbRevision, DescribeClusterDbRevisions. Feature 2 - Upgradeable reserved instance - You can now exchange one Reserved Instance for a new Reserved Instance with no changes to the terms of your existing Reserved Instance (term, payment type, or number of nodes). The two new APIs added for managing these upgrades are - AcceptReservedNodeExchange, GetReservedNodeExchangeOfferings. - -### SDK Enhancements -* `private/model/api`: Add EventStream support over RPC protocl ([#1998](https://github.com/aws/aws-sdk-go/pull/1998)) - * Adds support for EventStream over JSON PRC protocol. This adds support for the EventStream's initial-response event, EventStream headers, and EventStream modeled exceptions. Also replaces the hand written tests with generated tests for EventStream usage. - -Release v1.14.18 (2018-07-02) -=== - -### Service Client Updates -* `service/ssm`: Updates service API, documentation, and examples - * Execution History and StartAssociationOnce release for State Manager. Users now have the ability to view association execution history with DescribeAssociationExecutions and DescribeAssociationExecutionTargets. Users can also execute an association by calling StartAssociationOnce. - -Release v1.14.17 (2018-06-29) -=== - -### Service Client Updates -* `service/secretsmanager`: Updates service examples - * New SDK code snippet examples for the new APIs released for the Resource-based Policy support in Secrets Manager - -Release v1.14.16 (2018-06-28) -=== - -### Service Client Updates -* `service/elasticbeanstalk`: Updates service API, documentation, and examples - * Elastic Beanstalk adds "Suspended" health status to the EnvironmentHealthStatus enum type and updates document. -* `service/lambda`: Updates service API and documentation - * Support for SQS as an event source. -* `service/storagegateway`: Updates service API, documentation, and examples - * AWS Storage Gateway now enables you to use Server Message Block (SMB) protocol to store and access objects in Amazon Simple Storage Service (S3). - -Release v1.14.15 (2018-06-27) -=== - -### Service Client Updates -* `service/cloudfront`: Updates service API and documentation - * Unpublish delete-service-linked-role API. -* `service/codepipeline`: Updates service API - * UpdatePipeline may now throw a LimitExceededException when adding or updating Source Actions that use periodic checks for change detection -* `service/comprehend`: Updates service API, documentation, and paginators -* `service/secretsmanager`: Updates service documentation, paginators, and examples - * Documentation updates for secretsmanager - -### SDK Bugs -* `aws/csm`: Final API Call Attempt events were not being called [#2008](https://github.com/aws/aws-sdk-go/pull/2008) - -Release v1.14.14 (2018-06-26) -=== - -### Service Client Updates -* `service/inspector`: Updates service API, documentation, and paginators - * Introduce four new APIs to view and preview Exclusions. Exclusions show which intended security checks are excluded from an assessment, along with reasons and recommendations to fix. The APIs are CreateExclusionsPreview, GetExclusionsPreview, ListExclusions, and DescribeExclusions. -* `service/s3`: Updates service API and documentation - * Add AllowQuotedRecordDelimiter to Amazon S3 Select API. Please refer to https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html for usage details. -* `service/secretsmanager`: Updates service API, documentation, paginators, and examples - * This release adds support for resource-based policies that attach directly to your secrets. These policies provide an additional way to control who can access your secrets and what they can do with them. For more information, see https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html in the Secrets Manager User Guide. - -Release v1.14.13 (2018-06-22) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/appstream`: Updates service API, documentation, paginators, and examples - * This API update enables customers to find their VPC private IP address and ENI ID associated with AppStream streaming sessions. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.14.12 (2018-06-21) -=== - -### Service Client Updates -* `service/clouddirectory`: Adds new service - * SDK release to support Flexible Schema initiative being carried out by Amazon Cloud Directory. This feature lets customers using new capabilities like: variant typed attributes, dynamic facets and AWS managed Cloud Directory schemas. - -Release v1.14.11 (2018-06-21) -=== - -### Service Client Updates -* `service/macie`: Adds new service - * Amazon Macie is a security service that uses machine learning to automatically discover, classify, and protect sensitive data in AWS. With this release, we are launching the following Macie HTTPS API operations: AssociateMemberAccount, AssociateS3Resources, DisassociateMemberAccount, DisassociateS3Resources, ListMemberAccounts, ListS3Resources, and UpdateS3Resources. With these API operations you can issue HTTPS requests directly to the service. -* `service/neptune`: Updates service API, documentation, and examples - * Deprecates the PubliclyAccessible parameter that is not supported by Amazon Neptune. -* `service/ssm`: Updates service API, documentation, and examples - * Adds Amazon Linux 2 support to Patch Manager - -Release v1.14.10 (2018-06-20) -=== - -### Service Client Updates -* `service/acm-pca`: Updates service API, documentation, paginators, and examples -* `service/medialive`: Updates service API, documentation, and paginators - * AWS Elemental MediaLive now makes Reserved Outputs and Inputs available through the AWS Management Console and API. You can reserve outputs and inputs with a 12 month commitment in exchange for discounted hourly rates. Pricing is available at https://aws.amazon.com/medialive/pricing/ -* `service/rds`: Updates service API, documentation, and examples - * This release adds a new parameter to specify the retention period for Performance Insights data for RDS instances. You can either choose 7 days (default) or 731 days. For more information, see Amazon RDS Documentation. - -### SDK Enhancements -* `service/s3`: Update SelectObjectContent doc example to be on the API not nested type. ([#1991](https://github.com/aws/aws-sdk-go/pull/1991)) - -### SDK Bugs -* `aws/client`: Fix HTTP debug log EventStream payloads ([#2000](https://github.com/aws/aws-sdk-go/pull/2000)) - * Fixes the SDK's HTTP client debug logging to not log the HTTP response body for EventStreams. This prevents the SDK from buffering a very large amount of data to be logged at once. The aws.LogDebugWithEventStreamBody should be used to log the event stream events. - * Fixes a bug in the SDK's response logger which will buffer the response body's content if LogDebug is enabled but LogDebugWithHTTPBody is not. - -Release v1.14.9 (2018-06-19) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rekognition`: Updates service documentation and examples - * Documentation updates for rekognition - -### SDK Bugs -* `private/model/api`: Update client ServiceName to be based on name of service for new services. ([#1997](https://github.com/aws/aws-sdk-go/pull/1997)) - * Fixes the SDK's `ServiceName` AWS service client package value to be unique based on the service name for new AWS services. Does not change exiting client packages. - -Release v1.14.8 (2018-06-15) -=== - -### Service Client Updates -* `service/mediaconvert`: Updates service API and documentation - * This release adds language code support according to the ISO-639-3 standard. Custom 3-character language codes are now supported on input and output for both audio and captions. - -Release v1.14.7 (2018-06-14) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Support for PRIVATE endpoint configuration type -* `service/dynamodb`: Updates service API and documentation - * Added two new fields SSEType and KMSMasterKeyArn to SSEDescription block in describe-table output. -* `service/iotanalytics`: Updates service API and documentation - -Release v1.14.6 (2018-06-13) -=== - -### Service Client Updates -* `service/servicecatalog`: Updates service API - * Introduced new length limitations for few of the product fields. -* `service/ssm`: Updates service API and documentation - * Added support for new parameter, CloudWatchOutputConfig, for SendCommand API. Users can now have RunCommand output sent to CloudWatchLogs. - -Release v1.14.5 (2018-06-12) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * Adding VPCEndpoint support for Remote access. Allows customers to be able to access their private endpoints/services running in their VPC during remote access. -* `service/ecs`: Updates service API and documentation - * Introduces daemon scheduling capability to deploy one task per instance on selected instances in a cluster. Adds a "force" flag to the DeleteService API to delete a service without requiring to scale down the number of tasks to zero. - -### SDK Enhancements -* `service/rds/rdsutils`: Clean up the rdsutils package and adds a new builder to construct connection strings ([#1985](https://github.com/aws/aws-sdk-go/pull/1985)) - * Rewords documentation to be more useful and provides links to prior setup needed to support authentication tokens. Introduces a builder that allows for building connection strings - -### SDK Bugs -* `aws/signer/v4`: Fix X-Amz-Content-Sha256 being in to query for presign ([#1976](https://github.com/aws/aws-sdk-go/pull/1976)) - * Fixes the bug which would allow the X-Amz-Content-Sha256 header to be promoted to the query string when presigning a S3 request. This bug also was preventing users from setting their own sha256 value for a presigned URL. Presigned requests generated with the custom sha256 would of always failed with invalid signature. - * Fixes [#1974](https://github.com/aws/aws-sdk-go/pull/1974) - -Release v1.14.4 (2018-06-11) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * Amazon Cloud Directory now supports optional attributes on Typed Links, giving users the ability to associate and manage data on Typed Links. -* `service/rds`: Updates service documentation - * Changed lists of valid EngineVersion values to links to the RDS User Guide. -* `service/storagegateway`: Updates service API and documentation - * AWS Storage Gateway now enables you to create cached volumes and tapes with AWS KMS support. - -Release v1.14.3 (2018-06-08) -=== - -### Service Client Updates -* `service/mediatailor`: Updates service API - -Release v1.14.2 (2018-06-07) -=== - -### Service Client Updates -* `service/medialive`: Updates service API, documentation, and paginators - * AWS Elemental MediaLive now makes channel log information available through Amazon CloudWatch Logs. You can set up each MediaLive channel with a logging level; when the channel is run, logs will automatically be published to your account on Amazon CloudWatch Logs - -Release v1.14.1 (2018-06-05) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/polly`: Updates service API and documentation - * Amazon Polly adds new French voice - "Lea" -* `service/rds`: Updates service API and documentation - * This release adds customizable processor features for RDS instances. -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager -* `service/shield`: Updates service API and documentation - * DDoS Response Team access management for AWS Shield - -Release v1.14.0 (2018-06-04) -=== - -### Service Client Updates -* `service/AWSMigrationHub`: Updates service documentation -* `service/appstream`: Updates service API and documentation - * Amazon AppStream 2.0 adds support for Google Drive for G Suite. With this feature, customers will be able to connect their G Suite accounts with AppStream 2.0 and enable Google Drive access for an AppStream 2.0 stack. Users of the stack can then link their Google Drive using their G Suite login credentials and use their existing files stored in Drive with their AppStream 2.0 applications. File changes will be synced automatically to Google cloud. -* `service/ec2`: Updates service API and documentation - * You are now able to use instance storage (up to 3600 GB of NVMe based SSD) on M5 instances, the next generation of EC2's General Purpose instances in us-east-1, us-west-2, us-east-2, eu-west-1 and ca-central-1. M5 instances offer up to 96 vCPUs, 384 GiB of DDR4 instance memory, 25 Gbps in Network bandwidth and improved EBS and Networking bandwidth on smaller instance sizes and provide a balance of compute, memory and network resources for many applications. -* `service/eks`: Adds new service -* `service/mediaconvert`: Updates service API and documentation - * This release adds the support for Common Media Application Format (CMAF) fragmented outputs, RF64 WAV audio output format, and HEV1 or HEVC1 MP4 packaging types when using HEVC in DASH or CMAF outputs. -* `service/sagemaker`: Updates service API, documentation, and paginators - * Amazon SageMaker has added the ability to run hyperparameter tuning jobs. A hyperparameter tuning job will create and evaluate multiple training jobs while tuning algorithm hyperparameters, to optimize a customer specified objective metric. - -### SDK Features -* Add support for EventStream based APIs (S3 SelectObjectContent) ([#1941](https://github.com/aws/aws-sdk-go/pull/1941)) - * Adds support for EventStream asynchronous APIs such as S3 SelectObjectContents API. This API allows your application to receiving multiple events asynchronously from the API response. Your application recieves these events from a channel on the API response. - * See PR [#1941](https://github.com/aws/aws-sdk-go/pull/1941) for example. - * Fixes [#1895](https://github.com/aws/aws-sdk-go/issues/1895) - -Release v1.13.60 (2018-06-01) -=== - -### Service Client Updates -* `service/ds`: Updates service API and documentation - * Added ResetUserPassword API. Customers can now reset their users' passwords without providing the old passwords in Simple AD and Microsoft AD. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API and documentation - * We are releasing force CancelJob and CancelJobExecution functionalities to customers. -* `service/mediatailor`: Adds new service -* `service/redshift`: Updates service documentation - * Documentation updates for redshift -* `service/sns`: Updates service API, documentation, and paginators - * The SNS Subscribe API has been updated with two new optional parameters: Attributes and ReturnSubscriptionArn. Attributes is a map of subscription attributes which can be one or more of: FilterPolicy, DeliveryPolicy, and RawMessageDelivery. ReturnSubscriptionArn is a boolean parameter that overrides the default behavior of returning "pending confirmation" for subscriptions that require confirmation instead of returning the subscription ARN. - -### SDK Bugs -* `private/mode/api`: Fix error code constants being generated incorrectly.([#1958](https://github.com/aws/aws-sdk-go/issues/1958)) - * Fixes the SDK's code generation to not modify the error code text value when generating error code constants. This prevents generating error code values which are invalid and will never be sent by the service. This change does not change the error code constant variable name generated by the SDK, only the value of the error code. - * Fixes [#1856](https://github.com/aws/aws-sdk-go/issues/1856) - -Release v1.13.59 (2018-05-31) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.58 (2018-05-30) -=== - -### Service Client Updates -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/neptune`: Adds new service - * Amazon Neptune is a fast, reliable graph database service that makes it easy to build and run applications that work with highly connected datasets. Neptune supports popular graph models Property Graph and W3C's Resource Description Frame (RDF), and their respective query languages Apache TinkerPop Gremlin 3.3.2 and SPARQL 1.1. - -Release v1.13.57 (2018-05-29) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/pi`: Adds new service - -Release v1.13.56 (2018-05-25) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update enables customers to control whether users can transfer data between their local devices and their streaming applications through file uploads and downloads, clipboard operations, or printing to local devices -* `service/config`: Updates service API and documentation -* `service/glue`: Updates service API and documentation - * AWS Glue now sends a delay notification to Amazon CloudWatch Events when an ETL job runs longer than the specified delay notification threshold. -* `service/iot`: Updates service API - * We are exposing DELETION_IN_PROGRESS as a new job status in regards to the release of DeleteJob API. - -Release v1.13.55 (2018-05-24) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API - * AWS CodeBuild Adds Support for Windows Builds. -* `service/elasticloadbalancingv2`: Updates service documentation -* `service/rds`: Updates service API and documentation - * This release adds CloudWatch Logs integration capabilities to RDS Aurora MySQL clusters -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -### SDK Bugs -* `service/cloudwatchlogs`: Fix pagination with cloudwatchlogs ([#1945](https://github.com/aws/aws-sdk-go/pull/1945)) - * Fixes the SDK's behavior with CloudWatchLogs APIs which return duplicate `NextToken` values to signal end of pagination. - * Fixes [#1908](https://github.com/aws/aws-sdk-go/pull/1908) - -Release v1.13.54 (2018-05-22) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * Amazon Elastic Container Service (ECS) adds service discovery for services that use host or bridged network mode. ECS can now also register instance IPs for active tasks using bridged and host networking with Route 53, making them available via DNS. -* `service/inspector`: Updates service API - * We are launching the ability to target all EC2 instances. With this launch, resourceGroupArn is now optional for CreateAssessmentTarget and UpdateAssessmentTarget. If resourceGroupArn is not specified, all EC2 instances in the account in the AWS region are included in the assessment target. - -Release v1.13.53 (2018-05-21) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service API and documentation - * 1) Filtered Update for StackSet based on Accounts and Regions: This feature will allow flexibility for the customers to roll out updates on a StackSet based on specific Accounts and Regions. 2) Support for customized ExecutionRoleName: This feature will allow customers to attach ExecutionRoleName to the StackSet thus ensuring more security and controlling the behavior of any AWS resources in the target accounts. - -Release v1.13.52 (2018-05-18) -=== - -### Service Client Updates -* `service/email`: Updates service documentation - * Fixed a broken link in the documentation for S3Action. -* `service/iot`: Updates service API and documentation - * We are releasing DeleteJob and DeleteJobExecution APIs to allow customer to delete resources created using AWS IoT Jobs. - -Release v1.13.51 (2018-05-17) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service documentation - * Documentation updates for codedeploy -* `service/cognito-idp`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * You are now able to use instance storage (up to 1800 GB of NVMe based SSD) on C5 instances, the next generation of EC2's compute optimized instances in us-east-1, us-west-2, us-east-2, eu-west-1 and ca-central-1. C5 instances offer up to 72 vCPUs, 144 GiB of DDR4 instance memory, 25 Gbps in Network bandwidth and improved EBS and Networking bandwidth on smaller instance sizes to deliver improved performance for compute-intensive workloads.You can now run bare metal workloads on EC2 with i3.metal instances. As a new instance size belonging to the I3 instance family, i3.metal instances have the same characteristics as other instances in the family, including NVMe SSD-backed instance storage optimized for low latency, very high random I/O performance, and high sequential read throughput. I3.metal instances are powered by 2.3 GHz Intel Xeon processors, offering 36 hyper-threaded cores (72 logical processors), 512 GiB of memory, and 15.2 TB of NVMe SSD-backed instance storage. These instances deliver high networking throughput and lower latency with up to 25 Gbps of aggregate network bandwidth using Elastic Network Adapter (ENA)-based Enhanced Networking. - -Release v1.13.50 (2018-05-16) -=== - -### Service Client Updates -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager -* `service/servicecatalog`: Updates service API and documentation - * Users can now pass a new option to ListAcceptedPortfolioShares called portfolio-share-type with a value of AWS_SERVICECATALOG in order to access Getting Started Portfolios that contain selected products representing common customer use cases. - -Release v1.13.49 (2018-05-15) -=== - -### Service Client Updates -* `service/config`: Updates service API - -Release v1.13.48 (2018-05-14) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Adding support for more override fields for StartBuild API, add support for idempotency token field for StartBuild API in AWS CodeBuild. -* `service/iot1click-devices`: Adds new service -* `service/iot1click-projects`: Adds new service -* `service/organizations`: Updates service documentation - * Documentation updates for organizations - -Release v1.13.47 (2018-05-10) -=== - -### Service Client Updates -* `service/firehose`: Updates service API and documentation - * With this release, Amazon Kinesis Data Firehose can convert the format of your input data from JSON to Apache Parquet or Apache ORC before storing the data in Amazon S3. Parquet and ORC are columnar data formats that save space and enable faster queries compared to row-oriented formats like JSON. - -Release v1.13.46 (2018-05-10) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/gamelift`: Updates service API and documentation - * AutoScaling Target Tracking scaling simplification along with StartFleetActions and StopFleetActions APIs to suspend and resume automatic scaling at will. - -Release v1.13.45 (2018-05-10) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Updating the regex for the NumericValue fields. -* `service/ec2`: Updates service API and documentation - * Enable support for latest flag with Get Console Output -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * Changes to support the Aurora MySQL Backtrack feature. - -Release v1.13.44 (2018-05-08) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Enable support for specifying CPU options during instance launch. -* `service/rds`: Updates service documentation - * Correction to the documentation about copying unencrypted snapshots. - -Release v1.13.43 (2018-05-07) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API -* `service/budgets`: Updates service API and documentation - * "With this release, customers can use AWS Budgets to monitor how much of their Amazon EC2, Amazon RDS, Amazon Redshift, and Amazon ElastiCache instance usage is covered by reservations, and receive alerts when their coverage falls below the threshold they define." -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/es`: Updates service API, documentation, and paginators - * This change brings support for Reserved Instances to AWS Elasticsearch. -* `service/s3`: Updates service API and documentation - * Added BytesReturned details for Progress and Stats Events for Amazon S3 Select . - -Release v1.13.42 (2018-05-04) -=== - -### Service Client Updates -* `service/guardduty`: Updates service API, documentation, and paginators - * Amazon GuardDuty is adding five new API operations for creating and managing filters. For each filter, you can specify a criteria and an action. The action you specify is applied to findings that match the specified criteria. - -Release v1.13.41 (2018-05-03) -=== - -### Service Client Updates -* `service/appsync`: Updates service API and documentation -* `service/config`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -Release v1.13.40 (2018-05-02) -=== - -### Service Client Updates -* `service/acm`: Updates service documentation - * Documentation updates for acm -* `service/codepipeline`: Updates service API and documentation - * Added support for webhooks with accompanying definitions as needed in the AWS CodePipeline API Guide. -* `service/ec2`: Updates service API and documentation - * Amazon EC2 Fleet is a new feature that simplifies the provisioning of Amazon EC2 capacity across different EC2 instance types, Availability Zones, and the On-Demand, Reserved Instance, and Spot Instance purchase models. With a single API call, you can now provision capacity to achieve desired scale, performance, and cost. -* `service/ssm`: Updates service API and documentation - * Added support for new parameter, DocumentVersion, for SendCommand API. Users can now specify version of SSM document to be executed on the target(s). - -Release v1.13.39 (2018-04-30) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/dynamodb`: Updates service API and documentation - * Adds two new APIs UpdateGlobalTableSettings and DescribeGlobalTableSettings. This update introduces new constraints in the CreateGlobalTable and UpdateGlobalTable APIs . Tables must have the same write capacity units. If Global Secondary Indexes exist then they must have the same write capacity units and key schema. -* `service/guardduty`: Updates service API and documentation - * You can disable the email notification when inviting GuardDuty members using the disableEmailNotification parameter in the InviteMembers operation. -* `service/route53domains`: Updates service API and documentation - * This release adds a SubmittedSince attribute to the ListOperations API, so you can list operations that were submitted after a specified date and time. -* `service/sagemaker`: Updates service API and documentation - * SageMaker has added support for VPC configuration for both Endpoints and Training Jobs. This allows you to connect from the instances running the Endpoint or Training Job to your VPC and any resources reachable in the VPC rather than being restricted to resources that were internet accessible. -* `service/workspaces`: Updates service API and documentation - * Added new IP Access Control APIs, an API to change the state of a Workspace, and the ADMIN_MAINTENANCE WorkSpace state. With the new IP Access Control APIs, you can now create/delete IP Access Control Groups, add/delete/update rules for IP Access Control Groups, Associate/Disassociate IP Access Control Groups to/from a WorkSpaces Directory, and Describe IP Based Access Control Groups. - -Release v1.13.38 (2018-04-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glacier`: Updates service documentation - * Documentation updates for Glacier to fix a broken link -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -Release v1.13.37 (2018-04-25) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * AWS CodeDeploy has a new exception that indicates when a GitHub token is not valid. -* `service/rekognition`: Updates service documentation - * Documentation updates for Amazon Rekognition. -* `service/xray`: Updates service API and documentation - * Added PutEncryptionConfig and GetEncryptionConfig APIs for managing data encryption settings. Use PutEncryptionConfig to configure X-Ray to use an AWS Key Management Service customer master key to encrypt trace data at rest. - -Release v1.13.36 (2018-04-24) -=== - -### Service Client Updates -* `service/elasticbeanstalk`: Updates service API and documentation - * Support tracking Elastic Beanstalk resources in AWS Config. -* `service/secretsmanager`: Updates service documentation - * Documentation updates for secretsmanager - -Release v1.13.35 (2018-04-23) -=== - -### Service Client Updates -* `service/autoscaling-plans`: Updates service API and documentation -* `service/iot`: Updates service API and documentation - * Add IotAnalyticsAction which sends message data to an AWS IoT Analytics channel -* `service/iotanalytics`: Adds new service - -### SDK Enhancements -* `aws/endpoints`: Add Get Region description to endpoints package ([#1909](https://github.com/aws/aws-sdk-go/pull/1909)) - * Adds exposing the description field of the endpoints Region struct. - * Fixes [#1194](https://github.com/aws/aws-sdk-go/issues/1194) - -### SDK Bugs -* Fix XML unmarshaler not correctly unmarshaling list of timestamp values ([#1894](https://github.com/aws/aws-sdk-go/pull/1894)) - * Fixes a bug in the XML unmarshaler that would incorrectly try to unmarshal "time.Time" parameters that did not have the struct tag type on them. This would occur for nested lists like CloudWatch's GetMetricDataResponse MetricDataResults timestamp parameters. - * Fixes [#1892](https://github.com/aws/aws-sdk-go/issues/1892) - -Release v1.13.34 (2018-04-20) -=== - -### Service Client Updates -* `service/firehose`: Updates service API and documentation - * With this release, Amazon Kinesis Data Firehose allows you to tag your delivery streams. Tags are metadata that you can create and use to manage your delivery streams. For more information about tagging, see AWS Tagging Strategies. For technical documentation, look for the tagging operations in the Amazon Kinesis Firehose API reference. -* `service/medialive`: Updates service API and documentation - * With AWS Elemental MediaLive you can now output live channels as RTMP (Real-Time Messaging Protocol) and RTMPS as the encrypted version of the protocol (Secure, over SSL/TLS). RTMP is the preferred protocol for sending live streams to popular social platforms which means you can send live channel content to social and sharing platforms in a secure and reliable way while continuing to stream to your own website, app or network. - -Release v1.13.33 (2018-04-19) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/codepipeline`: Updates service API and documentation - * Added new SourceRevision structure to Execution Summary with accompanying definitions as needed in the AWS CodePipeline API Guide. -* `service/devicefarm`: Updates service API and documentation - * Adding support for VPCEndpoint feature. Allows customers to be able to access their private endpoints/services running in their VPC during test automation. -* `service/ec2`: Updates service API and documentation - * Added support for customers to see the time at which a Dedicated Host was allocated or released. -* `service/rds`: Updates service API and documentation - * The ModifyDBCluster operation now includes an EngineVersion parameter. You can use this to upgrade the engine for a clustered database. -* `service/secretsmanager`: Updates service documentation and examples - * Documentation updates -* `service/ssm`: Updates service API and documentation - * Added new APIs DeleteInventory and DescribeInventoryDeletions, for customers to delete their custom inventory data. - -Release v1.13.32 (2018-04-10) -=== - -### Service Client Updates -* `service/dms`: Updates service API and documentation - * Native Change Data Capture start point and task recovery support in Database Migration Service. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * "AWS Glue now supports timeout values for ETL jobs. With this release, all new ETL jobs have a default timeout value of 48 hours. AWS Glue also now supports the ability to start a schedule or job events trigger when it is created." -* `service/mediapackage`: Updates service API and documentation - * Adds a new OriginEndpoint package type CmafPackage in MediaPackage. Origin endpoints can now be configured to use the Common Media Application Format (CMAF) media streaming format. This version of CmafPackage only supports HTTP Live Streaming (HLS) manifests with fragmented MP4. -* `service/ssm`: Updates service API and documentation - * Added TooManyUpdates exception for AddTagsToResource and RemoveTagsFromResource API -* `service/workmail`: Updates service API, documentation, and paginators - * Amazon WorkMail adds the ability to grant users and groups with "Full Access", "Send As" and "Send on Behalf" permissions on a given mailbox. - -Release v1.13.31 (2018-04-09) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * Cloud Directory customers can fetch attributes within a facet on an object with the new GetObjectAttributes API and can fetch attributes from multiple facets or objects with the BatchGetObjectAttributes operation. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.30 (2018-04-06) -=== - -### Service Client Updates -* `service/batch`: Updates service API and documentation - * Support for Timeout in SubmitJob and RegisterJobDefinition - -Release v1.13.29 (2018-04-05) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/ssm`: Updates service documentation - -Release v1.13.28 (2018-04-04) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * AWS Certificate Manager has added support for AWS Certificate Manager Private Certificate Authority (CA). Customers can now request private certificates with the RequestCertificate API, and also export private certificates with the ExportCertificate API. -* `service/acm-pca`: Adds new service -* `service/config`: Updates service API and documentation -* `service/fms`: Adds new service -* `service/monitoring`: Updates service API and documentation - * The new GetMetricData API enables you to collect batch amounts of metric data and optionally perform math expressions on the data. With one GetMetricData call you can retrieve as many as 100 different metrics and a total of 100,800 data points. -* `service/s3`: Updates service API and documentation - * ONEZONE_IA storage class stores object data in only one Availability Zone at a lower price than STANDARD_IA. This SDK release provides API support for this new storage class. -* `service/sagemaker`: Updates service API and documentation - * SageMaker is now supporting many additional instance types in previously supported families for Notebooks, Training Jobs, and Endpoints. Training Jobs and Endpoints now support instances in the m5 family in addition to the previously supported instance families. For specific instance types supported please see the documentation for the SageMaker API. -* `service/secretsmanager`: Adds new service - * AWS Secrets Manager enables you to easily create and manage the secrets that you use in your customer-facing apps. Instead of embedding credentials into your source code, you can dynamically query Secrets Manager from your app whenever you need credentials. You can automatically and frequently rotate your secrets without having to deploy updates to your apps. All secret values are encrypted when they're at rest with AWS KMS, and while they're in transit with HTTPS and TLS. -* `service/transcribe`: Updates service API, documentation, and paginators - -Release v1.13.27 (2018-04-03) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * Added Private Device Management feature. Customers can now manage their private devices efficiently - view their status, set labels and apply profiles on them. Customers can also schedule automated tests and remote access sessions on individual instances in their private device fleet. -* `service/lambda`: Updates service API and documentation - * added nodejs8.10 as a valid runtime -* `service/translate`: Updates service API and documentation - -Release v1.13.26 (2018-04-02) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Amazon API Gateway now supports resource policies for APIs making it easier to set access controls for invoking APIs. -* `service/cloudfront`: Adds new service - * You can now use a new Amazon CloudFront capability called Field-Level Encryption to further enhance the security of sensitive data, such as credit card numbers or personally identifiable information (PII) like social security numbers. CloudFront's field-level encryption further encrypts sensitive data in an HTTPS form using field-specific encryption keys (which you supply) before a POST request is forwarded to your origin. This ensures that sensitive data can only be decrypted and viewed by certain components or services in your application stack. Field-level encryption is easy to setup. Simply configure the fields that have to be further encrypted by CloudFront using the public keys you specify and you can reduce attack surface for your sensitive data. -* `service/es`: Updates service API and documentation - * This adds Amazon Cognito authentication support to Kibana. - -Release v1.13.25 (2018-03-30) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * Documentation updates for acm -* `service/connect`: Adds new service -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.24 (2018-03-29) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API, documentation, and paginators -* `service/cloudformation`: Updates service API and documentation - * Enabling resource level permission control for StackSets APIs. Adding support for customers to use customized AdministrationRole to create security boundaries between different users. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/greengrass`: Updates service API and documentation - * Greengrass APIs now support creating Machine Learning resource types and configuring binary data as the input payload for Greengrass Lambda functions. -* `service/ssm`: Updates service API - * This Patch Manager release supports creating patch baselines for CentOS. - -Release v1.13.23 (2018-03-28) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iam`: Updates service API and documentation - * Add support for Longer Role Sessions. Four APIs manage max session duration: GetRole, ListRoles, CreateRole, and the new API UpdateRole. The max session duration integer attribute is measured in seconds. -* `service/mturk-requester`: Updates service API and documentation -* `service/sts`: Updates service API and documentation - * Change utilizes the Max Session Duration attribute introduced for IAM Roles and allows STS customers to request session duration up to the Max Session Duration of 12 hours from AssumeRole based APIs. - -Release v1.13.22 (2018-03-27) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * AWS Certificate Manager has added support for customers to disable Certificate Transparency logging on a per-certificate basis. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.21 (2018-03-26) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service API and documentation - * Point-in-time recovery (PITR) provides continuous backups of your DynamoDB table data. With PITR, you do not have to worry about creating, maintaining, or scheduling backups. You enable PITR on your table and your backup is available for restore at any point in time from the moment you enable it, up to a maximum of the 35 preceding days. PITR provides continuous backups until you explicitly disable it. For more information, see the Amazon DynamoDB Developer Guide. - -Release v1.13.20 (2018-03-23) -=== - -### Service Client Updates -* `service/rds`: Updates service documentation - * Documentation updates for RDS - -Release v1.13.19 (2018-03-22) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Feedback URL allows admins to provide a feedback link or a survey link for collecting user feedback while streaming sessions. When a feedback link is provided, streaming users will see a "Send Feedback" choice in their streaming session toolbar. On selecting this choice, user will be redirected to the link provided in a new browser tab. If a feedback link is not provided, users will not see the "Send Feedback" option. -* `service/codebuild`: Updates service API and documentation - * Adding support for branch filtering when using webhooks with AWS CodeBuild. -* `service/ecs`: Updates service API and documentation - * Amazon Elastic Container Service (ECS) now includes integrated Service Discovery using Route 53 Auto Naming. Customers can now specify a Route 53 Auto Naming service as part of an ECS service. ECS will register task IPs with Route 53, making them available via DNS in your VPC. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -### SDK Bugs -* `aws/endpoints`: Use service metadata for fallback signing name ([#1854](https://github.com/aws/aws-sdk-go/pull/1854)) - * Updates the SDK's endpoint resolution to fallback deriving the service's signing name from the service's modeled metadata in addition the endpoints modeled data. - * Fixes [#1850](https://github.com/aws/aws-sdk-go/issues/1850) - -Release v1.13.18 (2018-03-21) -=== - -### Service Client Updates -* `service/serverlessrepo`: Updates service documentation - -Release v1.13.17 (2018-03-20) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/config`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * Amazon ECS users can now mount a temporary volume in memory in containers and specify the shared memory that a container can use through the use of docker's 'tmpfs' and 'shm-size' features respectively. These fields can be specified under linuxParameters in ContainerDefinition in the Task Definition Template. -* `service/elasticbeanstalk`: Updates service documentation - * Documentation updates for the new Elastic Beanstalk API DescribeAccountAttributes. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/events`: Updates service API and documentation - * Added SQS FIFO queue target support -* `service/glue`: Updates service API and documentation - * API Updates for DevEndpoint: PublicKey is now optional for CreateDevEndpoint. The new DevEndpoint field PrivateAddress will be populated for DevEndpoints associated with a VPC. -* `service/medialive`: Updates service API and documentation - * AWS Elemental MediaLive has added support for updating Inputs and Input Security Groups. You can update Input Security Groups at any time and it will update all channels using that Input Security Group. Inputs can be updated as long as they are not attached to a currently running channel. - -Release v1.13.16 (2018-03-16) -=== - -### Service Client Updates -* `service/elasticbeanstalk`: Updates service API and documentation - * AWS Elastic Beanstalk is launching a new public API named DescribeAccountAttributes which allows customers to access account level attributes. In this release, the API will support quotas for resources such as applications, application versions, and environments. - -Release v1.13.15 (2018-03-15) -=== - -### Service Client Updates -* `service/organizations`: Updates service API and documentation - * This release adds additional reason codes to improve clarity to exceptions that can occur. -* `service/pinpoint`: Updates service API and documentation - * With this release, you can delete endpoints from your Amazon Pinpoint projects. Customers can now specify one of their leased dedicated long or short codes to send text messages. -* `service/sagemaker`: Updates service API, documentation, and paginators - * This release provides support for ml.p3.xlarge instance types for notebook instances. Lifecycle configuration is now available to customize your notebook instances on start; the configuration can be reused between multiple notebooks. If a notebook instance is attached to a VPC you can now opt out of internet access that by default is provided by SageMaker. - -Release v1.13.14 (2018-03-14) -=== - -### Service Client Updates -* `service/lightsail`: Updates service API and documentation - * Updates to existing Lightsail documentation - -Release v1.13.13 (2018-03-13) -=== - -### Service Client Updates -* `service/servicediscovery`: Updates service API and documentation - * This release adds support for custom health checks, which let you check the health of resources that aren't accessible over the internet. For example, you can use a custom health check when the instance is in an Amazon VPC. - -Release v1.13.12 (2018-03-12) -=== - -### Service Client Updates -* `service/cloudhsmv2`: Updates service API - * CreateCluster can now take both 8 and 17 character Subnet IDs. DeleteHsm can now take both 8 and 17 character ENI IDs. -* `service/discovery`: Updates service API and documentation - * Documentation updates for discovery -* `service/iot`: Updates service API and documentation - * We added new fields to the response of the following APIs. (1) describe-certificate: added new generationId, customerVersion fields (2) describe-ca-certificate: added new generationId, customerVersion and lastModifiedDate fields (3) get-policy: added generationId, creationDate and lastModifiedDate fields -* `service/redshift`: Updates service API and documentation - * DescribeClusterSnapshotsMessage with ClusterExists flag returns snapshots of existing clusters. Else both existing and deleted cluster snapshots are returned - -Release v1.13.11 (2018-03-08) -=== - -### Service Client Updates -* `service/AWSMigrationHub`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * Amazon Elastic Container Service (ECS) now supports container health checks. Customers can now specify a docker container health check command and parameters in their task definition. ECS will monitor, report and take scheduling action based on the health status. -* `service/pinpoint`: Updates service API and documentation - * With this release, you can export endpoints from your Amazon Pinpoint projects. You can export a) all of the endpoints assigned to a project or b) the subset of endpoints assigned to a segment. -* `service/rds`: Updates service documentation - * Documentation updates for RDS - -Release v1.13.10 (2018-03-07) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/medialive`: Updates service API and documentation - * Updates API to model required traits and minimum/maximum constraints. - -Release v1.13.9 (2018-03-06) -=== - -### Service Client Updates -* `service/ecs`: Updates service documentation - * Documentation updates for Amazon ECS -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.8 (2018-03-01) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Added support for modifying Placement Group association of instances via ModifyInstancePlacement API. -* `service/events`: Updates service API and documentation - * Added BatchParameters to the PutTargets API -* `service/servicecatalog`: Updates service API and documentation - * This release of ServiceCatalog adds the DeleteTagOption API. -* `service/ssm`: Updates service API and documentation - * This Inventory release supports the status message details reported by the last sync for the resource data sync API. -* `service/storagegateway`: Updates service API and documentation - * AWS Storage Gateway (File) support for two new file share attributes are added. 1. Users can specify the S3 Canned ACL to use for new objects created in the file share. 2. Users can create file shares for requester-pays buckets. - -Release v1.13.7 (2018-02-28) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.6 (2018-02-27) -=== - -### Service Client Updates -* `service/ecr`: Updates service documentation - * Documentation updates for Amazon ECR. - -Release v1.13.5 (2018-02-26) -=== - -### Service Client Updates -* `service/route53`: Updates service API - * Added support for creating LBR rules using ap-northeast-3 region. -* `service/sts`: Updates service API and documentation - * Increased SAMLAssertion parameter size from 50000 to 100000 for AWS Security Token Service AssumeRoleWithSAML API to allow customers to pass bigger SAML assertions - -Release v1.13.4 (2018-02-23) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update is to enable customers to copy their Amazon AppStream 2.0 images within and between AWS Regions -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.3 (2018-02-22) -=== - -### Service Client Updates -* `service/ce`: Updates service API and documentation -* `service/elasticloadbalancingv2`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.13.2 (2018-02-21) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * This release adds an API for adding a file directly to an AWS CodeCommit repository without requiring a Git client. -* `service/ec2`: Updates service API and documentation - * Adds support for tagging an EBS snapshot as part of the API call that creates the EBS snapshot -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/serverlessrepo`: Updates service API, documentation, and paginators - -Release v1.13.1 (2018-02-20) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Amazon EC2 Auto Scaling support for service-linked roles -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/waf`: Updates service API and documentation - * The new PermissionPolicy APIs in AWS WAF Regional allow customers to attach resource-based policies to their entities. -* `service/waf-regional`: Updates service API and documentation - -Release v1.13.0 (2018-02-19) -=== - -### Service Client Updates -* `service/config`: Updates service API - * With this release, AWS Config updated the ConfigurationItemStatus enum values. The values prior to this update did not represent appropriate values returned by GetResourceConfigHistory. You must update your code to enumerate the new enum values so this is a breaking change. To map old properties to new properties, use the following descriptions: New discovered resource - Old property: Discovered, New property: ResourceDiscovered. Updated resource - Old property: Ok, New property: OK. Deleted resource - Old property: Deleted, New property: ResourceDeleted or ResourceDeletedNotRecorded. Not-recorded resource - Old property: N/A, New property: ResourceNotRecorded or ResourceDeletedNotRecorded. - -Release v1.12.79 (2018-02-16) -=== - -### Service Client Updates -* `service/rds`: Updates service API and documentation - * Updates RDS API to indicate whether a DBEngine supports read replicas. - -Release v1.12.78 (2018-02-15) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/gamelift`: Updates service API and documentation - * Updates to allow Fleets to run on On-Demand or Spot instances. -* `service/mediaconvert`: Updates service API and documentation - * Nielsen ID3 tags can now be inserted into transport stream (TS) and HLS outputs. For more information on Nielsen configuration you can go to https://docs.aws.amazon.com/mediaconvert/latest/apireference/jobs.html#jobs-nielsenconfiguration - -Release v1.12.77 (2018-02-14) -=== - -### Service Client Updates -* `service/appsync`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lex-models`: Updates service API and documentation - -### Bug Fixes -* `aws/request`: Fix support for streamed payloads for unsigned body request ([#1778](https://github.com/aws/aws-sdk-go/pull/1778)) - * Fixes the SDK's handling of the SDK's `ReaderSeekerCloser` helper type to not allow erroneous request retries, and request signature generation. This Fix allows you to use the `aws.ReaderSeekerCloser` to wrap an arbitrary `io.Reader` for request `io.ReadSeeker` input parameters. APIs such as lex-runtime's PostContent can now make use of the -ReaderSeekerCloser type without causing unexpected failures. - * Fixes [#1776](https://github.com/aws/aws-sdk-go/issues/1776) - -Release v1.12.76 (2018-02-13) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glacier`: Updates service documentation - * Documentation updates for glacier -* `service/route53`: Updates service API - * Added support for creating Private Hosted Zones and metric-based healthchecks in the ap-northeast-3 region for whitelisted customers. - -Release v1.12.75 (2018-02-12) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * Network interfaces now supply the following additional status of "associated" to better distinguish the current status. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/guardduty`: Updates service API and documentation - * Added PortProbeAction information to the Action section of the port probe-type finding. -* `service/kms`: Updates service API - * This release of AWS Key Management Service includes support for InvalidArnException in the RetireGrant API. -* `service/rds`: Updates service documentation - * Aurora MySQL now supports MySQL 5.7. - -Release v1.12.74 (2018-02-09) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Users can now better understand the longer ID opt-in status of their account using the two new APIs DescribeAggregateIdFormat and DescribePrincipalIdFormat -* `service/lex-models`: Updates service API and documentation -* `service/runtime.lex`: Updates service API and documentation - -Release v1.12.73 (2018-02-08) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Adds support for allowing customers to provide a redirect URL for a stack. Users will be redirected to the link provided by the admin at the end of their streaming session. -* `service/budgets`: Updates service API and documentation - * Making budgetLimit and timePeriod optional, and updating budgets docs. -* `service/dms`: Updates service API, documentation, and paginators - * This release includes the addition of two new APIs: describe replication instance task logs and reboot instance. The first allows user to see how much storage each log for a task on a given instance is occupying. The second gives users the option to reboot the application software on the instance and force a fail over for MAZ instances to test robustness of their integration with our service. -* `service/ds`: Updates service API - * Updated the regex of some input parameters to support longer EC2 identifiers. -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB now supports server-side encryption using a default service key (alias/aws/dynamodb) from the AWS Key Management Service (KMS). AWS KMS is a service that combines secure, highly available hardware and software to provide a key management system scaled for the cloud. AWS KMS is used via the AWS Management Console or APIs to centrally create encryption keys, define the policies that control how keys can be used, and audit key usage to prove they are being used correctly. For more information, see the Amazon DynamoDB Developer Guide. -* `service/gamelift`: Updates service API and documentation - * Amazon GameLift FlexMatch added the StartMatchBackfill API. This API allows developers to add new players to an existing game session using the same matchmaking rules and player data that were used to initially create the session. -* `service/medialive`: Updates service API and documentation - * AWS Elemental MediaLive has added support for updating channel settings for idle channels. You can now update channel name, channel outputs and output destinations, encoder settings, user role ARN, and input specifications. Channel settings can be updated in the console or with API calls. Please note that running channels need to be stopped before they can be updated. We've also deprecated the 'Reserved' field. -* `service/mediastore`: Updates service API and documentation - * AWS Elemental MediaStore now supports per-container CORS configuration. - -Release v1.12.72 (2018-02-07) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * This new feature will now allow customers to add a customized json classifier. They can specify a json path to indicate the object, array or field of the json documents they'd like crawlers to inspect when they crawl json files. -* `service/servicecatalog`: Updates service API, documentation, and paginators - * This release of Service Catalog adds SearchProvisionedProducts API and ProvisionedProductPlan APIs. -* `service/servicediscovery`: Updates service API and documentation - * This release adds support for registering CNAME record types and creating Route 53 alias records that route traffic to Amazon Elastic Load Balancers using Amazon Route 53 Auto Naming APIs. -* `service/ssm`: Updates service API and documentation - * This Patch Manager release supports configuring Linux repos as part of patch baselines, controlling updates of non-OS security packages and also creating patch baselines for SUSE12 - -### SDK Enhancements -* `private/model/api`: Add validation to ensure there is no duplication of services in models/apis ([#1758](https://github.com/aws/aws-sdk-go/pull/1758)) - * Prevents the SDK from mistakenly generating code a single service multiple times with different model versions. -* `example/service/ec2/instancesbyRegion`: Fix typos in example ([#1762](https://github.com/aws/aws-sdk-go/pull/1762)) -* `private/model/api`: removing SDK API reference crosslinks from input/output shapes. (#1765) - -### SDK Bugs -* `aws/session`: Fix bug in session.New not supporting AWS_SDK_LOAD_CONFIG ([#1770](https://github.com/aws/aws-sdk-go/pull/1770)) - * Fixes a bug in the session.New function that was not correctly sourcing the shared configuration files' path. - * Fixes [#1771](https://github.com/aws/aws-sdk-go/pull/1771) - -Release v1.12.71 (2018-02-05) -=== - -### Service Client Updates -* `service/acm`: Updates service documentation - * Documentation updates for acm -* `service/cloud9`: Updates service documentation and examples - * API usage examples for AWS Cloud9. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kinesis`: Updates service API and documentation - * Using ListShards a Kinesis Data Streams customer or client can get information about shards in a data stream (including meta-data for each shard) without obtaining data stream level information. -* `service/opsworks`: Updates service API, documentation, and waiters - * AWS OpsWorks Stacks supports EBS encryption and HDD volume types. Also, a new DescribeOperatingSystems API is available, which lists all operating systems supported by OpsWorks Stacks. - -Release v1.12.70 (2018-01-26) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * Add InteractionMode in CreateRemoteAccessSession for DirectDeviceAccess feature. -* `service/medialive`: Updates service API and documentation - * Add InputSpecification to CreateChannel (specification of input attributes is used for channel sizing and affects pricing); add NotFoundException to DeleteInputSecurityGroups. -* `service/mturk-requester`: Updates service documentation - -Release v1.12.69 (2018-01-26) -=== - -### SDK Bugs -* `models/api`: Fix colliding names [#1754](https://github.com/aws/aws-sdk-go/pull/1754) [#1756](https://github.com/aws/aws-sdk-go/pull/1756) - * SDK had duplicate folders that were causing errors in some builds. - * Fixes [#1753](https://github.com/aws/aws-sdk-go/issues/1753) - -Release v1.12.68 (2018-01-25) -=== - -### Service Client Updates -* `service/alexaforbusiness`: Updates service API and documentation -* `service/codebuild`: Updates service API and documentation - * Adding support for Shallow Clone and GitHub Enterprise in AWS CodeBuild. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/guardduty`: Adds new service - * Added the missing AccessKeyDetails object to the resource shape. -* `service/lambda`: Updates service API and documentation - * AWS Lambda now supports Revision ID on your function versions and aliases, to track and apply conditional updates when you are updating your function version or alias resources. - -### SDK Bugs -* `service/s3/s3manager`: Fix check for nil OrigErr in Error() [#1749](https://github.com/aws/aws-sdk-go/issues/1749) - * S3 Manager's `Error` type did not check for nil of `OrigErr` when calling `Error()` - * Fixes [#1748](https://github.com/aws/aws-sdk-go/issues/1748) - -Release v1.12.67 (2018-01-22) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Add additional costTypes: IncludeDiscount, UseAmortized, to support finer control for different charges included in a cost budget. - -Release v1.12.66 (2018-01-19) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glue`: Updates service API and documentation - * New AWS Glue DataCatalog APIs to manage table versions and a new feature to skip archiving of the old table version when updating table. -* `service/transcribe`: Adds new service - -Release v1.12.65 (2018-01-18) -=== - -### Service Client Updates -* `service/sagemaker`: Updates service API and documentation - * CreateTrainingJob and CreateEndpointConfig now supports KMS Key for volume encryption. - -Release v1.12.64 (2018-01-17) -=== - -### Service Client Updates -* `service/autoscaling-plans`: Updates service documentation -* `service/ec2`: Updates service documentation - * Documentation updates for EC2 - -Release v1.12.63 (2018-01-17) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/autoscaling-plans`: Adds new service -* `service/rds`: Updates service API and documentation - * With this release you can now integrate RDS DB instances with CloudWatch Logs. We have added parameters to the operations for creating and modifying DB instances (for example CreateDBInstance) to allow you to take advantage of this capability through the CLI and API. Once you enable this feature, a stream of log events will publish to CloudWatch Logs for each log type you enable. - -Release v1.12.62 (2018-01-15) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lambda`: Updates service API and documentation - * Support for creating Lambda Functions using 'dotnetcore2.0' and 'go1.x'. - -Release v1.12.61 (2018-01-12) -=== - -### Service Client Updates -* `service/glue`: Updates service API and documentation - * Support is added to generate ETL scripts in Scala which can now be run by AWS Glue ETL jobs. In addition, the trigger API now supports firing when any conditions are met (in addition to all conditions). Also, jobs can be triggered based on a "failed" or "stopped" job run (in addition to a "succeeded" job run). - -Release v1.12.60 (2018-01-11) -=== - -### Service Client Updates -* `service/elasticloadbalancing`: Updates service API and documentation -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/rds`: Updates service API and documentation - * Read Replicas for Amazon RDS for MySQL, MariaDB, and PostgreSQL now support Multi-AZ deployments.Amazon RDS Read Replicas enable you to create one or more read-only copies of your database instance within the same AWS Region or in a different AWS Region. Updates made to the source database are asynchronously copied to the Read Replicas. In addition to providing scalability for read-heavy workloads, you can choose to promote a Read Replica to become standalone a DB instance when needed.Amazon RDS Multi-AZ Deployments provide enhanced availability for database instances within a single AWS Region. With Multi-AZ, your data is synchronously replicated to a standby in a different Availability Zone (AZ). In case of an infrastructure failure, Amazon RDS performs an automatic failover to the standby, minimizing disruption to your applications.You can now combine Read Replicas with Multi-AZ as part of a disaster recovery strategy for your production databases. A well-designed and tested plan is critical for maintaining business continuity after a disaster. Since Read Replicas can also be created in different regions than the source database, your Read Replica can be promoted to become the new production database in case of a regional disruption.You can also combine Read Replicas with Multi-AZ for your database engine upgrade process. You can create a Read Replica of your production database instance and upgrade it to a new database engine version. When the upgrade is complete, you can stop applications, promote the Read Replica to a standalone database instance and switch over your applications. Since the database instance is already a Multi-AZ deployment, no additional steps are needed.For more information, see the Amazon RDS User Guide. -* `service/ssm`: Updates service documentation - * Updates documentation for the HierarchyLevelLimitExceededException error. - -Release v1.12.59 (2018-01-09) -=== - -### Service Client Updates -* `service/kms`: Updates service documentation - * Documentation updates for AWS KMS - -Release v1.12.58 (2018-01-09) -=== - -### Service Client Updates -* `service/ds`: Updates service API and documentation - * On October 24 we introduced AWS Directory Service for Microsoft Active Directory (Standard Edition), also known as AWS Microsoft AD (Standard Edition), which is a managed Microsoft Active Directory (AD) that is optimized for small and midsize businesses (SMBs). With this SDK release, you can now create an AWS Microsoft AD directory using API. This enables you to run typical SMB workloads using a cost-effective, highly available, and managed Microsoft AD in the AWS Cloud. - -Release v1.12.57 (2018-01-08) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * The AWS CodeDeploy API was updated to support DeleteGitHubAccountToken, a new method that deletes a GitHub account connection. -* `service/discovery`: Updates service API and documentation - * Documentation updates for AWS Application Discovery Service. -* `service/route53`: Updates service API and documentation - * This release adds an exception to the CreateTrafficPolicyVersion API operation. - -Release v1.12.56 (2018-01-05) -=== - -### Service Client Updates -* `service/inspector`: Updates service API, documentation, and examples - * Added 2 new attributes to the DescribeAssessmentTemplate response, indicating the total number of assessment runs and last assessment run ARN (if present.) -* `service/snowball`: Updates service documentation - * Documentation updates for snowball -* `service/ssm`: Updates service documentation - * Documentation updates for ssm - -Release v1.12.55 (2018-01-02) -=== - -### Service Client Updates -* `service/rds`: Updates service documentation - * Documentation updates for rds - -Release v1.12.54 (2017-12-29) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/workspaces`: Updates service API and documentation - * Modify WorkSpaces have been updated with flexible storage and switching of hardware bundles feature. The following configurations have been added to ModifyWorkSpacesProperties: storage and compute. This update provides the capability to configure the storage of a WorkSpace. It also adds the capability of switching hardware bundle of a WorkSpace by specifying an eligible compute (Value, Standard, Performance, Power). - -Release v1.12.53 (2017-12-22) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * This release fixes an issue with tags not showing in DescribeAddresses responses. -* `service/ecs`: Updates service API and documentation - * Amazon ECS users can now set a health check initialization wait period of their ECS services, the services that are associated with an Elastic Load Balancer (ELB) will wait for a period of time before the ELB become healthy. You can now configure this in Create and Update Service. -* `service/inspector`: Updates service API and documentation - * PreviewAgents API now returns additional fields within the AgentPreview data type. The API now shows the agent health and availability status for all instances included in the assessment target. This allows users to check the health status of Inspector Agents before running an assessment. In addition, it shows the instance ID, hostname, and IP address of the targeted instances. -* `service/sagemaker`: Updates service API and documentation - * SageMaker Models no longer support SupplementalContainers. API's that have been affected are CreateModel and DescribeModel. - -Release v1.12.52 (2017-12-21) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Adding support allowing AWS CodeBuild customers to select specific curated image versions. -* `service/ec2`: Updates service API and documentation - * Elastic IP tagging enables you to add key and value metadata to your Elastic IPs so that you can search, filter, and organize them according to your organization's needs. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kinesisanalytics`: Updates service API and documentation - * Kinesis Analytics now supports AWS Lambda functions as output. - -Release v1.12.51 (2017-12-21) -=== - -### Service Client Updates -* `service/config`: Updates service API -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API and documentation - * This release adds support for code signed Over-the-air update functionality for Amazon FreeRTOS. Users can now create and schedule Over-the-air updates to their Amazon FreeRTOS devices using these new APIs. - -Release v1.12.50 (2017-12-19) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * API Gateway now adds support for calling API with compressed payloads using one of the supported content codings, tagging an API stage for cost allocation, and returning API keys from a custom authorizer for use with a usage plan. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mediastore-data`: Updates service documentation -* `service/route53`: Updates service API and documentation - * Route 53 added support for a new China (Ningxia) region, cn-northwest-1. You can now specify cn-northwest-1 as the region for latency-based or geoproximity routing. Route 53 also added support for a new EU (Paris) region, eu-west-3. You can now associate VPCs in eu-west-3 with private hosted zones and create alias records that route traffic to resources in eu-west-3. - -Release v1.12.49 (2017-12-19) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/monitoring`: Updates service documentation - * Documentation updates for monitoring - -Release v1.12.48 (2017-12-15) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update is to enable customers to add tags to their Amazon AppStream 2.0 resources - -Release v1.12.47 (2017-12-14) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Adds support for Cognito Authorizer scopes at the API method level. -* `service/email`: Updates service documentation - * Added information about the maximum number of transactions per second for the SendCustomVerificationEmail operation. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.46 (2017-12-12) -=== - -### Service Client Updates -* `service/workmail`: Adds new service - * Today, Amazon WorkMail released an administrative SDK and enabled AWS CloudTrail integration. With the administrative SDK, you can natively integrate WorkMail with your existing services. The SDK enables programmatic user, resource, and group management through API calls. This means your existing IT tools and workflows can now automate WorkMail management, and third party applications can streamline WorkMail migrations and account actions. - -Release v1.12.45 (2017-12-11) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lex-models`: Updates service API and documentation -* `service/sagemaker`: Updates service API - * CreateModel API Update: The request parameter 'ExecutionRoleArn' has changed from optional to required. - -Release v1.12.44 (2017-12-08) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * This API update is to support the feature that allows customers to automatically consume the latest Amazon AppStream 2.0 agent as and when published by AWS. -* `service/ecs`: Updates service documentation - * Documentation updates for Windows containers. -* `service/monitoring`: Updates service API and documentation - * With this launch, you can now create a CloudWatch alarm that alerts you when M out of N datapoints of a metric are breaching your predefined threshold, such as three out of five times in any given five minutes interval or two out of six times in a thirty minutes interval. When M out of N datapoints are not breaching your threshold in an interval, the alarm will be in OK state. Please note that the M datapoints out of N datapoints in an interval can be of any order and does not need to be consecutive. Consequently, you can now get alerted even when the spikes in your metrics are intermittent over an interval. - -Release v1.12.43 (2017-12-07) -=== - -### Service Client Updates -* `service/email`: Updates service API, documentation, and paginators - * Customers can customize the emails that Amazon SES sends when verifying new identities. This feature is helpful for developers whose applications send email through Amazon SES on behalf of their customers. -* `service/es`: Updates service API and documentation - * Added support for encryption of data at rest on Amazon Elasticsearch Service using AWS KMS - -### SDK Bugs -* `models/apis` Fixes removes colliding sagemaker models folders ([#1686](https://github.com/aws/aws-sdk-go/pull/1686)) - * Fixes Release v1.12.42's SageMaker vs sagemaker model folders. - -Release v1.12.42 (2017-12-06) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * Amazon Cloud Directory makes it easier for you to apply schema changes across your directories with in-place schema upgrades. Your directories now remain available while backward-compatible schema changes are being applied, such as the addition of new fields. You also can view the history of your schema changes in Cloud Directory by using both major and minor version identifiers, which can help you track and audit schema versions across directories. -* `service/elasticbeanstalk`: Updates service documentation - * Documentation updates for AWS Elastic Beanstalk. -* `service/sagemaker`: Adds new service - * Initial waiters for common SageMaker workflows. - -Release v1.12.41 (2017-12-05) -=== - -### Service Client Updates -* `service/iot`: Updates service API and documentation - * Add error action API for RulesEngine. -* `service/servicecatalog`: Updates service API and documentation - * ServiceCatalog has two distinct personas for its use, an "admin" persona (who creates sets of products with different versions and prescribes who has access to them) and an "end-user" persona (who can launch cloud resources based on the configuration data their admins have given them access to). This API update will allow admin users to deactivate/activate product versions, end-user will only be able to access and launch active product versions. -* `service/servicediscovery`: Adds new service - * Amazon Route 53 Auto Naming lets you configure public or private namespaces that your microservice applications run in. When instances of the service become available, you can call the Auto Naming API to register the instance, and Amazon Route 53 automatically creates up to five DNS records and an optional health check. Clients that submit DNS queries for the service receive an answer that contains up to eight healthy records. - -Release v1.12.40 (2017-12-04) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Add additional costTypes to support finer control for different charges included in a cost budget. -* `service/ecs`: Updates service documentation - * Documentation updates for ecs - -Release v1.12.39 (2017-12-01) -=== - -### Service Client Updates -* `service/SageMaker`: Updates service waiters - -Release v1.12.38 (2017-11-30) -=== - -### Service Client Updates -* `service/AWSMoneypenny`: Adds new service -* `service/Cloud9`: Adds new service -* `service/Serverless Registry`: Adds new service -* `service/apigateway`: Updates service API, documentation, and paginators - * Added support Private Integration and VPC Link features in API Gateway. This allows to create an API with the API Gateway private integration, thus providing clients access to HTTP/HTTPS resources in an Amazon VPC from outside of the VPC through a VpcLink resource. -* `service/ec2`: Updates service API and documentation - * Adds the following updates: 1. Spread Placement ensures that instances are placed on distinct hardware in order to reduce correlated failures. 2. Inter-region VPC Peering allows customers to peer VPCs across different AWS regions without requiring additional gateways, VPN connections or physical hardware -* `service/lambda`: Updates service API and documentation - * AWS Lambda now supports the ability to set the concurrency limits for individual functions, and increasing memory to 3008 MB. - -Release v1.12.37 (2017-11-30) -=== - -### Service Client Updates -* `service/Ardi`: Adds new service -* `service/autoscaling`: Updates service API and documentation - * You can now use Auto Scaling with EC2 Launch Templates via the CreateAutoScalingGroup and UpdateAutoScalingGroup APIs. -* `service/ec2`: Updates service API and documentation - * Adds the following updates: 1. T2 Unlimited enables high CPU performance for any period of time whenever required 2. You are now able to create and launch EC2 m5 and h1 instances -* `service/lightsail`: Updates service API and documentation - * This release adds support for load balancer and TLS/SSL certificate management. This set of APIs allows customers to create, manage, and scale secure load balanced applications on Lightsail infrastructure. To provide support for customers who manage their DNS on Lightsail, we've added the ability create an Alias A type record which can point to a load balancer DNS name via the CreateDomainEntry API http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_CreateDomainEntry.html. -* `service/ssm`: Updates service API and documentation - * This release updates AWS Systems Manager APIs to enable executing automations at controlled rate, target resources in a resource groups and execute entire automation at once or single step at a time. It is now also possible to use YAML, in addition to JSON, when creating Systems Manager documents. -* `service/waf`: Updates service API and documentation - * This release adds support for rule group and managed rule group. Rule group is a container of rules that customers can create, put rules in it and associate the rule group to a WebACL. All rules in a rule group will function identically as they would if each rule was individually associated to the WebACL. Managed rule group is a pre-configured rule group composed by our security partners and made available via the AWS Marketplace. Customers can subscribe to these managed rule groups, associate the managed rule group to their WebACL and start using them immediately to protect their resources. -* `service/waf-regional`: Updates service API and documentation - -Release v1.12.36 (2017-11-29) -=== - -### Service Client Updates -* `service/DeepInsight`: Adds new service -* `service/IronmanRuntime`: Adds new service -* `service/Orchestra - Laser`: Adds new service -* `service/SageMaker`: Adds new service -* `service/Shine`: Adds new service -* `service/archived.kinesisvideo`: Adds new service -* `service/data.kinesisvideo`: Adds new service -* `service/dynamodb`: Updates service API and documentation - * Amazon DynamoDB now supports the following features: Global Table and On-Demand Backup. Global Table is a fully-managed, multi-region, multi-master database. DynamoDB customers can now write anywhere and read anywhere with single-digit millisecond latency by performing database operations closest to where end users reside. Global Table also enables customers to disaster-proof their applications, keeping them running and data accessible even in the face of natural disasters or region disruptions. Customers can set up Global Table with just a few clicks in the AWS Management Console-no application rewrites required. On-Demand Backup capability is to protect data from loss due to application errors, and meet customers' archival needs for compliance and regulatory reasons. Customers can backup and restore their DynamoDB table data anytime, with a single-click in the AWS management console or a single API call. Backup and restore actions execute with zero impact on table performance or availability. For more information, see the Amazon DynamoDB Developer Guide. -* `service/ecs`: Updates service API and documentation - * Amazon Elastic Container Service (Amazon ECS) released a new launch type for running containers on a serverless infrastructure. The Fargate launch type allows you to run your containerized applications without the need to provision and manage the backend infrastructure. Just register your task definition and Fargate launches the container for you. -* `service/glacier`: Updates service API and documentation - * This release includes support for Glacier Select, a new feature that allows you to filter and analyze your Glacier archives and store the results in a user-specified S3 location. -* `service/greengrass`: Updates service API and documentation - * Greengrass OTA feature allows updating Greengrass Core and Greengrass OTA Agent. Local Resource Access feature allows Greengrass Lambdas to access local resources such as peripheral devices and volumes. -* `service/iot`: Updates service API and documentation - * This release adds support for a number of new IoT features, including AWS IoT Device Management (Jobs, Fleet Index and Thing Registration), Thing Groups, Policies on Thing Groups, Registry & Job Events, JSON Logs, Fine-Grained Logging Controls, Custom Authorization and AWS Service Authentication Using X.509 Certificates. -* `service/kinesisvideo`: Adds new service - * Announcing Amazon Kinesis Video Streams, a fully managed video ingestion and storage service. Kinesis Video Streams makes it easy to securely stream video from connected devices to AWS for machine learning, analytics, and processing. You can also stream other time-encoded data like RADAR and LIDAR signals using Kinesis Video Streams. -* `service/rekognition`: Updates service API, documentation, and paginators - * This release introduces Amazon Rekognition support for video analysis. -* `service/s3`: Updates service API and documentation - * This release includes support for Glacier Select, a new feature that allows you to filter and analyze your Glacier storage class objects and store the results in a user-specified S3 location. - -Release v1.12.35 (2017-11-29) -=== - -### Service Client Updates -* `service/AmazonMQ`: Adds new service -* `service/GuardDuty`: Adds new service -* `service/apigateway`: Updates service API and documentation - * Changes related to CanaryReleaseDeployment feature. Enables API developer to create a deployment as canary deployment and test API changes with percentage of customers before promoting changes to all customers. -* `service/batch`: Updates service API and documentation - * Add support for Array Jobs which allow users to easily submit many copies of a job with a single API call. This change also enhances the job dependency model to support N_TO_N and sequential dependency chains. The ListJobs and DescribeJobs APIs now have the ability to list or describe the status of entire Array Jobs or individual elements within the array. -* `service/cognito-idp`: Updates service API and documentation -* `service/deepdish`: Adds new service - * AWS AppSync is an enterprise-level, fully managed GraphQL service with real-time data synchronization and offline programming features. -* `service/ec2`: Updates service API and documentation - * Adds the following updates: 1. You are now able to host a service powered by AWS PrivateLink to provide private connectivity to other VPCs. You are now also able to create endpoints to other services powered by PrivateLink including AWS services, Marketplace Seller services or custom services created by yourself or other AWS VPC customers. 2. You are now able to save launch parameters in a single template that can be used with Auto Scaling, Spot Fleet, Spot, and On Demand instances. 3. You are now able to launch Spot instances via the RunInstances API, using a single additional parameter. RunInstances will response synchronously with an instance ID should capacity be available for your Spot request. 4. A simplified Spot pricing model which delivers low, predictable prices that adjust gradually, based on long-term trends in supply and demand. 5. Amazon EC2 Spot can now hibernate Amazon EBS-backed instances in the event of an interruption, so your workloads pick up from where they left off. Spot can fulfill your request by resuming instances from a hibernated state when capacity is available. -* `service/lambda`: Updates service API and documentation - * Lambda aliases can now shift traffic between two function versions, based on preassigned weights. - -Release v1.12.34 (2017-11-27) -=== - -### Service Client Updates -* `service/data.mediastore`: Adds new service -* `service/mediaconvert`: Adds new service - * AWS Elemental MediaConvert is a file-based video conversion service that transforms media into formats required for traditional broadcast and for internet streaming to multi-screen devices. -* `service/medialive`: Adds new service - * AWS Elemental MediaLive is a video service that lets you easily create live outputs for broadcast and streaming delivery. -* `service/mediapackage`: Adds new service - * AWS Elemental MediaPackage is a just-in-time video packaging and origination service that lets you format highly secure and reliable live outputs for a variety of devices. -* `service/mediastore`: Adds new service - * AWS Elemental MediaStore is an AWS storage service optimized for media. It gives you the performance, consistency, and low latency required to deliver live and on-demand video content. AWS Elemental MediaStore acts as the origin store in your video workflow. - -Release v1.12.33 (2017-11-22) -=== - -### Service Client Updates -* `service/acm`: Updates service API and documentation - * AWS Certificate Manager now supports the ability to import domainless certs and additional Key Types as well as an additional validation method for DNS. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.32 (2017-11-22) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Add support for Access logs and customizable integration timeouts -* `service/cloudformation`: Updates service API and documentation - * 1) Instance-level parameter overrides (CloudFormation-StackSet feature): This feature will allow the customers to override the template parameters on specific stackInstances. Customers will also have ability to update their existing instances with/without parameter-overrides using a new API "UpdateStackInstances" 2) Add support for SSM parameters in CloudFormation - This feature will allow the customers to use Systems Manager parameters in CloudFormation templates. They will be able to see values for these parameters in Describe APIs. -* `service/codebuild`: Updates service API and documentation - * Adding support for accessing Amazon VPC resources from AWS CodeBuild, dependency caching and build badges. -* `service/elasticmapreduce`: Updates service API and documentation - * Enable Kerberos on Amazon EMR. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rekognition`: Updates service API and documentation - * This release includes updates to Amazon Rekognition for the following APIs. The new DetectText API allows you to recognize and extract textual content from images. Face Model Versioning has been added to operations that deal with face detection. -* `service/shield`: Updates service API, documentation, and paginators - * The AWS Shield SDK has been updated in order to support Elastic IP address protections, the addition of AttackProperties objects in DescribeAttack responses, and a new GetSubscriptionState operation. -* `service/storagegateway`: Updates service API and documentation - * AWS Storage Gateway now enables you to get notification when all your files written to your NFS file share have been uploaded to Amazon S3. Storage Gateway also enables guessing of the MIME type for uploaded objects based on file extensions. -* `service/xray`: Updates service API, documentation, and paginators - * Added automatic pagination support for AWS X-Ray APIs in the SDKs that support this feature. - -Release v1.12.31 (2017-11-20) -=== - -### Service Client Updates -* `service/apigateway`: Updates service documentation - * Documentation updates for Apigateway -* `service/codecommit`: Updates service API, documentation, and paginators - * AWS CodeCommit now supports pull requests. You can use pull requests to collaboratively review code changes for minor changes or fixes, major feature additions, or new versions of your released software. -* `service/firehose`: Updates service API and documentation - * This release includes a new Kinesis Firehose feature that supports Splunk as Kinesis Firehose delivery destination. You can now use Kinesis Firehose to ingest real-time data to Splunk in a serverless, reliable, and salable manner. This release also includes a new feature that allows you to configure Lambda buffer size in Kinesis Firehose data transformation feature. You can now customize the data buffer size before invoking Lambda function in Kinesis Firehose for data transformation. This feature allows you to flexibly trade-off processing and delivery latency with cost and efficiency based on your specific use cases and requirements. -* `service/iis`: Adds new service - * The AWS Cost Explorer API gives customers programmatic access to AWS cost and usage information, allowing them to perform adhoc queries and build interactive cost management applications that leverage this dataset. -* `service/kinesis`: Updates service API and documentation - * Customers can now obtain the important characteristics of their stream with DescribeStreamSummary. The response will not include the shard list for the stream but will have the number of open shards, and all the other fields included in the DescribeStream response. -* `service/workdocs`: Updates service API and documentation - * DescribeGroups API and miscellaneous enhancements - -### SDK Bugs -* `aws/client`: Retry delays for throttled exception were not limited to 5 minutes [#1654](https://github.com/aws/aws-sdk-go/pull/1654) - * Fixes [#1653](https://github.com/aws/aws-sdk-go/issues/1653) - -Release v1.12.30 (2017-11-17) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/dms`: Updates service API, documentation, and paginators - * Support for migration task assessment. Support for data validation after the migration. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * Amazon RDS now supports importing MySQL databases by using backup files from Amazon S3. -* `service/s3`: Updates service API - * Added ORC to the supported S3 Inventory formats. - -### SDK Bugs -* `private/protocol/restjson`: Define JSONValue marshaling for body and querystring ([#1640](https://github.com/aws/aws-sdk-go/pull/1640)) - * Adds support for APIs which use JSONValue for body and querystring targets. - * Fixes [#1636](https://github.com/aws/aws-sdk-go/issues/1636) - -Release v1.12.29 (2017-11-16) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/ec2`: Updates service API - * You are now able to create and launch EC2 x1e smaller instance sizes -* `service/glue`: Updates service API and documentation - * API update for AWS Glue. New crawler configuration attribute enables customers to specify crawler behavior. New XML classifier enables classification of XML data. -* `service/opsworkscm`: Updates service API, documentation, and waiters - * Documentation updates for OpsWorks-cm: a new feature, OpsWorks for Puppet Enterprise, that allows users to create and manage OpsWorks-hosted Puppet Enterprise servers. -* `service/organizations`: Updates service API, documentation, and paginators - * This release adds APIs that you can use to enable and disable integration with AWS services designed to work with AWS Organizations. This integration allows the AWS service to perform operations on your behalf on all of the accounts in your organization. Although you can use these APIs yourself, we recommend that you instead use the commands provided in the other AWS service to enable integration with AWS Organizations. -* `service/route53`: Updates service API and documentation - * You can use Route 53's GetAccountLimit/GetHostedZoneLimit/GetReusableDelegationSetLimit APIs to view your current limits (including custom set limits) on Route 53 resources such as hosted zones and health checks. These APIs also return the number of each resource you're currently using to enable comparison against your current limits. - -Release v1.12.28 (2017-11-15) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * 1. Extended GetDocumentationParts operation to support retrieving documentation parts resources without contents. 2. Added hosted zone ID in the custom domain response. -* `service/email`: Updates service API, documentation, and examples - * SES launches Configuration Set Reputation Metrics and Email Pausing Today, two features that build upon the capabilities of the reputation dashboard. The first is the ability to export reputation metrics for individual configuration sets. The second is the ability to temporarily pause email sending, either at the configuration set level, or across your entire Amazon SES account. -* `service/polly`: Updates service API - * Amazon Polly adds Korean language support with new female voice - "Seoyeon" and new Indian English female voice - "Aditi" -* `service/states`: Updates service API and documentation - * You can now use the UpdateStateMachine API to update your state machine definition and role ARN. Existing executions will continue to use the previous definition and role ARN. You can use the DescribeStateMachineForExecution API to determine which state machine definition and role ARN is associated with an execution - -Release v1.12.27 (2017-11-14) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * Added new mode for Task Networking in ECS, called awsvpc mode. Mode configuration parameters to be passed in via awsvpcConfiguration. Updated APIs now use/show this new mode - RegisterTaskDefinition, CreateService, UpdateService, RunTask, StartTask. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lightsail`: Updates service API and documentation - * Lightsail now supports attached block storage, which allows you to scale your applications and protect application data with additional SSD-backed storage disks. This feature allows Lightsail customers to attach secure storage disks to their Lightsail instances and manage their attached disks, including creating and deleting disks, attaching and detaching disks from instances, and backing up disks via snapshot. -* `service/route53`: Updates service API and documentation - * When a Route 53 health check or hosted zone is created by a linked AWS service, the object now includes information about the service that created it. Hosted zones or health checks that are created by a linked service can't be updated or deleted using Route 53. -* `service/ssm`: Updates service API and documentation - * EC2 Systems Manager GetInventory API adds support for aggregation. - -### SDK Enhancements -* `aws/request`: Remove default port from HTTP host header ([#1618](https://github.com/aws/aws-sdk-go/pull/1618)) - * Updates the SDK to automatically remove default ports based on the URL's scheme when setting the HTTP Host header's value. - * Fixes [#1537](https://github.com/aws/aws-sdk-go/issues/1537) - -Release v1.12.26 (2017-11-09) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Introduces the following features: 1. Create a default subnet in an Availability Zone if no default subnet exists. 2. Spot Fleet integrates with Elastic Load Balancing to enable you to attach one or more load balancers to a Spot Fleet request. When you attach the load balancer, it automatically registers the instance in the Spot Fleet to the load balancers which distributes incoming traffic across the instances. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.25 (2017-11-08) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/batch`: Updates service documentation - * Documentation updates for AWS Batch. -* `service/ec2`: Updates service API and documentation - * AWS PrivateLink for Amazon Services - Customers can now privately access Amazon services from their Amazon Virtual Private Cloud (VPC), without using public IPs, and without requiring the traffic to traverse across the Internet. -* `service/elasticache`: Updates service API and documentation - * This release adds online resharding for ElastiCache for Redis offering, providing the ability to add and remove shards from a running cluster. Developers can now dynamically scale-out or scale-in their Redis cluster workloads to adapt to changes in demand. ElastiCache will resize the cluster by adding or removing shards and redistribute hash slots uniformly across the new shard configuration, all while the cluster continues to stay online and serves requests. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.24 (2017-11-07) -=== - -### Service Client Updates -* `service/elasticloadbalancingv2`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * DescribeOrderableDBInstanceOptions now returns the minimum and maximum allowed values for storage size, total provisioned IOPS, and provisioned IOPS per GiB for a DB instance. -* `service/s3`: Updates service API, documentation, and examples - * This releases adds support for 4 features: 1. Default encryption for S3 Bucket, 2. Encryption status in inventory and Encryption support for inventory. 3. Cross region replication of KMS-encrypted objects, and 4. ownership overwrite for CRR. - -Release v1.12.23 (2017-11-07) -=== - -### Service Client Updates -* `service/api.pricing`: Adds new service -* `service/ec2`: Updates service API - * You are now able to create and launch EC2 C5 instances, the next generation of EC2's compute-optimized instances, in us-east-1, us-west-2 and eu-west-1. C5 instances offer up to 72 vCPUs, 144 GiB of DDR4 instance memory, 25 Gbps in Network bandwidth and improved EBS and Networking bandwidth on smaller instance sizes to deliver improved performance for compute-intensive workloads. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kms`: Updates service API, documentation, and examples - * Documentation updates for AWS KMS. -* `service/organizations`: Updates service documentation - * This release updates permission statements for several API operations, and corrects some other minor errors. -* `service/states`: Updates service API, documentation, and paginators - * Documentation update. - -Release v1.12.22 (2017-11-03) -=== - -### Service Client Updates -* `service/ecs`: Updates service API and documentation - * Amazon ECS users can now add devices to their containers and enable init process in containers through the use of docker's 'devices' and 'init' features. These fields can be specified under linuxParameters in ContainerDefinition in the Task Definition Template. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.21 (2017-11-02) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * This release supports creating and managing Regional and Edge-Optimized API endpoints. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -### SDK Bugs -* `aws/request`: Fix bug in request presign creating invalid URL ([#1624](https://github.com/aws/aws-sdk-go/pull/1624)) - * Fixes a bug the Request Presign and PresignRequest methods that would allow a invalid expire duration as input. A expire time of 0 would be interpreted by the SDK to generate a normal request signature, not a presigned URL. This caused the returned URL unusable. - * Fixes [#1617](https://github.com/aws/aws-sdk-go/issues/1617) - -Release v1.12.20 (2017-11-01) -=== - -### Service Client Updates -* `service/acm`: Updates service documentation - * Documentation updates for ACM -* `service/cloudhsmv2`: Updates service documentation - * Minor documentation update for AWS CloudHSM (cloudhsmv2). -* `service/directconnect`: Updates service API and documentation - * AWS DirectConnect now provides support for Global Access for Virtual Private Cloud (VPC) via a new feature called Direct Connect Gateway. A Direct Connect Gateway will allow you to group multiple Direct Connect Private Virtual Interfaces (DX-VIF) and Private Virtual Gateways (VGW) from different AWS regions (but belonging to the same AWS Account) and pass traffic from any DX-VIF to any VPC in the grouping. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -### SDK Enhancements -* `aws/client`: Adding status code 429 to throttlable status codes in default retryer (#1621) - -Release v1.12.19 (2017-10-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.18 (2017-10-26) -=== - -### Service Client Updates -* `service/cloudfront`: Updates service API and documentation - * You can now specify additional options for MinimumProtocolVersion, which controls the SSL/TLS protocol that CloudFront uses to communicate with viewers. The minimum protocol version that you choose also determines the ciphers that CloudFront uses to encrypt the content that it returns to viewers. -* `service/ec2`: Updates service API - * You are now able to create and launch EC2 P3 instance, next generation GPU instances, optimized for machine learning and high performance computing applications. With up to eight NVIDIA Tesla V100 GPUs, P3 instances provide up to one petaflop of mixed-precision, 125 teraflops of single-precision, and 62 teraflops of double-precision floating point performance, as well as a 300 GB/s second-generation NVLink interconnect that enables high-speed, low-latency GPU-to-GPU communication. P3 instances also feature up to 64 vCPUs based on custom Intel Xeon E5 (Broadwell) processors, 488 GB of DRAM, and 25 Gbps of dedicated aggregate network bandwidth using the Elastic Network Adapter (ENA). -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.17 (2017-10-24) -=== - -### Service Client Updates -* `service/config`: Updates service API -* `service/elasticache`: Updates service API, documentation, and examples - * Amazon ElastiCache for Redis today announced support for data encryption both for data in-transit and data at-rest. The new encryption in-transit functionality enables ElastiCache for Redis customers to encrypt data for all communication between clients and Redis engine, and all intra-cluster Redis communication. The encryption at-rest functionality allows customers to encrypt their S3 based backups. Customers can begin using the new functionality by simply enabling this functionality via AWS console, and a small configuration change in their Redis clients. The ElastiCache for Redis service automatically manages life cycle of the certificates required for encryption, including the issuance, renewal and expiration of certificates. Additionally, as part of this launch, customers will gain the ability to start using the Redis AUTH command that provides an added level of authentication. -* `service/glue`: Adds new service - * AWS Glue: Adding a new API, BatchStopJobRun, to stop one or more job runs for a specified Job. -* `service/pinpoint`: Updates service API and documentation - * Added support for APNs VoIP messages. Added support for collapsible IDs, message priority, and TTL for APNs and FCM/GCM. - -Release v1.12.16 (2017-10-23) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/organizations`: Updates service API and documentation - * This release supports integrating other AWS services with AWS Organizations through the use of an IAM service-linked role called AWSServiceRoleForOrganizations. Certain operations automatically create that role if it does not already exist. - -Release v1.12.15 (2017-10-20) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Adding pagination support for DescribeSecurityGroups for EC2 Classic and VPC Security Groups - -Release v1.12.14 (2017-10-19) -=== - -### Service Client Updates -* `service/sqs`: Updates service API and documentation - * Added support for tracking cost allocation by adding, updating, removing, and listing the metadata tags of Amazon SQS queues. -* `service/ssm`: Updates service API and documentation - * EC2 Systems Manager versioning support for Parameter Store. Also support for referencing parameter versions in SSM Documents. - -Release v1.12.13 (2017-10-18) -=== - -### Service Client Updates -* `service/lightsail`: Updates service API and documentation - * This release adds support for Windows Server-based Lightsail instances. The GetInstanceAccessDetails API now returns the password of your Windows Server-based instance when using the default key pair. GetInstanceAccessDetails also returns a PasswordData object for Windows Server instances containing the ciphertext and keyPairName. The Blueprint data type now includes a list of platform values (LINUX_UNIX or WINDOWS). The Bundle data type now includes a list of SupportedPlatforms values (LINUX_UNIX or WINDOWS). - -Release v1.12.12 (2017-10-17) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/es`: Updates service API and documentation - * This release adds support for VPC access to Amazon Elasticsearch Service. - * This release adds support for VPC access to Amazon Elasticsearch Service. - -Release v1.12.11 (2017-10-16) -=== - -### Service Client Updates -* `service/cloudhsm`: Updates service API and documentation - * Documentation updates for AWS CloudHSM Classic. -* `service/ec2`: Updates service API and documentation - * You can now change the tenancy of your VPC from dedicated to default with a single API operation. For more details refer to the documentation for changing VPC tenancy. -* `service/es`: Updates service API and documentation - * AWS Elasticsearch adds support for enabling slow log publishing. Using slow log publishing options customers can configure and enable index/query slow log publishing of their domain to preferred AWS Cloudwatch log group. -* `service/rds`: Updates service API and waiters - * Adds waiters for DBSnapshotAvailable and DBSnapshotDeleted. -* `service/waf`: Updates service API and documentation - * This release adds support for regular expressions as match conditions in rules, and support for geographical location by country of request IP address as a match condition in rules. -* `service/waf-regional`: Updates service API and documentation - -Release v1.12.10 (2017-10-12) -=== - -### Service Client Updates -* `service/codecommit`: Updates service API and documentation - * This release includes the DeleteBranch API and a change to the contents of a Commit object. -* `service/dms`: Updates service API and documentation - * This change includes addition of new optional parameter to an existing API -* `service/elasticbeanstalk`: Updates service API and documentation - * Added the ability to add, delete or update Tags -* `service/polly`: Updates service API - * Amazon Polly exposes two new voices: "Matthew" (US English) and "Takumi" (Japanese) -* `service/rds`: Updates service API and documentation - * You can now call DescribeValidDBInstanceModifications to learn what modifications you can make to your DB instance. You can use this information when you call ModifyDBInstance. - -Release v1.12.9 (2017-10-11) -=== - -### Service Client Updates -* `service/ecr`: Updates service API, documentation, and paginators - * Adds support for new API set used to manage Amazon ECR repository lifecycle policies. Amazon ECR lifecycle policies enable you to specify the lifecycle management of images in a repository. The configuration is a set of one or more rules, where each rule defines an action for Amazon ECR to apply to an image. This allows the automation of cleaning up unused images, for example expiring images based on age or status. A lifecycle policy preview API is provided as well, which allows you to see the impact of a lifecycle policy on an image repository before you execute it -* `service/email`: Updates service API and documentation - * Added content related to email template management and templated email sending operations. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.12.8 (2017-10-10) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * This release includes updates to AWS Virtual Private Gateway. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `service/opsworkscm`: Updates service API and documentation - * Provide engine specific information for node associations. - -Release v1.12.7 (2017-10-06) -=== - -### Service Client Updates -* `service/sqs`: Updates service documentation - * Documentation updates regarding availability of FIFO queues and miscellaneous corrections. - -Release v1.12.6 (2017-10-05) -=== - -### Service Client Updates -* `service/redshift`: Updates service API and documentation - * DescribeEventSubscriptions API supports tag keys and tag values as request parameters. - -Release v1.12.5 (2017-10-04) -=== - -### Service Client Updates -* `service/kinesisanalytics`: Updates service API and documentation - * Kinesis Analytics now supports schema discovery on objects in S3. Additionally, Kinesis Analytics now supports input data preprocessing through Lambda. -* `service/route53domains`: Updates service API and documentation - * Added a new API that checks whether a domain name can be transferred to Amazon Route 53. - -### SDK Bugs -* `service/s3/s3crypto`: Correct PutObjectRequest documentation ([#1568](https://github.com/aws/aws-sdk-go/pull/1568)) - * s3Crypto's PutObjectRequest docstring example was using an incorrect value. Corrected the type used in the example. - -Release v1.12.4 (2017-10-03) -=== - -### Service Client Updates -* `service/ec2`: Updates service API, documentation, and waiters - * This release includes service updates to AWS VPN. -* `service/ssm`: Updates service API and documentation - * EC2 Systems Manager support for tagging SSM Documents. Also support for tag-based permissions to restrict access to SSM Documents based on these tags. - -Release v1.12.3 (2017-10-02) -=== - -### Service Client Updates -* `service/cloudhsm`: Updates service documentation and paginators - * Documentation updates for CloudHSM - -Release v1.12.2 (2017-09-29) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Includes APIs for managing and accessing image builders, and deleting images. -* `service/codebuild`: Updates service API and documentation - * Adding support for Building GitHub Pull Requests in AWS CodeBuild -* `service/mturk-requester`: Updates service API and documentation -* `service/organizations`: Updates service API and documentation - * This release flags the HandshakeParty structure's Type and Id fields as 'required'. They effectively were required in the past, as you received an error if you did not include them. This is now reflected at the API definition level. -* `service/route53`: Updates service API and documentation - * This change allows customers to reset elements of health check. - -### SDK Bugs -* `private/protocol/query`: Fix query protocol handling of nested byte slices ([#1557](https://github.com/aws/aws-sdk-go/issues/1557)) - * Fixes the query protocol to correctly marshal nested []byte values of API operations. -* `service/s3`: Fix PutObject and UploadPart API to include ContentMD5 field ([#1559](https://github.com/aws/aws-sdk-go/pull/1559)) - * Fixes the SDK's S3 PutObject and UploadPart API code generation to correctly render the ContentMD5 field into the associated input types for these two API operations. - * Fixes [#1553](https://github.com/aws/aws-sdk-go/pull/1553) - -Release v1.12.1 (2017-09-27) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/pinpoint`: Updates service API and documentation - * Added two new push notification channels: Amazon Device Messaging (ADM) and, for push notification support in China, Baidu Cloud Push. Added support for APNs auth via .p8 key file. Added operation for direct message deliveries to user IDs, enabling you to message an individual user on multiple endpoints. - -Release v1.12.0 (2017-09-26) -=== - -### SDK Bugs -* `API Marshaler`: Revert REST JSON and XML protocol marshaler improvements - * Bug [#1550](https://github.com/aws/aws-sdk-go/issues/1550) identified a missed condition in the Amazon Route 53 RESTXML protocol marshaling causing requests to that service to fail. Reverting the marshaler improvements until the bug can be fixed. - -Release v1.11.0 (2017-09-26) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service API and documentation - * You can now prevent a stack from being accidentally deleted by enabling termination protection on the stack. If you attempt to delete a stack with termination protection enabled, the deletion fails and the stack, including its status, remains unchanged. You can enable termination protection on a stack when you create it. Termination protection on stacks is disabled by default. After creation, you can set termination protection on a stack whose status is CREATE_COMPLETE, UPDATE_COMPLETE, or UPDATE_ROLLBACK_COMPLETE. - -### SDK Features -* Add dep Go dependency management metadata files (#1544) - * Adds the Go `dep` dependency management metadata files to the SDK. - * Fixes [#1451](https://github.com/aws/aws-sdk-go/issues/1451) - * Fixes [#634](https://github.com/aws/aws-sdk-go/issues/634) -* `service/dynamodb/expression`: Add expression building utility for DynamoDB ([#1527](https://github.com/aws/aws-sdk-go/pull/1527)) - * Adds a new package, expression, to the SDK providing builder utilities to create DynamoDB expressions safely taking advantage of type safety. -* `API Marshaler`: Add generated marshalers for RESTXML protocol ([#1409](https://github.com/aws/aws-sdk-go/pull/1409)) - * Updates the RESTXML protocol marshaler to use generated code instead of reflection for REST XML based services. -* `API Marshaler`: Add generated marshalers for RESTJSON protocol ([#1547](https://github.com/aws/aws-sdk-go/pull/1547)) - * Updates the RESTJSON protocol marshaler to use generated code instead of reflection for REST JSON based services. - -### SDK Enhancements -* `private/protocol`: Update format of REST JSON and XMl benchmarks ([#1546](https://github.com/aws/aws-sdk-go/pull/1546)) - * Updates the format of the REST JSON and XML benchmarks to be readable. RESTJSON benchmarks were updated to more accurately bench building of the protocol. - -Release v1.10.51 (2017-09-22) -=== - -### Service Client Updates -* `service/config`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - * Amazon ECS users can now add and drop Linux capabilities to their containers through the use of docker's cap-add and cap-drop features. Customers can specify the capabilities they wish to add or drop for each container in their task definition. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service documentation - * Documentation updates for rds - -Release v1.10.50 (2017-09-21) -=== - -### Service Client Updates -* `service/budgets`: Updates service API - * Including "DuplicateRecordException" in UpdateNotification and UpdateSubscriber. -* `service/ec2`: Updates service API and documentation - * Add EC2 APIs to copy Amazon FPGA Images (AFIs) within the same region and across multiple regions, delete AFIs, and modify AFI attributes. AFI attributes include name, description and granting/denying other AWS accounts to load the AFI. -* `service/logs`: Updates service API and documentation - * Adds support for associating LogGroups with KMS Keys. - -### SDK Bugs -* Fix greengrass service model being duplicated with different casing. ([#1541](https://github.com/aws/aws-sdk-go/pull/1541)) - * Fixes [#1540](https://github.com/aws/aws-sdk-go/issues/1540) - * Fixes [#1539](https://github.com/aws/aws-sdk-go/issues/1539) - -Release v1.10.49 (2017-09-20) -=== - -### Service Client Updates -* `service/Greengrass`: Adds new service -* `service/appstream`: Updates service API and documentation - * API updates for supporting On-Demand fleets. -* `service/codepipeline`: Updates service API and documentation - * This change includes a PipelineMetadata object that is part of the output from the GetPipeline API that includes the Pipeline ARN, created, and updated timestamp. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * Introduces the --option-group-name parameter to the ModifyDBSnapshot CLI command. You can specify this parameter when you upgrade an Oracle DB snapshot. The same option group considerations apply when upgrading a DB snapshot as when upgrading a DB instance. For more information, see http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Oracle.html#USER_UpgradeDBInstance.Oracle.OGPG.OG -* `service/runtime.lex`: Updates service API and documentation - -Release v1.10.48 (2017-09-19) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Fixed bug in EC2 clients preventing ElasticGpuSet from being set. - -### SDK Enhancements -* `aws/credentials`: Add EnvProviderName constant. ([#1531](https://github.com/aws/aws-sdk-go/issues/1531)) - * Adds the "EnvConfigCredentials" string literal as EnvProviderName constant. - * Fixes [#1444](https://github.com/aws/aws-sdk-go/issues/1444) - -Release v1.10.47 (2017-09-18) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Amazon EC2 now lets you opt for Spot instances to be stopped in the event of an interruption instead of being terminated. Your Spot request can be fulfilled again by restarting instances from a previously stopped state, subject to availability of capacity at or below your preferred price. When you submit a persistent Spot request, you can choose from "terminate" or "stop" as the instance interruption behavior. Choosing "stop" will shutdown your Spot instances so you can continue from this stopped state later on. This feature is only available for instances with Amazon EBS volume as their root device. -* `service/email`: Updates service API and documentation - * Amazon Simple Email Service (Amazon SES) now lets you customize the domains used for tracking open and click events. Previously, open and click tracking links referred to destinations hosted on domains operated by Amazon SES. With this feature, you can use your own branded domains for capturing open and click events. -* `service/iam`: Updates service API and documentation - * A new API, DeleteServiceLinkedRole, submits a service-linked role deletion request and returns a DeletionTaskId, which you can use to check the status of the deletion. - -Release v1.10.46 (2017-09-15) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Add a new enum "REQUEST" to '--type ' field in the current create-authorizer API, and make "identitySource" optional. - -Release v1.10.45 (2017-09-14) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Supporting Parameter Store in environment variables for AWS CodeBuild -* `service/organizations`: Updates service documentation - * Documentation updates for AWS Organizations -* `service/servicecatalog`: Updates service API, documentation, and paginators - * This release of Service Catalog adds API support to copy products. - -Release v1.10.44 (2017-09-13) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Customers can create Life Cycle Hooks at the time of creating Auto Scaling Groups through the CreateAutoScalingGroup API -* `service/batch`: Updates service documentation and examples - * Documentation updates for batch -* `service/ec2`: Updates service API - * You are now able to create and launch EC2 x1e.32xlarge instance, a new EC2 instance in the X1 family, in us-east-1, us-west-2, eu-west-1, and ap-northeast-1. x1e.32xlarge offers 128 vCPUs, 3,904 GiB of DDR4 instance memory, high memory bandwidth, large L3 caches, and leading reliability capabilities to boost the performance and reliability of in-memory applications. -* `service/events`: Updates service API and documentation - * Exposes ConcurrentModificationException as one of the valid exceptions for PutPermission and RemovePermission operation. - -### SDK Enhancements -* `service/autoscaling`: Fix documentation for PutScalingPolicy.AutoScalingGroupName [#1522](https://github.com/aws/aws-sdk-go/pull/1522) -* `service/s3/s3manager`: Clarify S3 Upload manager Concurrency config [#1521](https://github.com/aws/aws-sdk-go/pull/1521) - * Fixes [#1458](https://github.com/aws/aws-sdk-go/issues/1458) -* `service/dynamodb/dynamodbattribute`: Add support for time alias. [#1520](https://github.com/aws/aws-sdk-go/pull/1520) - * Related to [#1505](https://github.com/aws/aws-sdk-go/pull/1505) - -Release v1.10.43 (2017-09-12) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Fixed bug in EC2 clients preventing HostOfferingSet from being set -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.10.42 (2017-09-12) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * DeviceFarm has added support for two features - RemoteDebugging and Customer Artifacts. Customers can now do remote Debugging on their Private Devices and can now retrieve custom files generated by their tests on the device and the device host (execution environment) on both public and private devices. - -Release v1.10.41 (2017-09-08) -=== - -### Service Client Updates -* `service/logs`: Updates service API and documentation - * Adds support for the PutResourcePolicy, DescribeResourcePolicy and DeleteResourcePolicy APIs. - -Release v1.10.40 (2017-09-07) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service documentation -* `service/ec2`: Updates service API and documentation - * With Tagging support, you can add Key and Value metadata to search, filter and organize your NAT Gateways according to your organization's needs. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lex-models`: Updates service API and documentation -* `service/route53`: Updates service API and documentation - * You can configure Amazon Route 53 to log information about the DNS queries that Amazon Route 53 receives for your domains and subdomains. When you configure query logging, Amazon Route 53 starts to send logs to CloudWatch Logs. You can use various tools, including the AWS console, to access the query logs. - -Release v1.10.39 (2017-09-06) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Add an optional "thresholdType" to notifications to support percentage or absolute value thresholds. - -Release v1.10.38 (2017-09-05) -=== - -### Service Client Updates -* `service/codestar`: Updates service API and documentation - * Added support to tag CodeStar projects. Tags can be used to organize and find CodeStar projects on key-value pairs that you can choose. For example, you could add a tag with a key of "Release" and a value of "Beta" to projects your organization is working on for an upcoming beta release. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.10.37 (2017-09-01) -=== - -### Service Client Updates -* `service/MobileHub`: Adds new service -* `service/gamelift`: Updates service API and documentation - * GameLift VPC resources can be peered with any other AWS VPC. R4 memory-optimized instances now available to deploy. -* `service/ssm`: Updates service API and documentation - * Adding KMS encryption support to SSM Inventory Resource Data Sync. Exposes the ClientToken parameter on SSM StartAutomationExecution to provide idempotent execution requests. - -Release v1.10.36 (2017-08-31) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API, documentation, and examples - * The AWS CodeBuild HTTP API now provides the BatchDeleteBuilds operation, which enables you to delete existing builds. -* `service/ec2`: Updates service API and documentation - * Descriptions for Security Group Rules enables customers to be able to define a description for ingress and egress security group rules . The Descriptions for Security Group Rules feature supports one description field per Security Group rule for both ingress and egress rules . Descriptions for Security Group Rules provides a simple way to describe the purpose or function of a Security Group Rule allowing for easier customer identification of configuration elements . Prior to the release of Descriptions for Security Group Rules , customers had to maintain a separate system outside of AWS if they wanted to track Security Group Rule mapping and their purpose for being implemented. If a security group rule has already been created and you would like to update or change your description for that security group rule you can use the UpdateSecurityGroupRuleDescription API. -* `service/elasticloadbalancingv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lex-models`: Updates service API and documentation - -### SDK Bugs -* `aws/signer/v4`: Revert [#1491](https://github.com/aws/aws-sdk-go/issues/1491) as change conflicts with an undocumented AWS v4 signature test case. - * Related to: [#1495](https://github.com/aws/aws-sdk-go/issues/1495). - -Release v1.10.35 (2017-08-30) -=== - -### Service Client Updates -* `service/application-autoscaling`: Updates service API and documentation -* `service/organizations`: Updates service API and documentation - * The exception ConstraintViolationException now contains a new reason subcode MASTERACCOUNT_MISSING_CONTACT_INFO to make it easier to understand why attempting to remove an account from an Organization can fail. We also improved several other of the text descriptions and examples. - -Release v1.10.34 (2017-08-29) -=== - -### Service Client Updates -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * Provides capability to add secondary CIDR blocks to a VPC. - -### SDK Bugs -* `aws/signer/v4`: Fix Signing Unordered Multi Value Query Parameters ([#1491](https://github.com/aws/aws-sdk-go/pull/1491)) - * Removes sorting of query string values when calculating v4 signing as this is not part of the spec. The spec only requires the keys, not values, to be sorted which is achieved by Query.Encode(). - -Release v1.10.33 (2017-08-25) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service API and documentation - * Rollback triggers enable you to have AWS CloudFormation monitor the state of your application during stack creation and updating, and to roll back that operation if the application breaches the threshold of any of the alarms you've specified. -* `service/gamelift`: Updates service API - * Update spelling of MatchmakingTicket status values for internal consistency. -* `service/rds`: Updates service API and documentation - * Option group options now contain additional properties that identify requirements for certain options. Check these properties to determine if your DB instance must be in a VPC or have auto minor upgrade turned on before you can use an option. Check to see if you can downgrade the version of an option after you have installed it. - -### SDK Enhancements -* `example/service/ec2`: Add EC2 list instances example ([#1492](https://github.com/aws/aws-sdk-go/pull/1492)) - -Release v1.10.32 (2017-08-25) -=== - -### Service Client Updates -* `service/rekognition`: Updates service API, documentation, and examples - * Update the enum value of LandmarkType and GenderType to be consistent with service response - -Release v1.10.31 (2017-08-23) -=== - -### Service Client Updates -* `service/appstream`: Updates service documentation - * Documentation updates for appstream -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.10.30 (2017-08-22) -=== - -### Service Client Updates -* `service/ssm`: Updates service API and documentation - * Changes to associations in Systems Manager State Manager can now be recorded. Previously, when you edited associations, you could not go back and review older association settings. Now, associations are versioned, and can be named using human-readable strings, allowing you to see a trail of association changes. You can also perform rate-based scheduling, which allows you to schedule associations more granularly. - -Release v1.10.29 (2017-08-21) -=== - -### Service Client Updates -* `service/firehose`: Updates service API, documentation, and paginators - * This change will allow customers to attach a Firehose delivery stream to an existing Kinesis stream directly. You no longer need a forwarder to move data from a Kinesis stream to a Firehose delivery stream. You can now run your streaming applications on your Kinesis stream and easily attach a Firehose delivery stream to it for data delivery to S3, Redshift, or Elasticsearch concurrently. -* `service/route53`: Updates service API and documentation - * Amazon Route 53 now supports CAA resource record type. A CAA record controls which certificate authorities are allowed to issue certificates for the domain or subdomain. - -Release v1.10.28 (2017-08-18) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.10.27 (2017-08-16) -=== - -### Service Client Updates -* `service/gamelift`: Updates service API and documentation - * The Matchmaking Grouping Service is a new feature that groups player match requests for a given game together into game sessions based on developer configured rules. - -### SDK Enhancements -* `aws/arn`: aws/arn: Package for parsing and producing ARNs ([#1463](https://github.com/aws/aws-sdk-go/pull/1463)) - * Adds the `arn` package for AWS ARN parsing and building. Use this package to build AWS ARNs for services such as outlined in the [documentation](http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - -### SDK Bugs -* `aws/signer/v4`: Correct V4 presign signature to include content sha25 in URL ([#1469](https://github.com/aws/aws-sdk-go/pull/1469)) - * Updates the V4 signer so that when a Presign is generated the `X-Amz-Content-Sha256` header is added to the query string instead of being required to be in the header. This allows you to generate presigned URLs for GET requests, e.g S3.GetObject that do not require additional headers to be set by the downstream users of the presigned URL. - * Related To: [#1467](https://github.com/aws/aws-sdk-go/issues/1467) - -Release v1.10.26 (2017-08-15) -=== - -### Service Client Updates -* `service/ec2`: Updates service API - * Fixed bug in EC2 clients preventing HostReservation from being set -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.10.25 (2017-08-14) -=== - -### Service Client Updates -* `service/AWS Glue`: Adds new service -* `service/batch`: Updates service API and documentation - * This release enhances the DescribeJobs API to include the CloudWatch logStreamName attribute in ContainerDetail and ContainerDetailAttempt -* `service/cloudhsmv2`: Adds new service - * CloudHSM provides hardware security modules for protecting sensitive data and cryptographic keys within an EC2 VPC, and enable the customer to maintain control over key access and use. This is a second-generation of the service that will improve security, lower cost and provide better customer usability. -* `service/elasticfilesystem`: Updates service API, documentation, and paginators - * Customers can create encrypted EFS file systems and specify a KMS master key to encrypt it with. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/mgh`: Adds new service - * AWS Migration Hub provides a single location to track migrations across multiple AWS and partner solutions. Using Migration Hub allows you to choose the AWS and partner migration tools that best fit your needs, while providing visibility into the status of your entire migration portfolio. Migration Hub also provides key metrics and progress for individual applications, regardless of which tools are being used to migrate them. For example, you might use AWS Database Migration Service, AWS Server Migration Service, and partner migration tools to migrate an application comprised of a database, virtualized web servers, and a bare metal server. Using Migration Hub will provide you with a single screen that shows the migration progress of all the resources in the application. This allows you to quickly get progress updates across all of your migrations, easily identify and troubleshoot any issues, and reduce the overall time and effort spent on your migration projects. Migration Hub is available to all AWS customers at no additional charge. You only pay for the cost of the migration tools you use, and any resources being consumed on AWS. -* `service/ssm`: Updates service API and documentation - * Systems Manager Maintenance Windows include the following changes or enhancements: New task options using Systems Manager Automation, AWS Lambda, and AWS Step Functions; enhanced ability to edit the targets of a Maintenance Window, including specifying a target name and description, and ability to edit the owner field; enhanced ability to edits tasks; enhanced support for Run Command parameters; and you can now use a --safe flag when attempting to deregister a target. If this flag is enabled when you attempt to deregister a target, the system returns an error if the target is referenced by any task. Also, Systems Manager now includes Configuration Compliance to scan your fleet of managed instances for patch compliance and configuration inconsistencies. You can collect and aggregate data from multiple AWS accounts and Regions, and then drill down into specific resources that aren't compliant. -* `service/storagegateway`: Updates service API and documentation - * Add optional field ForceDelete to DeleteFileShare api. - -Release v1.10.24 (2017-08-11) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * Adds support for specifying Application Load Balancers in deployment groups, for both in-place and blue/green deployments. -* `service/cognito-idp`: Updates service API and documentation -* `service/ec2`: Updates service API and documentation - * Provides customers an opportunity to recover an EIP that was released - -Release v1.10.23 (2017-08-10) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * Enable BatchDetachPolicy -* `service/codebuild`: Updates service API - * Supporting Bitbucket as source type in AWS CodeBuild. - -Release v1.10.22 (2017-08-09) -=== - -### Service Client Updates -* `service/rds`: Updates service documentation - * Documentation updates for RDS. - -Release v1.10.21 (2017-08-09) -=== - -### Service Client Updates -* `service/elasticbeanstalk`: Updates service API and documentation - * Add support for paginating the result of DescribeEnvironments Include the ARN of described environments in DescribeEnvironments output - -### SDK Enhancements -* `aws`: Add pointer conversion utilities to transform int64 to time.Time [#1433](https://github.com/aws/aws-sdk-go/pull/1433) - * Adds `SecondsTimeValue` and `MillisecondsTimeValue` utilities. - -Release v1.10.20 (2017-08-01) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * AWS CodeDeploy now supports the use of multiple tag groups in a single deployment group (an intersection of tags) to identify the instances for a deployment. When you create or update a deployment group, use the new ec2TagSet and onPremisesTagSet structures to specify up to three groups of tags. Only instances that are identified by at least one tag in each of the tag groups are included in the deployment group. -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service waiters - * Ec2 SpotInstanceRequestFulfilled waiter update -* `service/elasticloadbalancingv2`: Updates service waiters -* `service/email`: Updates service API, documentation, paginators, and examples - * This update adds information about publishing email open and click events. This update also adds information about publishing email events to Amazon Simple Notification Service (Amazon SNS). -* `service/pinpoint`: Updates service API and documentation - * This release of the Pinpoint SDK enables App management - create, delete, update operations, Raw Content delivery for APNs and GCM campaign messages and From Address override. - -Release v1.10.19 (2017-08-01) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/inspector`: Updates service API, documentation, and paginators - * Inspector's StopAssessmentRun API has been updated with a new input option - stopAction. This request parameter can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value, and the previous behavior) stops the AWS agent data collection and begins the results evaluation for findings generation based on the data collected so far. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated. -* `service/ssm`: Updates service API and documentation - * Adds a SendAutomationSignal API to SSM Service. This API is used to send a signal to an automation execution to change the current behavior or status of the execution. - -Release v1.10.18 (2017-07-27) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * The CreateDefaultVPC API enables you to create a new default VPC . You no longer need to contact AWS support, if your default VPC has been deleted. -* `service/kinesisanalytics`: Updates service API and documentation - * Added additional exception types and clarified documentation. - -Release v1.10.17 (2017-07-27) -=== - -### Service Client Updates -* `service/dynamodb`: Updates service documentation and examples - * Corrected a typo. -* `service/ec2`: Updates service API and documentation - * Amazon EC2 Elastic GPUs allow you to easily attach low-cost graphics acceleration to current generation EC2 instances. With Amazon EC2 Elastic GPUs, you can configure the right amount of graphics acceleration to your particular workload without being constrained by fixed hardware configurations and limited GPU selection. -* `service/monitoring`: Updates service documentation - * This release adds high resolution features to CloudWatch, with support for Custom Metrics down to 1 second and Alarms down to 10 seconds. - -Release v1.10.16 (2017-07-26) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * Cloud Directory adds support for additional batch operations. -* `service/cloudformation`: Updates service API and documentation - * AWS CloudFormation StackSets enables you to manage stacks across multiple accounts and regions. - -### SDK Enhancements -* `aws/signer/v4`: Optimize V4 signer's header duplicate space stripping. [#1417](https://github.com/aws/aws-sdk-go/pull/1417) - -Release v1.10.15 (2017-07-24) -=== - -### Service Client Updates -* `service/appstream`: Updates service API, documentation, and waiters - * Amazon AppStream 2.0 image builders and fleets can now access applications and network resources that rely on Microsoft Active Directory (AD) for authentication and permissions. This new feature allows you to join your streaming instances to your AD, so you can use your existing AD user management tools. -* `service/ec2`: Updates service API and documentation - * Spot Fleet tagging capability allows customers to automatically tag instances launched by Spot Fleet. You can use this feature to label or distinguish instances created by distinct Spot Fleets. Tagging your EC2 instances also enables you to see instance cost allocation by tag in your AWS bill. - -### SDK Bugs -* `aws/signer/v4`: Fix out of bounds panic in stripExcessSpaces [#1412](https://github.com/aws/aws-sdk-go/pull/1412) - * Fixes the out of bands panic in stripExcessSpaces caused by an incorrect calculation of the stripToIdx value. Simplified to code also. - * Fixes [#1411](https://github.com/aws/aws-sdk-go/issues/1411) - -Release v1.10.14 (2017-07-20) -=== - -### Service Client Updates -* `service/elasticmapreduce`: Updates service API and documentation - * Amazon EMR now includes the ability to use a custom Amazon Linux AMI and adjustable root volume size when launching a cluster. - -Release v1.10.13 (2017-07-19) -=== - -### Service Client Updates -* `service/budgets`: Updates service API and documentation - * Update budget Management API's to list/create/update RI_UTILIZATION type budget. Update budget Management API's to support DAILY timeUnit for RI_UTILIZATION type budget. - -### SDK Enhancements -* `service/s3`: Use interfaces assertions instead of ValuesAtPath for S3 field lookups. [#1401](https://github.com/aws/aws-sdk-go/pull/1401) - * Improves the performance across the board for all S3 API calls by removing the usage of `ValuesAtPath` being used for every S3 API call. - -### SDK Bugs -* `aws/request`: waiter test bug - * waiters_test.go file would sometimes fail due to travis hiccups. This occurs because a test would sometimes fail the cancel check and succeed the timeout. However, the timeout check should never occur in that test. This fix introduces a new field that dictates how waiters will sleep. - -Release v1.10.12 (2017-07-17) -=== - -### Service Client Updates -* `service/cognito-idp`: Updates service API and documentation -* `service/lambda`: Updates service API and documentation - * Lambda@Edge lets you run code closer to your end users without provisioning or managing servers. With Lambda@Edge, your code runs in AWS edge locations, allowing you to respond to your end users at the lowest latency. Your code is triggered by Amazon CloudFront events, such as requests to and from origin servers and viewers, and it is ready to execute at every AWS edge location whenever a request for content is received. You just upload your Node.js code to AWS Lambda and Lambda takes care of everything required to run and scale your code with high availability. You only pay for the compute time you consume - there is no charge when your code is not running. - -Release v1.10.11 (2017-07-14) -=== - -### Service Client Updates -* `service/discovery`: Updates service API and documentation - * Adding feature to the Export API for Discovery Service to allow filters for the export task to allow export based on per agent id. -* `service/ec2`: Updates service API - * New EC2 GPU Graphics instance -* `service/marketplacecommerceanalytics`: Updates service documentation - * Update to Documentation Model For New Report Cadence / Reformat of Docs - -Release v1.10.10 (2017-07-13) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Adds support for management of gateway responses. -* `service/ec2`: Updates service API and documentation - * X-ENI (or Cross-Account ENI) is a new feature that allows the attachment or association of Elastic Network Interfaces (ENI) between VPCs in different AWS accounts located in the same availability zone. With this new capability, service providers and partners can deliver managed solutions in a variety of new architectural patterns where the provider and consumer of the service are in different AWS accounts. -* `service/lex-models`: Updates service documentation - -Release v1.10.9 (2017-07-12) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service API and documentation - * Auto Scaling now supports a new type of scaling policy called target tracking scaling policies that you can use to set up dynamic scaling for your application. -* `service/swf`: Updates service API, documentation, paginators, and examples - * Added support for attaching control data to Lambda tasks. Control data lets you attach arbitrary strings to your decisions and history events. - -Release v1.10.8 (2017-07-06) -=== - -### Service Client Updates -* `service/ds`: Updates service API, documentation, and paginators - * You can now improve the resilience and performance of your Microsoft AD directory by deploying additional domain controllers. Added UpdateNumberofDomainControllers API that allows you to update the number of domain controllers you want for your directory, and DescribeDomainControllers API that allows you to describe the detailed information of each domain controller of your directory. Also added the 'DesiredNumberOfDomainControllers' field to the DescribeDirectories API output for Microsoft AD. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/kinesis`: Updates service API and documentation - * You can now encrypt your data at rest within an Amazon Kinesis Stream using server-side encryption. Server-side encryption via AWS KMS makes it easy for customers to meet strict data management requirements by encrypting their data at rest within the Amazon Kinesis Streams, a fully managed real-time data processing service. -* `service/kms`: Updates service API and documentation - * This release of AWS Key Management Service introduces the ability to determine whether a key is AWS managed or customer managed. -* `service/ssm`: Updates service API and documentation - * Amazon EC2 Systems Manager now expands Patching support to Amazon Linux, Red Hat and Ubuntu in addition to the already supported Windows Server. - -Release v1.10.7 (2017-07-05) -=== - -### Service Client Updates -* `service/monitoring`: Updates service API and documentation - * We are excited to announce the availability of APIs and CloudFormation support for CloudWatch Dashboards. You can use the new dashboard APIs or CloudFormation templates to dynamically build and maintain dashboards to monitor your infrastructure and applications. There are four new dashboard APIs - PutDashboard, GetDashboard, DeleteDashboards, and ListDashboards APIs. PutDashboard is used to create a new dashboard or modify an existing one whereas GetDashboard is the API to get the details of a specific dashboard. ListDashboards and DeleteDashboards are used to get the names or delete multiple dashboards respectively. Getting started with dashboard APIs is similar to any other AWS APIs. The APIs can be accessed through AWS SDK or through CLI tools. -* `service/route53`: Updates service API and documentation - * Bug fix for InvalidChangeBatch exception. - -### SDK Enhancements -* `service/s3/s3manager`: adding cleanup function to batch objects [#1375](https://github.com/aws/aws-sdk-go/issues/1375) - * This enhancement will add an After field that will be called after each iteration of the batch operation. - -Release v1.10.6 (2017-06-30) -=== - -### Service Client Updates -* `service/marketplacecommerceanalytics`: Updates service documentation - * Documentation updates for AWS Marketplace Commerce Analytics. -* `service/s3`: Updates service API and documentation - * API Update for S3: Adding Object Tagging Header to MultipartUpload Initialization - -Release v1.10.5 (2017-06-29) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/events`: Updates service API and documentation - * CloudWatch Events now allows different AWS accounts to share events with each other through a new resource called event bus. Event buses accept events from AWS services, other AWS accounts and PutEvents API calls. Currently all AWS accounts have one default event bus. To send events to another account, customers simply write rules to match the events of interest and attach an event bus in the receiving account as the target to the rule. The PutTargets API has been updated to allow adding cross account event buses as targets. In addition, we have released two new APIs - PutPermission and RemovePermission - that enables customers to add/remove permissions to their default event bus. -* `service/gamelift`: Updates service API and documentation - * Allow developers to download GameLift fleet creation logs to assist with debugging. -* `service/ssm`: Updates service API and documentation - * Adding Resource Data Sync support to SSM Inventory. New APIs: * CreateResourceDataSync - creates a new resource data sync configuration, * ListResourceDataSync - lists existing resource data sync configurations, * DeleteResourceDataSync - deletes an existing resource data sync configuration. - -Release v1.10.4 (2017-06-27) -=== - -### Service Client Updates -* `service/servicecatalog`: Updates service API, documentation, and paginators - * Proper tagging of resources is critical to post-launch operations such as billing, cost allocation, and resource management. By using Service Catalog's TagOption Library, administrators can define a library of re-usable TagOptions that conform to company standards, and associate these with Service Catalog portfolios and products. Learn how to move your current tags to the new library, create new TagOptions, and view and associate your library items with portfolios and products. Understand how to ensure that the right tags are created on products launched through Service Catalog and how to provide users with defined selectable tags. - -### SDK Bugs -* `aws/signer/v4`: checking length on `stripExcessSpaces` [#1372](https://github.com/aws/aws-sdk-go/issues/1372) - * Fixes a bug where `stripExcessSpaces` did not check length against the slice. - * Fixes: [#1371](https://github.com/aws/aws-sdk-go/issues/1371) - -Release v1.10.3 (2017-06-23) -=== - -### Service Client Updates -* `service/lambda`: Updates service API and documentation - * The Lambda Invoke API will now throw new exception InvalidRuntimeException (status code 502) for invokes with deprecated runtimes. - -Release v1.10.2 (2017-06-22) -=== - -### Service Client Updates -* `service/codepipeline`: Updates service API, documentation, and paginators - * A new API, ListPipelineExecutions, enables you to retrieve summary information about the most recent executions in a pipeline, including pipeline execution ID, status, start time, and last updated time. You can request information for a maximum of 100 executions. Pipeline execution data is available for the most recent 12 months of activity. -* `service/dms`: Updates service API and documentation - * Added tagging for DMS certificates. -* `service/elasticloadbalancing`: Updates service waiters -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lightsail`: Updates service API and documentation - * This release adds a new nextPageToken property to the result of the GetOperationsForResource API. Developers can now get the next set of items in a list by making subsequent calls to GetOperationsForResource API with the token from the previous call. This release also deprecates the nextPageCount property, which previously returned null (use the nextPageToken property instead). This release also deprecates the customImageName property on the CreateInstancesRequest class, which was previously ignored by the API. -* `service/route53`: Updates service API and documentation - * This release reintroduces the HealthCheckInUse exception. - -Release v1.10.1 (2017-06-21) -=== - -### Service Client Updates -* `service/dax`: Adds new service - * Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for DynamoDB that delivers up to a 10x performance improvement - from milliseconds to microseconds - even at millions of requests per second. DAX does all the heavy lifting required to add in-memory acceleration to your DynamoDB tables, without requiring developers to manage cache invalidation, data population, or cluster management. -* `service/route53`: Updates service API and documentation - * Amazon Route 53 now supports multivalue answers in response to DNS queries, which lets you route traffic approximately randomly to multiple resources, such as web servers. Create one multivalue answer record for each resource and, optionally, associate an Amazon Route 53 health check with each record, and Amazon Route 53 responds to DNS queries with up to eight healthy records. -* `service/ssm`: Updates service API, documentation, and paginators - * Adding hierarchy support to the SSM Parameter Store API. Added support tor tagging. New APIs: GetParameter - retrieves one parameter, DeleteParameters - deletes multiple parameters (max number 10), GetParametersByPath - retrieves parameters located in the hierarchy. Updated APIs: PutParameter - added ability to enforce parameter value by applying regex (AllowedPattern), DescribeParameters - modified to support Tag filtering. -* `service/waf`: Updates service API and documentation - * You can now create, edit, update, and delete a new type of WAF rule with a rate tracking component. -* `service/waf-regional`: Updates service API and documentation - -Release v1.10.0 (2017-06-20) -=== - -### Service Client Updates -* `service/workdocs`: Updates service API and documentation - * This release provides a new API to retrieve the activities performed by WorkDocs users. - -### SDK Features -* `aws/credentials/plugincreds`: Add support for Go plugin for credentials [#1320](https://github.com/aws/aws-sdk-go/pull/1320) - * Adds support for using plugins to retrieve credentials for API requests. This change adds a new package plugincreds under aws/credentials. See the `example/aws/credentials/plugincreds` folder in the SDK for example usage. - -Release v1.9.00 (2017-06-19) -=== - -### Service Client Updates -* `service/organizations`: Updates service API and documentation - * Improvements to Exception Modeling - -### SDK Features -* `service/s3/s3manager`: Adds batch operations to s3manager [#1333](https://github.com/aws/aws-sdk-go/pull/1333) - * Allows for batch upload, download, and delete of objects. Also adds the interface pattern to allow for easy traversal of objects. E.G `DownloadWithIterator`, `UploadWithIterator`, and `BatchDelete`. `BatchDelete` also contains a utility iterator using the `ListObjects` API to easily delete a list of objects. - -Release v1.8.44 (2017-06-16) -=== - -### Service Client Updates -* `service/xray`: Updates service API, documentation, and paginators - * Add a response time histogram to the services in response of GetServiceGraph API. - -Release v1.8.43 (2017-06-15) -=== - -### Service Client Updates -* `service/ec2`: Updates service API and documentation - * Adds API to describe Amazon FPGA Images (AFIs) available to customers, which includes public AFIs, private AFIs that you own, and AFIs owned by other AWS accounts for which you have load permissions. -* `service/ecs`: Updates service API and documentation - * Added support for cpu, memory, and memory reservation container overrides on the RunTask and StartTask APIs. -* `service/iot`: Updates service API and documentation - * Revert the last release: remove CertificatePem from DescribeCertificate API. -* `service/servicecatalog`: Updates service API, documentation, and paginators - * Added ProvisioningArtifactSummaries to DescribeProductAsAdmin's output to show the provisioning artifacts belong to the product. Allow filtering by SourceProductId in SearchProductsAsAdmin for AWS Marketplace products. Added a verbose option to DescribeProvisioningArtifact to display the CloudFormation template used to create the provisioning artifact.Added DescribeProvisionedProduct API. Changed the type of ProvisionedProduct's Status to be distinct from Record's Status. New ProvisionedProduct's Status are AVAILABLE, UNDER_CHANGE, TAINTED, ERROR. Changed Record's Status set of values to CREATED, IN_PROGRESS, IN_PROGRESS_IN_ERROR, SUCCEEDED, FAILED. - -### SDK Bugs -* `private/model/api`: Fix RESTXML support for XML Namespace [#1343](https://github.com/aws/aws-sdk-go/pull/1343) - * Fixes a bug with the SDK's generation of services using the REST XML protocol not annotating shape references with the XML Namespace attribute. - * Fixes [#1334](https://github.com/aws/aws-sdk-go/pull/1334) - -Release v1.8.42 (2017-06-14) -=== - -### Service Client Updates -* `service/applicationautoscaling`: Updates service API and documentation -* `service/clouddirectory`: Updates service documentation - * Documentation update for Cloud Directory - -Release v1.8.41 (2017-06-13) -=== - -### Service Client Updates -* `service/configservice`: Updates service API - -Release v1.8.40 (2017-06-13) -=== - -### Service Client Updates -* `service/rds`: Updates service API and documentation - * API Update for RDS: this update enables copy-on-write, a new Aurora MySQL Compatible Edition feature that allows users to restore their database, and support copy of TDE enabled snapshot cross region. - -### SDK Bugs -* `aws/request`: Fix NewErrParamMinLen to use correct ParamMinLenErrCode [#1336](https://github.com/aws/aws-sdk-go/issues/1336) - * Fixes the `NewErrParamMinLen` function returning the wrong error code. `ParamMinLenErrCode` should be returned not `ParamMinValueErrCode`. - * Fixes [#1335](https://github.com/aws/aws-sdk-go/issues/1335) - -Release v1.8.39 (2017-06-09) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/opsworks`: Updates service API and documentation - * Tagging Support for AWS OpsWorks Stacks - -Release v1.8.38 (2017-06-08) -=== - -### Service Client Updates -* `service/iot`: Updates service API and documentation - * In addition to using certificate ID, AWS IoT customers can now obtain the description of a certificate with the certificate PEM. -* `service/pinpoint`: Updates service API and documentation - * Starting today Amazon Pinpoint adds SMS Text and Email Messaging support in addition to Mobile Push Notifications, providing developers, product managers and marketers with multi-channel messaging capabilities to drive user engagement in their applications. Pinpoint also enables backend services and applications to message users directly and provides advanced user and app analytics to understand user behavior and messaging performance. -* `service/rekognition`: Updates service API and documentation - * API Update for AmazonRekognition: Adding RecognizeCelebrities API - -Release v1.8.37 (2017-06-07) -=== - -### Service Client Updates -* `service/codebuild`: Updates service API and documentation - * Add support to APIs for privileged containers. This change would allow performing privileged operations like starting the Docker daemon inside builds possible in custom docker images. -* `service/greengrass`: Adds new service - * AWS Greengrass is software that lets you run local compute, messaging, and device state synchronization for connected devices in a secure way. With AWS Greengrass, connected devices can run AWS Lambda functions, keep device data in sync, and communicate with other devices securely even when not connected to the Internet. Using AWS Lambda, Greengrass ensures your IoT devices can respond quickly to local events, operate with intermittent connections, and minimize the cost of transmitting IoT data to the cloud. - -Release v1.8.36 (2017-06-06) -=== - -### Service Client Updates -* `service/acm`: Updates service documentation - * Documentation update for AWS Certificate Manager. -* `service/cloudfront`: Updates service documentation - * Doc update to fix incorrect prefix in S3OriginConfig -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/iot`: Updates service API - * Update client side validation for SalesForce action. - -Release v1.8.35 (2017-06-05) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * AppStream 2.0 Custom Security Groups allows you to easily control what network resources your streaming instances and images have access to. You can assign up to 5 security groups per Fleet to control the inbound and outbound network access to your streaming instances to specific IP ranges, network protocols, or ports. -* `service/iot`: Updates service API, documentation, paginators, and examples - * Added Salesforce action to IoT Rules Engine. - -Release v1.8.34 (2017-06-02) -=== - -### Service Client Updates -* `service/kinesisanalytics`: Updates service API, documentation, and paginators - * Kinesis Analytics publishes error messages CloudWatch logs in case of application misconfigurations -* `service/workdocs`: Updates service API and documentation - * This release includes new APIs to manage tags and custom metadata on resources and also new APIs to add and retrieve comments at the document level. - -Release v1.8.33 (2017-06-01) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * AWS CodeDeploy has improved how it manages connections to GitHub accounts and repositories. You can now create and store up to 25 connections to GitHub accounts in order to associate AWS CodeDeploy applications with GitHub repositories. Each connection can support multiple repositories. You can create connections to up to 25 different GitHub accounts, or create more than one connection to a single account. The ListGitHubAccountTokenNames command has been introduced to retrieve the names of stored connections to GitHub accounts that you have created. The name of the connection to GitHub used for an AWS CodeDeploy application is also included in the ApplicationInfo structure. Two new fields, lastAttemptedDeployment and lastSuccessfulDeployment, have been added to DeploymentGroupInfo to improve the handling of deployment group information in the AWS CodeDeploy console. Information about these latest deployments can also be retrieved using the GetDeploymentGroup and BatchGetDeployment group requests. Also includes a region update (us-gov-west-1). -* `service/cognitoidentityprovider`: Updates service API, documentation, and paginators -* `service/elbv2`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lexmodelbuildingservice`: Updates service documentation and examples - -### SDK Enhancements -* `aws/defaults`: Exports shared credentials and config default filenames used by the SDK. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) - * Adds SharedCredentialsFilename and SharedConfigFilename functions to defaults package. - -### SDK Bugs -* `aws/credentials`: Fixes shared credential provider's default filename on Windows. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) - * The shared credentials provider would attempt to use the wrong filename on Windows if the `HOME` environment variable was defined. -* `service/s3/s3manager`: service/s3/s3manager: Fix Downloader ignoring Range get parameter [#1311](https://github.com/aws/aws-sdk-go/pull/1311) - * Fixes the S3 Download Manager ignoring the GetObjectInput's Range parameter. If this parameter is provided it will force the downloader to fallback to a single GetObject request disabling concurrency and automatic part size gets. - * Fixes [#1296](https://github.com/aws/aws-sdk-go/issues/1296) - -Release v1.8.32 (2017-05-31) -=== - -### Service Client Updates -* `service/rds`: Updates service API and documentation - * Amazon RDS customers can now easily and quickly stop and start their DB instances. - -Release v1.8.31 (2017-05-30) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API, documentation, and paginators - * Cloud Directory has launched support for Typed Links, enabling customers to create object-to-object relationships that are not hierarchical in nature. Typed Links enable customers to quickly query for data along these relationships. Customers can also enforce referential integrity using Typed Links, ensuring data in use is not inadvertently deleted. -* `service/s3`: Updates service paginators and examples - * New example snippets for Amazon S3. - -Release v1.8.30 (2017-05-25) -=== - -### Service Client Updates -* `service/appstream`: Updates service API and documentation - * Support added for persistent user storage, backed by S3. -* `service/rekognition`: Updates service API and documentation - * Updated the CompareFaces API response to include orientation information, unmatched faces, landmarks, pose, and quality of the compared faces. - -Release v1.8.29 (2017-05-24) -=== - -### Service Client Updates -* `service/iam`: Updates service API - * The unique ID and access key lengths were extended from 32 to 128 -* `service/storagegateway`: Updates service API and documentation - * Two Storage Gateway data types, Tape and TapeArchive, each have a new response element, TapeUsedInBytes. This element helps you manage your virtual tapes. By using TapeUsedInBytes, you can see the amount of data written to each virtual tape. -* `service/sts`: Updates service API, documentation, and paginators - * The unique ID and access key lengths were extended from 32 to 128. - -Release v1.8.28 (2017-05-23) -=== - -### Service Client Updates -* `service/databasemigrationservice`: Updates service API, documentation, paginators, and examples - * This release adds support for using Amazon S3 and Amazon DynamoDB as targets for database migration, and using MongoDB as a source for database migration. For more information, see the AWS Database Migration Service documentation. - -Release v1.8.27 (2017-05-22) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/resourcegroupstaggingapi`: Updates service API, documentation, and paginators - * You can now specify the number of resources returned per page in GetResources operation, as an optional parameter, to easily manage the list of resources returned by your queries. - -### SDK Bugs -* `aws/request`: Add support for PUT temporary redirects (307) [#1283](https://github.com/aws/aws-sdk-go/issues/1283) - * Adds support for Go 1.8's GetBody function allowing the SDK's http request using PUT and POST methods to be redirected with temporary redirects with 307 status code. - * Fixes: [#1267](https://github.com/aws/aws-sdk-go/issues/1267) -* `aws/request`: Add handling for retrying temporary errors during unmarshal [#1289](https://github.com/aws/aws-sdk-go/issues/1289) - * Adds support for retrying temporary errors that occur during unmarshaling of a request's response body. - * Fixes: [#1275](https://github.com/aws/aws-sdk-go/issues/1275) - -Release v1.8.26 (2017-05-18) -=== - -### Service Client Updates -* `service/athena`: Adds new service - * This release adds support for Amazon Athena. Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run. -* `service/lightsail`: Updates service API, documentation, and paginators - * This release adds new APIs that make it easier to set network port configurations on Lightsail instances. Developers can now make a single request to both open and close public ports on an instance using the PutInstancePublicPorts operation. - -### SDK Bugs -* `aws/request`: Fix logging from reporting wrong retry request errors #1281 - * Fixes the SDK's retry request logging to report the the actual error that occurred, not a stubbed Unknown error message. - * Fixes the SDK's response logger to not output the response log multiple times per retry. - -Release v1.8.25 (2017-05-17) -=== - -### Service Client Updates -* `service/autoscaling`: Updates service documentation, paginators, and examples - * Various Auto Scaling documentation updates -* `service/cloudwatchevents`: Updates service documentation - * Various CloudWatch Events documentation updates. -* `service/cloudwatchlogs`: Updates service documentation and paginators - * Various CloudWatch Logs documentation updates. -* `service/polly`: Updates service API - * Amazon Polly adds new German voice "Vicki" - -Release v1.8.24 (2017-05-16) -=== - -### Service Client Updates -* `service/codedeploy`: Updates service API and documentation - * This release introduces the previousRevision field in the responses to the GetDeployment and BatchGetDeployments actions. previousRevision provides information about the application revision that was deployed to the deployment group before the most recent successful deployment. Also, the fileExistsBehavior parameter has been added for CreateDeployment action requests. In the past, if the AWS CodeDeploy agent detected files in a target location that weren't part of the application revision from the most recent successful deployment, it would fail the current deployment by default. This new parameter provides options for how the agent handles these files: fail the deployment, retain the content, or overwrite the content. -* `service/gamelift`: Updates service API and documentation - * Allow developers to specify how metrics are grouped in CloudWatch for their GameLift fleets. Developers can also specify how many concurrent game sessions activate on a per-instance basis. -* `service/inspector`: Updates service API, documentation, paginators, and examples - * Adds ability to produce an assessment report that includes detailed and comprehensive results of a specified assessment run. -* `service/kms`: Updates service documentation - * Update documentation for KMS. - -Release v1.8.23 (2017-05-15) -=== - -### Service Client Updates -* `service/ssm`: Updates service API and documentation - * UpdateAssociation API now supports updating document name and targets of an association. GetAutomationExecution API can return FailureDetails as an optional field to the StepExecution Object, which contains failure type, failure stage as well as other failure related information for a failed step. - -### SDK Enhancements -* `aws/session`: SDK should be able to load multiple custom shared config files. [#1258](https://github.com/aws/aws-sdk-go/issues/1258) - * This change adds a `SharedConfigFiles` field to the `session.Options` type that allows you to specify the files, and their order, the SDK will use for loading shared configuration and credentials from when the `Session` is created. Use the `NewSessionWithOptions` Session constructor to specify these options. You'll also most likely want to enable support for the shared configuration file's additional attributes by setting `session.Option`'s `SharedConfigState` to `session.SharedConfigEnabled`. - -Release v1.8.22 (2017-05-11) -=== - -### Service Client Updates -* `service/elb`: Updates service API, documentation, and paginators -* `service/elbv2`: Updates service API and documentation -* `service/lexmodelbuildingservice`: Updates service API and documentation -* `service/organizations`: Updates service API, documentation, paginators, and examples - * AWS Organizations APIs that return an Account object now include the email address associated with the account’s root user. - -Release v1.8.21 (2017-05-09) -=== - -### Service Client Updates -* `service/codestar`: Updates service documentation - * Updated documentation for AWS CodeStar. -* `service/workspaces`: Updates service API, documentation, and paginators - * Doc-only Update for WorkSpaces - -Release v1.8.20 (2017-05-04) -=== - -### Service Client Updates -* `service/ecs`: Updates service API, documentation, and paginators - * Exposes container instance registration time in ECS:DescribeContainerInstances. -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/marketplaceentitlementservice`: Adds new service -* `service/lambda`: Updates service API and documentation - * Support for UpdateFunctionCode DryRun option - -Release v1.8.19 (2017-04-28) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service waiters and paginators - * Adding back the removed waiters and paginators. - -Release v1.8.18 (2017-04-28) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service API, documentation, waiters, paginators, and examples - * API update for CloudFormation: New optional parameter ClientRequestToken which can be used as an idempotency token to safely retry certain operations as well as tagging StackEvents. -* `service/rds`: Updates service API, documentation, and examples - * The DescribeDBClusterSnapshots API now returns a SourceDBClusterSnapshotArn field which identifies the source DB cluster snapshot of a copied snapshot. -* `service/rekognition`: Updates service API - * Fix for missing file type check -* `service/snowball`: Updates service API, documentation, and paginators - * The Snowball API has a new exception that can be thrown for list operation requests. -* `service/sqs`: Updates service API, documentation, and paginators - * Adding server-side encryption (SSE) support to SQS by integrating with AWS KMS; adding new queue attributes to SQS CreateQueue, SetQueueAttributes and GetQueueAttributes APIs to support SSE. - -Release v1.8.17 (2017-04-26) -=== - -### Service Client Updates -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * With Amazon Relational Database Service (Amazon RDS) running MySQL or Amazon Aurora, you can now authenticate to your DB instance using IAM database authentication. - -Release v1.8.16 (2017-04-21) -=== - -### Service Client Updates -* `service/appstream`: Updates service API, documentation, and paginators - * The new feature named "Default Internet Access" will enable Internet access from AppStream 2.0 instances - image builders and fleet instances. Admins will check a flag either through AWS management console for AppStream 2.0 or through API while creating an image builder or while creating/updating a fleet. -* `service/kinesis`: Updates service API, documentation, waiters, and paginators - * Adds a new waiter, StreamNotExists, to Kinesis. - -### SDK Enhancements -* `aws/endpoints`: Add utilities improving endpoints lookup (#1218) - * Adds several utilities to the endpoints packages to make looking up partitions, regions, and services easier. - * Fixes #994 - -### SDK Bugs -* `private/protocol/xml/xmlutil`: Fix unmarshaling dropping errors (#1219) - * The XML unmarshaler would drop any serialization or body read error that occurred on the floor effectively hiding any errors that would occur. - * Fixes #1205 - -Release v1.8.15 (2017-04-20) -=== - -### Service Client Updates -* `service/devicefarm`: Updates service API and documentation - * API Update for AWS Device Farm: Support for Deals and Promotions -* `service/directconnect`: Updates service documentation - * Documentation updates for AWS Direct Connect. -* `service/elbv2`: Updates service waiters -* `service/kms`: Updates service documentation and examples - * Doc-only update for Key Management Service (KMS): Update docs for GrantConstraints and GenerateRandom -* `service/route53`: Updates service documentation - * Release notes: SDK documentation now includes examples for ChangeResourceRecordSets for all types of resource record set, such as weighted, alias, and failover. -* `service/route53domains`: Updates service API, documentation, and paginators - * Adding examples and other documentation updates. - -### SDK Enhancements -* `service/s3`: Add utilities to make getting a bucket's region easier (#1207) - * Adds two features which make it easier to get a bucket's region, `s3.NormalizeBucketLocation` and `s3manager.GetBucketRegion`. - -### SDK Bugs -* `service/s3`: Fix HeadObject's incorrect documented error codes (#1213) - * The HeadObject's model incorrectly states that the operation can return the NoSuchKey error code. - * Fixes #1208 - -Release v1.8.14 (2017-04-19) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * Add support for "embed" property. -* `service/codestar`: Adds new service - * AWS CodeStar is a cloud-based service for creating, managing, and working with software development projects on AWS. An AWS CodeStar project creates and integrates AWS services for your project development toolchain. AWS CodeStar also manages the permissions required for project users. -* `service/ec2`: Updates service API and documentation - * Adds support for creating an Amazon FPGA Image (AFI) from a specified design checkpoint (DCP). -* `service/iam`: Updates service API and documentation - * This changes introduces a new IAM role type, Service Linked Role, which works like a normal role but must be managed via services' control. -* `service/lambda`: Updates service API and documentation - * Lambda integration with CloudDebugger service to enable customers to enable tracing for the Lambda functions and send trace information to the CloudDebugger service. -* `service/lexmodelbuildingservice`: Adds new service -* `service/polly`: Updates service API, documentation, and paginators - * API Update for Amazon Polly: Add support for speech marks -* `service/rekognition`: Updates service API and documentation - * Given an image, the API detects explicit or suggestive adult content in the image and returns a list of corresponding labels with confidence scores, as well as a taxonomy (parent-child relation) for each label. - -Release v1.8.13 (2017-04-18) -=== - -### Service Client Updates -* `service/lambda`: Updates service API and documentation - * You can use tags to group and filter your Lambda functions, making it easier to analyze them for billing allocation purposes. For more information, see Tagging Lambda Functions. You can now write or upgrade your Lambda functions using Python version 3.6. For more information, see Programming Model for Authoring Lambda Functions in Python. Note: Features will be rolled out in the US regions on 4/19. - -### SDK Enhancements -* `aws/request`: add support for appengine's custom standard library (#1190) - * Remove syscall error checking on appengine platforms. - -Release v1.8.12 (2017-04-11) -=== - -### Service Client Updates -* `service/apigateway`: Updates service API and documentation - * API Gateway request validators -* `service/batch`: Updates service API and documentation - * API Update for AWS Batch: Customer provided AMI for MANAGED Compute Environment -* `service/gamelift`: Updates service API and documentation - * Allows developers to utilize an improved workflow when calling our Queues API and introduces a new feature that allows developers to specify a maximum allowable latency per Queue. -* `service/opsworks`: Updates service API, documentation, and paginators - * Cloudwatch Logs agent configuration can now be attached to OpsWorks Layers using CreateLayer and UpdateLayer. OpsWorks will then automatically install and manage the CloudWatch Logs agent on the instances part of the OpsWorks Layer. - -### SDK Bugs -* `aws/client`: Fix clients polluting handler list (#1197) - * Fixes the clients potentially polluting the passed in handler list with the client's customizations. This change ensures every client always works with a clean copy of the request handlers and it cannot pollute the handlers back upstream. - * Fixes #1184 -* `aws/request`: Fix waiter error match condition (#1195) - * Fixes the waiters's matching overwriting the request's err, effectively ignoring the error condition. This broke waiters with the FailureWaiterState matcher state. - -Release v1.8.11 (2017-04-07) -=== - -### Service Client Updates -* `service/redshift`: Updates service API, documentation, and paginators - * This update adds the GetClusterCredentials API which is used to get temporary login credentials to the cluster. AccountWithRestoreAccess now has a new member AccountAlias, this is the identifier of the AWS support account authorized to restore the specified snapshot. This is added to support the feature where the customer can share their snapshot with the Amazon Redshift Support Account without having to manually specify the AWS Redshift Service account ID on the AWS Console/API. - -Release v1.8.10 (2017-04-06) -=== - -### Service Client Updates -* `service/elbv2`: Updates service documentation - -Release v1.8.9 (2017-04-05) -=== - -### Service Client Updates -* `service/elasticache`: Updates service API, documentation, paginators, and examples - * ElastiCache added support for testing the Elasticache Multi-AZ feature with Automatic Failover. - -Release v1.8.8 (2017-04-04) -=== - -### Service Client Updates -* `service/cloudwatch`: Updates service API, documentation, and paginators - * Amazon Web Services announced the immediate availability of two additional alarm configuration rules for Amazon CloudWatch Alarms. The first rule is for configuring missing data treatment. Customers have the options to treat missing data as alarm threshold breached, alarm threshold not breached, maintain alarm state and the current default treatment. The second rule is for alarms based on percentiles metrics that can trigger unnecassarily if the percentile is calculated from a small number of samples. The new rule can treat percentiles with low sample counts as same as missing data. If the first rule is enabled, the same treatment will be applied when an alarm encounters a percentile with low sample counts. - -Release v1.8.7 (2017-04-03) -=== - -### Service Client Updates -* `service/lexruntimeservice`: Updates service API and documentation - * Adds support to PostContent for speech input - -### SDK Enhancements -* `aws/request`: Improve handler copy, push back, push front performance (#1171) - * Minor optimization to the handler list's handling of copying and pushing request handlers to the handler list. -* Update codegen header to use Go std wording (#1172) - * Go recently accepted the proposal for standard generated file header wording in, https://golang.org/s/generatedcode. - -### SDK Bugs -* `service/dynamodb`: Fix DynamoDB using custom retryer (#1170) - * Fixes (#1139) the DynamoDB service client clobbering any custom retryer that was passed into the service client or Session's config. - -Release v1.8.6 (2017-04-01) -=== - -### Service Client Updates -* `service/clouddirectory`: Updates service API and documentation - * ListObjectAttributes now supports filtering by facet. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.8.5 (2017-03-30) -=== - -### Service Client Updates -* `service/cloudformation`: Updates service waiters and paginators - * Adding paginators for ListExports and ListImports -* `service/cloudfront`: Adds new service - * Amazon CloudFront now supports user configurable HTTP Read and Keep-Alive Idle Timeouts for your Custom Origin Servers -* `service/configservice`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/resourcegroupstaggingapi`: Adds new service -* `service/storagegateway`: Updates service API and documentation - * File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. Once a file share is created, any changes made externally to the S3 bucket will not be reflected by the gateway. Using the cache refresh feature in this update, the customer can trigger an on-demand scan of the keys in their S3 bucket and refresh the file namespace cached on the gateway. It takes as an input the fileShare ARN and refreshes the cache for only that file share. Additionally there is new functionality on file gateway that allows you configure what squash options they would like on their file share, this allows a customer to configure their gateway to not squash root permissions. This can be done by setting options in NfsOptions for CreateNfsFileShare and UpdateNfsFileShare APIs. - -Release v1.8.4 (2017-03-28) -=== - -### Service Client Updates -* `service/batch`: Updates service API, documentation, and paginators - * Customers can now provide a retryStrategy as part of the RegisterJobDefinition and SubmitJob API calls. The retryStrategy object has a number value for attempts. This is the number of non successful executions before a job is considered FAILED. In addition, the JobDetail object now has an attempts field and shows all execution attempts. -* `service/ec2`: Updates service API and documentation - * Customers can now tag their Amazon EC2 Instances and Amazon EBS Volumes at - the time of their creation. You can do this from the EC2 Instance launch - wizard or through the RunInstances or CreateVolume APIs. By tagging - resources at the time of creation, you can eliminate the need to run custom - tagging scripts after resource creation. In addition, you can now set - resource-level permissions on the CreateVolume, CreateTags, DeleteTags, and - the RunInstances APIs. This allows you to implement stronger security - policies by giving you more granular control over which users and groups - have access to these APIs. You can also enforce the use of tagging and - control what tag keys and values are set on your resources. When you combine - tag usage and resource-level IAM policies together, you can ensure your - instances and volumes are properly secured upon creation and achieve more - accurate cost allocation reporting. These new features are provided at no - additional cost. - -### SDK Enhancements -* `aws/request`: Add retry support for RequestTimeoutException (#1158) - * Adds support for retrying RequestTimeoutException error code that is returned by some services. - -### SDK Bugs -* `private/model/api`: Fix Waiter and Paginators panic on nil param inputs (#1157) - * Corrects the code generation for Paginators and waiters that caused a panic if nil input parameters were used with the operations. - -Release v1.8.3 (2017-03-27) -=== - -## Service Client Updates -* `service/ssm`: Updates service API, documentation, and paginators - * Updated validation rules for SendCommand and RegisterTaskWithMaintenanceWindow APIs. -Release v1.8.2 (2017-03-24) -=== - -Service Client Updates ---- -* `service/applicationautoscaling`: Updates service API, documentation, and paginators - * Application AutoScaling is launching support for a new target resource (AppStream 2.0 Fleets) as a scalable target. -* `service/cloudtrail`: Updates service API and documentation - * Doc-only Update for CloudTrail: Add required parameters for GetEventSelectors and PutEventSelectors - -Release v1.8.1 (2017-03-23) -=== - -Service Client Updates ---- -* `service/applicationdiscoveryservice`: Updates service API, documentation, and paginators - * Adds export configuration options to the AWS Discovery Service API. -* `service/elbv2`: Updates waiters -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/lambda`: Updates service API and paginators - * Adds support for new runtime Node.js v6.10 for AWS Lambda service - -Release v1.8.0 (2017-03-22) -=== - -Service Client Updates ---- -* `service/codebuild`: Updates service documentation -* `service/directconnect`: Updates service API - * Deprecated DescribeConnectionLoa, DescribeInterconnectLoa, AllocateConnectionOnInterconnect and DescribeConnectionsOnInterconnect operations in favor of DescribeLoa, DescribeLoa, AllocateHostedConnection and DescribeHostedConnections respectively. -* `service/marketplacecommerceanalytics`: Updates service API, documentation, and paginators - * This update adds a new data set, us_sales_and_use_tax_records, which enables AWS Marketplace sellers to programmatically access to their U.S. Sales and Use Tax report data. -* `service/pinpoint`: Updates service API and documentation - * Amazon Pinpoint User Segmentation - * Added ability to segment endpoints by user attributes in addition to endpoint attributes. Amazon Pinpoint Event Stream Preview - * Added functionality to publish raw app analytics and campaign events data as events streams to Kinesis and Kinesis Firehose - * The feature provides developers with increased flexibility of exporting raw events to S3, Redshift, Elasticsearch using a Kinesis Firehose stream or enable real time event processing use cases using a Kinesis stream -* `service/rekognition`: Updates service documentation. - -SDK Features ---- -* `aws/request`: Add support for context.Context to SDK API operation requests (#1132) - * Adds support for context.Context to the SDK by adding `WithContext` methods for each API operation, Paginators and Waiters. e.g `PutObjectWithContext`. This change also adds the ability to provide request functional options to the method calls instead of requiring you to use the `Request` API operation method (e.g `PutObjectRequest`). - * Adds a `Complete` Request handler list that will be called ever time a request is completed. This includes both success and failure. Complete will only be called once per API operation request. - * `private/waiter` package moved from the private group to `aws/request/waiter` and made publicly available. - * Adds Context support to all API operations, Waiters(WaitUntil) and Paginators(Pages) methods. - * Adds Context support for s3manager and s3crypto clients. - -SDK Enhancements ---- -* `aws/signer/v4`: Adds support for unsigned payload signer config (#1130) - * Adds configuration option to the v4.Signer to specify the request's body should not be signed. This will only correclty function on services that support unsigned payload. e.g. S3, Glacier. - -SDK Bug Fixes ---- -* `service/s3`: Fix S3 HostID to be available in S3 request error message (#1131) - * Adds a new type s3.RequestFailure which exposes the S3 HostID value from a S3 API operation response. This is helpful when you have an error with S3, and need to contact support. Both RequestID and HostID are needed. -* `private/model/api`: Do not return a link if uid is empty (#1133) - * Fixes SDK's doc generation to not generate API reference doc links if the SDK us unable to create a valid link. -* `aws/request`: Optimization to handler list copy to prevent multiple alloc calls. (#1134) -Release v1.7.9 (2017-03-13) -=== - -Service Client Updates ---- -* `service/devicefarm`: Updates service API, documentation, paginators, and examples - * Network shaping allows users to simulate network connections and conditions while testing their Android, iOS, and web apps with AWS Device Farm. -* `service/cloudwatchevents`: Updates service API, documentation, and examples - -SDK Enhancement -=== -* `aws/session`: Add support for side loaded CA bundles (#1117) - * Adds supports for side loading Certificate Authority bundle files to the SDK using AWS_CA_BUNDLE environment variable or CustomCABundle session option. -* `service/s3/s3crypto`: Add support for AES/CBC/PKCS5Padding (#1124) - -SDK Bug -=== -* `service/rds`: Fixing issue when not providing `SourceRegion` on cross -region operations (#1127) -* `service/rds`: Enables cross region for `CopyDBClusterSnapshot` and -`CreateDBCluster` (#1128) - -Release v1.7.8 (2017-03-10) -=== - -Service Client Updates ---- -* `service/codedeploy`: Updates service paginators - * Add paginators for Codedeploy -* `service/emr`: Updates service API, documentation, and paginators - * This release includes support for instance fleets in Amazon EMR. - -Release v1.7.7 (2017-03-09) -=== - -Service Client Updates ---- -* `service/apigateway`: Updates service API, documentation, and paginators - * API Gateway has added support for ACM certificates on custom domain names. Both Amazon-issued certificates and uploaded third-part certificates are supported. -* `service/clouddirectory`: Updates service API, documentation, and paginators - * Introduces a new Cloud Directory API that enables you to retrieve all available parent paths for any type of object (a node, leaf node, policy node, and index node) in a hierarchy. - -Release v1.7.6 (2017-03-09) -=== - -Service Client Updates ---- -* `service/organizations`: Updates service documentation and examples - * Doc-only Update for Organizations: Add SDK Code Snippets -* `service/workdocs`: Adds new service - * The Administrative SDKs for Amazon WorkDocs provides full administrator level access to WorkDocs site resources, allowing developers to integrate their applications to manage WorkDocs users, content and permissions programmatically - -Release v1.7.5 (2017-03-08) -=== - -Service Client Updates ---- -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * Add support to using encrypted clusters as cross-region replication masters. Update CopyDBClusterSnapshot API to support encrypted cross region copy of Aurora cluster snapshots. - -Release v1.7.4 (2017-03-06) -=== - -Service Client Updates ---- -* `service/budgets`: Updates service API and paginators - * When creating or editing a budget via the AWS Budgets API you can define notifications that are sent to subscribers when the actual or forecasted value for cost or usage exceeds the notificationThreshold associated with the budget notification object. Starting today, the maximum allowed value for the notificationThreshold was raised from 100 to 300. This change was made to give you more flexibility when setting budget notifications. -* `service/cloudtrail`: Updates service documentation and paginators - * Doc-only update for AWSCloudTrail: Updated links/descriptions -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/opsworkscm`: Updates service API, documentation, and paginators - * OpsWorks for Chef Automate has added a new field "AssociatePublicIpAddress" to the CreateServer request, "CloudFormationStackArn" to the Server model and "TERMINATED" server state. - - -Release v1.7.3 (2017-02-28) -=== - -Service Client Updates ---- -* `service/mturk`: Renaming service - * service/mechanicalturkrequesterservice was renamed to service/mturk. Be sure to change any references of the old client to the new. - -Release v1.7.2 (2017-02-28) -=== - -Service Client Updates ---- -* `service/dynamodb`: Updates service API and documentation - * Release notes: Time to Live (TTL) is a feature that allows you to define when items in a table expire and can be purged from the database, so that you don't have to track expired data and delete it manually. With TTL enabled on a DynamoDB table, you can set a timestamp for deletion on a per-item basis, allowing you to limit storage usage to only those records that are relevant. -* `service/iam`: Updates service API, documentation, and paginators - * This release adds support for AWS Organizations service control policies (SCPs) to SimulatePrincipalPolicy operation. If there are SCPs associated with the simulated user's account, their effect on the result is captured in the OrganizationDecisionDetail element in the EvaluationResult. -* `service/mechanicalturkrequesterservice`: Adds new service - * Amazon Mechanical Turk is a web service that provides an on-demand, scalable, human workforce to complete jobs that humans can do better than computers, for example, recognizing objects in photos. -* `service/organizations`: Adds new service - * AWS Organizations is a web service that enables you to consolidate your multiple AWS accounts into an organization and centrally manage your accounts and their resources. -* `service/dynamodbstreams`: Updates service API, documentation, and paginators -* `service/waf`: Updates service API, documentation, and paginators - * Aws WAF - For GetSampledRequests action, changed max number of samples from 100 to 500. -* `service/wafregional`: Updates service API, documentation, and paginators - -Release v1.7.1 (2017-02-24) -=== - -Service Client Updates ---- -* `service/elasticsearchservice`: Updates service API, documentation, paginators, and examples - * Added three new API calls to existing Amazon Elasticsearch service to expose Amazon Elasticsearch imposed limits to customers. - -Release v1.7.0 (2017-02-23) -=== - -Service Client Updates ---- -* `service/ec2`: Updates service API - * New EC2 I3 instance type - -SDK Bug ---- -* `service/s3/s3manager`: Adding support for SSE (#1097) - * Fixes SSE fields not being applied to a part during multi part upload. - -SDK Feature ---- -* `aws/session`: Add support for AssumeRoles with MFA (#1088) - * Adds support for assuming IAM roles with MFA enabled. A TokenProvider func was added to stscreds.AssumeRoleProvider that will be called each time the role's credentials need to be refreshed. A basic token provider that sources the MFA token from stdin as stscreds.StdinTokenProvider. -* `aws/session`: Update SDK examples and docs to use session.Must (#1099) - * Updates the SDK's example and docs to use session.Must where possible to highlight its usage as apposed to session error checking that is most cases errors will be terminal to the application anyways. -Release v1.6.27 (2017-02-22) -=== - -Service Client Updates ---- -* `service/clouddirectory`: Updates service documentation - * ListObjectAttributes documentation updated based on forum feedback -* `service/elasticbeanstalk`: Updates service API, documentation, and paginators - * Elastic Beanstalk adds support for creating and managing custom platform. -* `service/gamelift`: Updates service API, documentation, and paginators - * Allow developers to configure global queues for creating GameSessions. Allow PlayerData on PlayerSessions to store player-specific data. -* `service/route53`: Updates service API, documentation, and examples - * Added support for operations CreateVPCAssociationAuthorization and DeleteVPCAssociationAuthorization to throw a ConcurrentModification error when a conflicting modification occurs in parallel to the authorizations in place for a given hosted zone. - -Release v1.6.26 (2017-02-21) -=== - -Service Client Updates ---- -* `service/ec2`: Updates service API and documentation - * Added the billingProduct parameter to the RegisterImage API. - -Release v1.6.25 (2017-02-17) -=== - -Service Client Updates ---- -* `service/directconnect`: Updates service API, documentation, and paginators - * This update will introduce the ability for Direct Connect customers to take advantage of Link Aggregation (LAG). This allows you to bundle many individual physical interfaces into a single logical interface, referred to as a LAG. This makes administration much simpler as the majority of configuration is done on the LAG while you are free to add or remove physical interfaces from the bundle as bandwidth demand increases or decreases. A concrete example of the simplification added by LAG is that customers need only a single BGP session as opposed to one session per physical connection. - -Release v1.6.24 (2017-02-16) -=== - -Service Client Updates ---- -* `service/cognitoidentity`: Updates service API, documentation, and paginators - * Allow createIdentityPool and updateIdentityPool API to set server side token check value on identity pool -* `service/configservice`: Updates service API and documentation - * AWS Config now supports a new test mode for the PutEvaluations API. Set the TestMode parameter to true in your custom rule to verify whether your AWS Lambda function will deliver evaluation results to AWS Config. No updates occur to your existing evaluations, and evaluation results are not sent to AWS Config. - -Release v1.6.23 (2017-02-15) -=== - -Service Client Updates ---- -* `service/kms`: Updates service API, documentation, paginators, and examples - * his release of AWS Key Management Service introduces the ability to tag keys. Tagging keys can help you organize your keys and track your KMS costs in the cost allocation report. This release also increases the maximum length of a key ID to accommodate ARNs that include a long key alias. - -Release v1.6.22 (2017-02-14) -=== - -Service Client Updates ---- -* `service/ec2`: Updates service API, documentation, and paginators - * Adds support for the new Modify Volumes apis. - -Release v1.6.21 (2017-02-11) -=== - -Service Client Updates ---- -* `service/storagegateway`: Updates service API, documentation, and paginators - * File gateway mode in AWS Storage gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. This is done by creating Nfs file shares using existing APIs CreateNfsFileShare. Using the feature in this update, the customer can restrict the clients that have read/write access to the gateway by specifying the list of clients as a list of IP addresses or CIDR blocks. This list can be specified using the API CreateNfsFileShare while creating new file shares, or UpdateNfsFileShare while update existing file shares. To find out the list of clients that have access, the existing API DescribeNfsFileShare will now output the list of clients that have access. - -Release v1.6.20 (2017-02-09) -=== - -Service Client Updates ---- -* `service/ec2`: Updates service API and documentation - * This feature allows customers to associate an IAM profile to running instances that do not have any. -* `service/rekognition`: Updates service API and documentation - * DetectFaces and IndexFaces operations now return an estimate of the age of the face as an age range. - -SDK Features ---- -* `aws/endpoints`: Add option to resolve unknown endpoints (#1074) -Release v1.6.19 (2017-02-08) -=== - -Service Client Updates ---- -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glacier`: Updates service examples - * Doc Update -* `service/lexruntimeservice`: Adds new service - * Preview release - -SDK Bug Fixes ---- -* `private/protocol/json`: Fixes json to throw an error if a float number is (+/-)Inf and NaN (#1068) -* `private/model/api`: Fix documentation error listing (#1067) - -SDK Features ---- -* `private/model`: Add service response error code generation (#1061) - -Release v1.6.18 (2017-01-27) -=== - -Service Client Updates ---- -* `service/clouddirectory`: Adds new service - * Amazon Cloud Directory is a highly scalable, high performance, multi-tenant directory service in the cloud. Its web-based directories make it easy for you to organize and manage application resources such as users, groups, locations, devices, policies, and the rich relationships between them. -* `service/codedeploy`: Updates service API, documentation, and paginators - * This release of AWS CodeDeploy introduces support for blue/green deployments. In a blue/green deployment, the current set of instances in a deployment group is replaced by new instances that have the latest application revision installed on them. After traffic is rerouted behind a load balancer to the replacement instances, the original instances can be terminated automatically or kept running for other uses. -* `service/ec2`: Updates service API and documentation - * Adds instance health check functionality to replace unhealthy EC2 Spot fleet instances with fresh ones. -* `service/rds`: Updates service API and documentation - * Snapshot Engine Version Upgrade - -Release v1.6.17 (2017-01-25) -=== - -Service Client Updates ---- -* `service/elbv2`: Updates service API, documentation, and paginators - * Application Load Balancers now support native Internet Protocol version 6 (IPv6) in an Amazon Virtual Private Cloud (VPC). With this ability, clients can now connect to the Application Load Balancer in a dual-stack mode via either IPv4 or IPv6. -* `service/rds`: Updates service API and documentation - * Cross Region Read Replica Copying (CreateDBInstanceReadReplica) - -Release v1.6.16 (2017-01-24) -=== - -Service Client Updates ---- -* `service/codebuild`: Updates service documentation and paginators - * Documentation updates -* `service/codecommit`: Updates service API, documentation, and paginators - * AWS CodeCommit now includes the option to view the differences between a commit and its parent commit from within the console. You can view the differences inline (Unified view) or side by side (Split view). To view information about the differences between a commit and something other than its parent, you can use the AWS CLI and the get-differences and get-blob commands, or you can use the GetDifferences and GetBlob APIs. -* `service/ecs`: Updates service API and documentation - * Amazon ECS now supports a state for container instances that can be used to drain a container instance in preparation for maintenance or cluster scale down. - -Release v1.6.15 (2017-01-20) -=== - -Service Client Updates ---- -* `service/acm`: Updates service API, documentation, and paginators - * Update for AWS Certificate Manager: Updated response elements for DescribeCertificate API in support of managed renewal -* `service/health`: Updates service documentation - -Release v1.6.14 (2017-01-19) -=== - -Service Client Updates ---- -* `service/ec2`: Updates service API, documentation, and paginators - * Amazon EC2 Spot instances now support dedicated tenancy, providing the ability to run Spot instances single-tenant manner on physically isolated hardware within a VPC to satisfy security, privacy, or other compliance requirements. Dedicated Spot instances can be requested using RequestSpotInstances and RequestSpotFleet. - -Release v1.6.13 (2017-01-18) -=== - -Service Client Updates ---- -* `service/rds`: Updates service API, documentation, and paginators - -Release v1.6.12 (2017-01-17) -=== - -Service Client Updates ---- -* `service/dynamodb`: Updates service API, documentation, and paginators - * Tagging Support for Amazon DynamoDB Tables and Indexes -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/glacier`: Updates service API, paginators, and examples - * Doc-only Update for Glacier: Added code snippets -* `service/polly`: Updates service documentation and examples - * Doc-only update for Amazon Polly -- added snippets -* `service/rekognition`: Updates service documentation and paginators - * Added code samples to Rekognition reference topics. -* `service/route53`: Updates service API and paginators - * Add ca-central-1 and eu-west-2 enum values to CloudWatchRegion enum - -Release v1.6.11 (2017-01-16) -=== - -Service Client Updates ---- -* `service/configservice`: Updates service API, documentation, and paginators -* `service/costandusagereportservice`: Adds new service - * The AWS Cost and Usage Report Service API allows you to enable and disable the Cost & Usage report, as well as modify the report name, the data granularity, and the delivery preferences. -* `service/dynamodb`: Updates service API, documentation, and examples - * Snippets for the DynamoDB API. -* `service/elasticache`: Updates service API, documentation, and examples - * Adds new code examples. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.6.10 (2017-01-04) -=== - -Service Client Updates ---- -* `service/configservice`: Updates service API and documentation - * AWSConfig is planning to add support for OversizedConfigurationItemChangeNotification message type in putConfigRule. After this release customers can use/write rules based on OversizedConfigurationItemChangeNotification mesage type. -* `service/efs`: Updates service API, documentation, and examples - * Doc-only Update for EFS: Added code snippets -* `service/iam`: Updates service documentation and examples -* `service/lambda`: Updates service documentation and examples - * Doc only updates for Lambda: Added code snippets -* `service/marketplacecommerceanalytics`: Updates service API and documentation - * Added support for data set disbursed_amount_by_instance_hours, with historical data available starting 2012-09-04. New data is published to this data set every 30 days. -* `service/rds`: Updates service documentation - * Updated documentation for CopyDBSnapshot. -* `service/rekognition`: Updates service documentation and examples - * Doc-only Update for Rekognition: Added code snippets -* `service/snowball`: Updates service examples -* `service/dynamodbstreams`: Updates service API and examples - * Doc-only Update for DynamoDB Streams: Added code snippets - -SDK Feature ---- -* `private/model/api`: Increasing the readability of code generated files. (#1024) -Release v1.6.9 (2016-12-30) -=== - -Service Client Updates ---- -* `service/codedeploy`: Updates service API and documentation - * CodeDeploy will support Iam Session Arns in addition to Iam User Arns for on premise host authentication. -* `service/ecs`: Updates service API and documentation - * Amazon EC2 Container Service (ECS) now supports the ability to customize the placement of tasks on container instances. -* `aws/endpoints`: Updated Regions and Endpoints metadata. - -Release v1.6.8 (2016-12-22) -=== - -Service Client Updates ---- -* `service/apigateway`: Updates service API and documentation - * Amazon API Gateway is adding support for generating SDKs in more languages. This update introduces two new operations used to dynamically discover these SDK types and what configuration each type accepts. -* `service/directoryservice`: Updates service documentation - * Added code snippets for the DS SDKs -* `service/elasticbeanstalk`: Updates service API and documentation -* `service/iam`: Updates service API and documentation - * Adds service-specific credentials to IAM service to make it easier to onboard CodeCommit customers. These are username/password credentials that work with a single service. -* `service/kms`: Updates service API, documentation, and examples - * Update docs and add SDK examples - -Release v1.6.7 (2016-12-22) -=== - -Service Client Updates ---- -* `service/ecr`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/rds`: Updates service API and documentation - * Cross Region Encrypted Snapshot Copying (CopyDBSnapshot) - -Release v1.6.6 (2016-12-20) -=== - -Service Client Updates ---- -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/firehose`: Updates service API, documentation, and examples - * Processing feature enables users to process and modify records before Amazon Firehose delivers them to destinations. -* `service/route53`: Updates service API and documentation - * Enum updates for eu-west-2 and ca-central-1 -* `service/storagegateway`: Updates service API, documentation, and examples - * File gateway is a new mode in the AWS Storage Gateway that support a file interface into S3, alongside the current block-based volume and VTL storage. File gateway combines a service and virtual software appliance, enabling you to store and retrieve objects in Amazon S3 using industry standard file protocols such as NFS. The software appliance, or gateway, is deployed into your on-premises environment as a virtual machine (VM) running on VMware ESXi. The gateway provides access to objects in S3 as files on a Network File System (NFS) mount point. - -Release v1.6.5 (2016-12-19) -=== - -Service Client Updates ---- -* `service/cloudformation`: Updates service documentation - * Minor doc update for CloudFormation. -* `service/cloudtrail`: Updates service paginators -* `service/cognitoidentity`: Updates service API and documentation - * We are adding Groups to Cognito user pools. Developers can perform CRUD operations on groups, add and remove users from groups, list users in groups, etc. We are adding fine-grained role-based access control for Cognito identity pools. Developers can configure an identity pool to get the IAM role from an authenticated user's token, or they can configure rules that will map a user to a different role -* `service/applicationdiscoveryservice`: Updates service API and documentation - * Adds new APIs to group discovered servers into Applications with get summary and neighbors. Includes additional filters for ListConfigurations and DescribeAgents API. -* `service/inspector`: Updates service API, documentation, and examples - * Doc-only Update for Inspector: Adding SDK code snippets for Inspector -* `service/sqs`: Updates service documentation - -SDK Bug Fixes ---- -* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1011) - * Fixes: Not retrying when PriorRequestNotComplete #1009 - -SDK Feature ---- -* `private/model/api`: Adds crosslinking to service documentation (#1010) - -Release v1.6.4 (2016-12-15) -=== - -Service Client Updates ---- -* `service/cognitoidentityprovider`: Updates service API and documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/ssm`: Updates service API and documentation - * This will provide customers with access to the Patch Baseline and Patch Compliance APIs. - -SDK Bug Fixes ---- -* `service/route53`: Fix URL path cleaning for Route53 API requests (#1006) - * Fixes: SerializationError when using Route53 ChangeResourceRecordSets #1005 -* `aws/request`: Add PriorRequestNotComplete to throttle retry codes (#1002) - * Fixes: Not retrying when PriorRequestNotComplete #1001 - -Release v1.6.3 (2016-12-14) -=== - -Service Client Updates ---- -* `service/batch`: Adds new service - * AWS Batch is a batch computing service that lets customers define queues and compute environments and then submit work as batch jobs. -* `service/databasemigrationservice`: Updates service API and documentation - * Adds support for SSL enabled Oracle endpoints and task modification. -* `service/elasticbeanstalk`: Updates service documentation -* `aws/endpoints`: Updated Regions and Endpoints metadata. -* `service/cloudwatchlogs`: Updates service API and documentation - * Add support for associating LogGroups with AWSTagris tags -* `service/marketplacecommerceanalytics`: Updates service API and documentation - * Add new enum to DataSetType: sales_compensation_billed_revenue -* `service/rds`: Updates service documentation - * Doc-only Update for RDS: New versions available in CreateDBInstance -* `service/sts`: Updates service documentation - * Adding Code Snippet Examples for SDKs for STS - -SDK Bug Fixes ---- -* `aws/request`: Fix retrying timeout requests (#981) - * Fixes: Requests Retrying is broken if the error was caused due to a client timeout #947 -* `aws/request`: Fix for Go 1.8 request incorrectly sent with body (#991) - * Fixes: service/route53: ListHostedZones hangs and then fails with go1.8 #984 -* private/protocol/rest: Use RawPath instead of Opaque (#993) - * Fixes: HTTP2 request failing with REST protocol services, e.g AWS X-Ray -* private/model/api: Generate REST-JSON JSONVersion correctly (#998) - * Fixes: REST-JSON protocol service code missing JSONVersion metadata. - -Release v1.6.2 (2016-12-08) -=== - -Service Client Updates ---- -* `service/cloudfront`: Add lambda function associations to cache behaviors -* `service/codepipeline`: This is a doc-only update request to incorporate some recent minor revisions to the doc content. -* `service/rds`: Updates service API and documentation -* `service/wafregional`: With this new feature, customers can use AWS WAF directly on Application Load Balancers in a VPC within available regions to protect their websites and web services from malicious attacks such as SQL injection, Cross Site Scripting, bad bots, etc. - -Release v1.6.1 (2016-12-07) -=== - -Service Client Updates ---- -* `service/config`: Updates service API -* `service/s3`: Updates service API -* `service/sqs`: Updates service API and documentation - -Release v1.6.0 (2016-12-06) -=== - -Service Client Updates ---- -* `service/config`: Updates service API and documentation -* `service/ec2`: Updates service API -* `service/sts`: Updates service API, documentation, and examples - -SDK Bug Fixes ---- -* private/protocol/xml/xmlutil: Fix SDK XML unmarshaler #975 - * Fixes GetBucketACL Grantee required type always nil. #916 - -SDK Feature ---- -* aws/endpoints: Add endpoint metadata to SDK #961 - * Adds Region and Endpoint metadata to the SDK. This allows you to enumerate regions and endpoint metadata based on a defined model embedded in the SDK. - -Release v1.5.13 (2016-12-01) -=== - -Service Client Updates ---- -* `service/apigateway`: Updates service API and documentation -* `service/appstream`: Adds new service -* `service/codebuild`: Adds new service -* `service/directconnect`: Updates service API and documentation -* `service/ec2`: Adds new service -* `service/elasticbeanstalk`: Updates service API and documentation -* `service/health`: Adds new service -* `service/lambda`: Updates service API and documentation -* `service/opsworkscm`: Adds new service -* `service/pinpoint`: Adds new service -* `service/shield`: Adds new service -* `service/ssm`: Updates service API and documentation -* `service/states`: Adds new service -* `service/xray`: Adds new service - -Release v1.5.12 (2016-11-30) -=== - -Service Client Updates ---- -* `service/lightsail`: Adds new service -* `service/polly`: Adds new service -* `service/rekognition`: Adds new service -* `service/snowball`: Updates service API and documentation - -Release v1.5.11 (2016-11-29) -=== - -Service Client Updates ---- -`service/s3`: Updates service API and documentation - -Release v1.5.10 (2016-11-22) -=== - -Service Client Updates ---- -* `service/cloudformation`: Updates service API and documentation -* `service/glacier`: Updates service API, documentation, and examples -* `service/route53`: Updates service API and documentation -* `service/s3`: Updates service API and documentation - -SDK Bug Fixes ---- -* `private/protocol/xml/xmlutil`: Fixes xml marshaler to unmarshal properly -into tagged fields -[#916](https://github.com/aws/aws-sdk-go/issues/916) - -Release v1.5.9 (2016-11-22) -=== - -Service Client Updates ---- -* `service/cloudtrail`: Updates service API and documentation -* `service/ecs`: Updates service API and documentation - -Release v1.5.8 (2016-11-18) -=== - -Service Client Updates ---- -* `service/application-autoscaling`: Updates service API and documentation -* `service/elasticmapreduce`: Updates service API and documentation -* `service/elastictranscoder`: Updates service API, documentation, and examples -* `service/gamelift`: Updates service API and documentation -* `service/lambda`: Updates service API and documentation - -Release v1.5.7 (2016-11-18) -=== - -Service Client Updates ---- -* `service/apigateway`: Updates service API and documentation -* `service/meteringmarketplace`: Updates service API and documentation -* `service/monitoring`: Updates service API and documentation -* `service/sqs`: Updates service API, documentation, and examples - -Release v1.5.6 (2016-11-16) -=== - -Service Client Updates ---- -`service/route53`: Updates service API and documentation -`service/servicecatalog`: Updates service API and documentation - -Release v1.5.5 (2016-11-15) -=== - -Service Client Updates ---- -* `service/ds`: Updates service API and documentation -* `service/elasticache`: Updates service API and documentation -* `service/kinesis`: Updates service API and documentation - -Release v1.5.4 (2016-11-15) -=== - -Service Client Updates ---- -* `service/cognito-idp`: Updates service API and documentation - -Release v1.5.3 (2016-11-11) -=== - -Service Client Updates ---- -* `service/cloudformation`: Updates service documentation and examples -* `service/logs`: Updates service API and documentation - -Release v1.5.2 (2016-11-03) -=== - -Service Client Updates ---- -* `service/directconnect`: Updates service API and documentation - -Release v1.5.1 (2016-11-02) -=== - -Service Client Updates ---- -* `service/email`: Updates service API and documentation - -Release v1.5.0 (2016-11-01) -=== - -Service Client Updates ---- -* `service/cloudformation`: Updates service API and documentation -* `service/ecr`: Updates service paginators - -SDK Feature Updates ---- -* `private/model/api`: Add generated setters for API parameters (#918) - * Adds setters to the SDK's API parameter types, and are a convenience method that reduce the need to use `aws.String` and like utility. - -Release v1.4.22 (2016-10-25) -=== - -Service Client Updates ---- -* `service/elasticloadbalancingv2`: Updates service documentation. -* `service/autoscaling`: Updates service documentation. - -Release v1.4.21 (2016-10-24) -=== - -Service Client Updates ---- -* `service/sms`: AWS Server Migration Service (SMS) is an agentless service which makes it easier and faster for you to migrate thousands of on-premises workloads to AWS. AWS SMS allows you to automate, schedule, and track incremental replications of live server volumes, making it easier for you to coordinate large-scale server migrations. -* `service/ecs`: Updates documentation. - -SDK Feature Updates ---- -* `private/models/api`: Improve code generation of documentation. - -Release v1.4.20 (2016-10-20) -=== - -Service Client Updates ---- -* `service/budgets`: Adds new service, AWS Budgets. -* `service/waf`: Updates service documentation. - -Release v1.4.19 (2016-10-18) -=== - -Service Client Updates ---- -* `service/cloudfront`: Updates service API and documentation. - * Ability to use Amazon CloudFront to deliver your content both via IPv6 and IPv4 using HTTP/HTTPS. -* `service/configservice`: Update service API and documentation. -* `service/iot`: Updates service API and documentation. -* `service/kinesisanalytics`: Updates service API and documentation. - * Whenever Amazon Kinesis Analytics is not able to detect schema for the given streaming source on DiscoverInputSchema API, we would return the raw records that was sampled to detect the schema. -* `service/rds`: Updates service API and documentation. - * Amazon Aurora integrates with other AWS services to allow you to extend your Aurora DB cluster to utilize other capabilities in the AWS cloud. Permission to access other AWS services is granted by creating an IAM role with the necessary permissions, and then associating the role with your DB cluster. - -SDK Feature Updates ---- -* `service/dynamodb/dynamodbattribute`: Add UnmarshalListOfMaps #897 - * Adds support for unmarshaling a list of maps. This is useful for unmarshaling the DynamoDB AttributeValue list of maps returned by APIs like Query and Scan. - -Release v1.4.18 (2016-10-17) -=== - -Service Model Updates ---- -* `service/route53`: Updates service API and documentation. - -Release v1.4.17 -=== - -Service Model Updates ---- -* `service/acm`: Update service API, and documentation. - * This change allows users to import third-party SSL/TLS certificates into ACM. -* `service/elasticbeanstalk`: Update service API, documentation, and pagination. - * Elastic Beanstalk DescribeApplicationVersions API is being updated to support pagination. -* `service/gamelift`: Update service API, and documentation. - * New APIs to protect game developer resource (builds, alias, fleets, instances, game sessions and player sessions) against abuse. - -SDK Features ---- -* `service/s3`: Add support for accelerate with dualstack [#887](https://github.com/aws/aws-sdk-go/issues/887) - -Release v1.4.16 (2016-10-13) -=== - -Service Model Updates ---- -* `service/ecr`: Update Amazon EC2 Container Registry service model - * DescribeImages is a new api used to expose image metadata which today includes image size and image creation timestamp. -* `service/elasticache`: Update Amazon ElastiCache service model - * Elasticache is launching a new major engine release of Redis, 3.2 (providing stability updates and new command sets over 2.8), as well as ElasticSupport for enabling Redis Cluster in 3.2, which provides support for multiple node groups to horizontally scale data, as well as superior engine failover capabilities - -SDK Bug Fixes ---- -* `aws/session`: Skip shared config on read errors [#883](https://github.com/aws/aws-sdk-go/issues/883) -* `aws/signer/v4`: Add support for URL.EscapedPath to signer [#885](https://github.com/aws/aws-sdk-go/issues/885) - -SDK Features ---- -* `private/model/api`: Add docs for errors to API operations [#881](https://github.com/aws/aws-sdk-go/issues/881) -* `private/model/api`: Improve field and waiter doc strings [#879](https://github.com/aws/aws-sdk-go/issues/879) -* `service/dynamodb/dynamodbattribute`: Allow multiple struct tag elements [#886](https://github.com/aws/aws-sdk-go/issues/886) -* Add build tags to internal SDK tools [#880](https://github.com/aws/aws-sdk-go/issues/880) - -Release v1.4.15 (2016-10-06) -=== - -Service Model Updates ---- -* `service/cognitoidentityprovider`: Update Amazon Cognito Identity Provider service model -* `service/devicefarm`: Update AWS Device Farm documentation -* `service/opsworks`: Update AWS OpsWorks service model -* `service/s3`: Update Amazon Simple Storage Service model -* `service/waf`: Update AWS WAF service model - -SDK Bug Fixes ---- -* `aws/request`: Fix HTTP Request Body race condition [#874](https://github.com/aws/aws-sdk-go/issues/874) - -SDK Feature Updates ---- -* `aws/ec2metadata`: Add support for EC2 User Data [#872](https://github.com/aws/aws-sdk-go/issues/872) -* `aws/signer/v4`: Remove logic determining if request needs to be resigned [#876](https://github.com/aws/aws-sdk-go/issues/876) - -Release v1.4.14 (2016-09-29) -=== -* `service/ec2`: api, documentation, and paginators updates. -* `service/s3`: api and documentation updates. - -Release v1.4.13 (2016-09-27) -=== -* `service/codepipeline`: documentation updates. -* `service/cloudformation`: api and documentation updates. -* `service/kms`: documentation updates. -* `service/elasticfilesystem`: documentation updates. -* `service/snowball`: documentation updates. diff --git a/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md b/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md deleted file mode 100644 index 8a1927a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/CHANGELOG_PENDING.md +++ /dev/null @@ -1,5 +0,0 @@ -### SDK Features - -### SDK Enhancements - -### SDK Bugs diff --git a/vendor/github.com/aws/aws-sdk-go/CODE_OF_CONDUCT.md b/vendor/github.com/aws/aws-sdk-go/CODE_OF_CONDUCT.md deleted file mode 100644 index 5b627cf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,4 +0,0 @@ -## Code of Conduct -This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). -For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact -opensource-codeofconduct@amazon.com with any additional questions or comments. diff --git a/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md b/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md deleted file mode 100644 index 0c504b6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md +++ /dev/null @@ -1,127 +0,0 @@ -Contributing to the AWS SDK for Go - -We work hard to provide a high-quality and useful SDK, and we greatly value -feedback and contributions from our community. Whether it's a bug report, -new feature, correction, or additional documentation, we welcome your issues -and pull requests. Please read through this document before submitting any -issues or pull requests to ensure we have all the necessary information to -effectively respond to your bug report or contribution. - - -## Filing Bug Reports - -You can file bug reports against the SDK on the [GitHub issues][issues] page. - -If you are filing a report for a bug or regression in the SDK, it's extremely -helpful to provide as much information as possible when opening the original -issue. This helps us reproduce and investigate the possible bug without having -to wait for this extra information to be provided. Please read the following -guidelines prior to filing a bug report. - -1. Search through existing [issues][] to ensure that your specific issue has - not yet been reported. If it is a common issue, it is likely there is - already a bug report for your problem. - -2. Ensure that you have tested the latest version of the SDK. Although you - may have an issue against an older version of the SDK, we cannot provide - bug fixes for old versions. It's also possible that the bug may have been - fixed in the latest release. - -3. Provide as much information about your environment, SDK version, and - relevant dependencies as possible. For example, let us know what version - of Go you are using, which and version of the operating system, and the - the environment your code is running in. e.g Container. - -4. Provide a minimal test case that reproduces your issue or any error - information you related to your problem. We can provide feedback much - more quickly if we know what operations you are calling in the SDK. If - you cannot provide a full test case, provide as much code as you can - to help us diagnose the problem. Any relevant information should be provided - as well, like whether this is a persistent issue, or if it only occurs - some of the time. - - -## Submitting Pull Requests - -We are always happy to receive code and documentation contributions to the SDK. -Please be aware of the following notes prior to opening a pull request: - -1. The SDK is released under the [Apache license][license]. Any code you submit - will be released under that license. For substantial contributions, we may - ask you to sign a [Contributor License Agreement (CLA)][cla]. - -2. If you would like to implement support for a significant feature that is not - yet available in the SDK, please talk to us beforehand to avoid any - duplication of effort. - -3. Wherever possible, pull requests should contain tests as appropriate. - Bugfixes should contain tests that exercise the corrected behavior (i.e., the - test should fail without the bugfix and pass with it), and new features - should be accompanied by tests exercising the feature. - -4. Pull requests that contain failing tests will not be merged until the test - failures are addressed. Pull requests that cause a significant drop in the - SDK's test coverage percentage are unlikely to be merged until tests have - been added. - -5. The JSON files under the SDK's `models` folder are sourced from outside the SDK. - Such as `models/apis/ec2/2016-11-15/api.json`. We will not accept pull requests - directly on these models. If you discover an issue with the models please - create a [GitHub issue][issues] describing the issue. - -### Testing - -To run the tests locally, running the `make unit` command will `go get` the -SDK's testing dependencies, and run vet, link and unit tests for the SDK. - -``` -make unit -``` - -Standard go testing functionality is supported as well. To test SDK code that -is tagged with `codegen` you'll need to set the build tag in the go test -command. The `make unit` command will do this automatically. - -``` -go test -tags codegen ./private/... -``` - -See the `Makefile` for additional testing tags that can be used in testing. - -To test on multiple platform the SDK includes several DockerFiles under the -`awstesting/sandbox` folder, and associated make recipes to execute -unit testing within environments configured for specific Go versions. - -``` -make sandbox-test-go18 -``` - -To run all sandbox environments use the following make recipe - -``` -# Optionally update the Go tip that will be used during the batch testing -make update-aws-golang-tip - -# Run all SDK tests for supported Go versions in sandboxes -make sandbox-test -``` - -In addition the sandbox environment include make recipes for interactive modes -so you can run command within the Docker container and context of the SDK. - -``` -make sandbox-go18 -``` - -### Changelog - -You can see all release changes in the `CHANGELOG.md` file at the root of the -repository. The release notes added to this file will contain service client -updates, and major SDK changes. - -[issues]: https://github.com/aws/aws-sdk-go/issues -[pr]: https://github.com/aws/aws-sdk-go/pulls -[license]: http://aws.amazon.com/apache2.0/ -[cla]: http://en.wikipedia.org/wiki/Contributor_License_Agreement -[releasenotes]: https://github.com/aws/aws-sdk-go/releases - diff --git a/vendor/github.com/aws/aws-sdk-go/Gopkg.lock b/vendor/github.com/aws/aws-sdk-go/Gopkg.lock deleted file mode 100644 index 81273b9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/Gopkg.lock +++ /dev/null @@ -1,16 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:13fe471d0ed891e8544eddfeeb0471fd3c9f2015609a1c000aefdedf52a19d40" - name = "github.com/jmespath/go-jmespath" - packages = ["."] - pruneopts = "" - revision = "c2b33e84" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = ["github.com/jmespath/go-jmespath"] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/aws/aws-sdk-go/Gopkg.toml b/vendor/github.com/aws/aws-sdk-go/Gopkg.toml deleted file mode 100644 index 60688e2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/Gopkg.toml +++ /dev/null @@ -1,43 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - -ignored = [ - # Testing/Example/Codegen dependencies - "github.com/stretchr/testify", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/require", - "github.com/go-sql-driver/mysql", - "github.com/gucumber/gucumber", - "github.com/pkg/errors", - "golang.org/x/net", - "golang.org/x/net/html", - "golang.org/x/net/http2", - "golang.org/x/text", - "golang.org/x/text/html", - "golang.org/x/tools", - "golang.org/x/tools/go/loader", -] - -[[constraint]] - name = "github.com/jmespath/go-jmespath" - revision = "c2b33e84" - #version = "0.2.2" diff --git a/vendor/github.com/aws/aws-sdk-go/Makefile b/vendor/github.com/aws/aws-sdk-go/Makefile deleted file mode 100644 index 749620e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/Makefile +++ /dev/null @@ -1,247 +0,0 @@ -LINTIGNOREDOC='service/[^/]+/(api|service|waiters)\.go:.+(comment on exported|should have comment or be unexported)' -LINTIGNORECONST='service/[^/]+/(api|service|waiters)\.go:.+(type|struct field|const|func) ([^ ]+) should be ([^ ]+)' -LINTIGNORESTUTTER='service/[^/]+/(api|service)\.go:.+(and that stutters)' -LINTIGNOREINFLECT='service/[^/]+/(api|errors|service)\.go:.+(method|const) .+ should be ' -LINTIGNOREINFLECTS3UPLOAD='service/s3/s3manager/upload\.go:.+struct field SSEKMSKeyId should be ' -LINTIGNOREENDPOINTS='aws/endpoints/(defaults|dep_service_ids).go:.+(method|const) .+ should be ' -LINTIGNOREDEPS='vendor/.+\.go' -LINTIGNOREPKGCOMMENT='service/[^/]+/doc_custom.go:.+package comment should be of the form' -UNIT_TEST_TAGS="example codegen awsinclude" -ALL_TAGS="example codegen awsinclude integration perftest" - -# SDK's Core and client packages that are compatable with Go 1.5+. -SDK_CORE_PKGS=./aws/... ./private/... ./internal/... -SDK_CLIENT_PKGS=./service/... -SDK_COMPA_PKGS=${SDK_CORE_PKGS} ${SDK_CLIENT_PKGS} - -# SDK additional packages that are used for development of the SDK. -SDK_EXAMPLES_PKGS=./example/... -SDK_TESTING_PKGS=./awstesting/... -SDK_MODELS_PKGS=./models/... -SDK_ALL_PKGS=${SDK_COMPA_PKGS} ${SDK_TESTING_PKGS} ${SDK_EXAMPLES_PKGS} ${SDK_MODELS_PKGS} - -TEST_TIMEOUT=-timeout 5m - -all: generate unit - -################### -# Code Generation # -################### -generate: cleanup-models gen-test gen-endpoints gen-services - -gen-test: gen-protocol-test gen-codegen-test - -gen-codegen-test: - @echo "Generating SDK API tests" - go generate ./private/model/api/codegentest/service - -gen-services: - @echo "Generating SDK clients" - go generate ./service - -gen-protocol-test: - @echo "Generating SDK protocol tests" - go generate ./private/protocol/... - -gen-endpoints: - @echo "Generating SDK endpoints" - go generate ./models/endpoints - -cleanup-models: - @echo "Cleaning up stale model versions" - go run -tags codegen ./private/model/cli/cleanup-models/* "./models/apis/*/*/api-2.json" - -################### -# Unit/CI Testing # -################### - -build: - go build -o /dev/null -tags ${ALL_TAGS} ${SDK_ALL_PKGS} - -unit-no-verify: - @echo "go test SDK and vendor packages" - go test ${TEST_TIMEOUT} -v -count=1 -tags ${UNIT_TEST_TAGS} ${SDK_ALL_PKGS} - -unit: verify build unit-no-verify - -unit-with-race-cover: verify build - @echo "go test SDK and vendor packages" - go test ${TEST_TIMEOUT} -v -count=1 -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 ${SDK_ALL_PKGS} - -unit-old-go-race-cover: - @echo "go test SDK only packages for old Go versions" - go test ${TEST_TIMEOUT} -v -count=1 -race -cpu=1,2,4 ${SDK_COMPA_PKGS} - -ci-test: generate unit-with-race-cover ci-test-generate-validate - -ci-test-generate-validate: - @echo "CI test validate no generated code changes" - git update-index --assume-unchanged go.mod go.sum - git add . -A - gitstatus=`git diff --cached --ignore-space-change`; \ - echo "$$gitstatus"; \ - if [ "$$gitstatus" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then echo "$$gitstatus"; exit 1; fi - git update-index --no-assume-unchanged go.mod go.sum - -####################### -# Integration Testing # -####################### -integration: core-integ client-integ - -core-integ: - @echo "Integration Testing SDK core" - AWS_REGION="" go test -count=1 -tags "integration" -v -run '^TestInteg_' ${SDK_CORE_PKGS} ./awstesting/... - -client-integ: - @echo "Integration Testing SDK clients" - AWS_REGION="" go test -count=1 -tags "integration" -v -run '^TestInteg_' ./service/... - -s3crypto-integ: - @echo "Integration Testing S3 Cyrpto utility" - AWS_REGION="" go test -count=1 -tags "s3crypto_integ integration" -v -run '^TestInteg_' ./service/s3/s3crypto - -cleanup-integ-buckets: - @echo "Cleaning up SDK integraiton resources" - go run -tags "integration" ./awstesting/cmd/bucket_cleanup/main.go "aws-sdk-go-integration" - -################### -# Sandbox Testing # -################### -sandbox-tests: sandbox-test-go1.5 sandbox-test-go1.6 sandbox-test-go1.7 sandbox-test-go1.8 sandbox-test-go1.9 sandbox-test-go1.10 sandbox-test-go1.11 sandbox-test-go1.12 sandbox-test-gotip - -sandbox-build-go1.5: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5 -t "aws-sdk-go-1.5" . -sandbox-go1.5: sandbox-build-go1.5 - docker run -i -t aws-sdk-go-1.5 bash -sandbox-test-go1.5: sandbox-build-go1.5 - docker run -t aws-sdk-go-1.5 - -sandbox-build-go1.5-novendorexp: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5-novendorexp -t "aws-sdk-go-1.5-novendorexp" . -sandbox-go1.5-novendorexp: sandbox-build-go1.5-novendorexp - docker run -i -t aws-sdk-go-1.5-novendorexp bash -sandbox-test-go1.5-novendorexp: sandbox-build-go1.5-novendorexp - docker run -t aws-sdk-go-1.5-novendorexp - -sandbox-build-go1.6: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.6 -t "aws-sdk-go-1.6" . -sandbox-go1.6: sandbox-build-go1.6 - docker run -i -t aws-sdk-go-1.6 bash -sandbox-test-go1.6: sandbox-build-go1.6 - docker run -t aws-sdk-go-1.6 - -sandbox-build-go1.7: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.7 -t "aws-sdk-go-1.7" . -sandbox-go1.7: sandbox-build-go1.7 - docker run -i -t aws-sdk-go-1.7 bash -sandbox-test-go1.7: sandbox-build-go1.7 - docker run -t aws-sdk-go-1.7 - -sandbox-build-go1.8: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.8" . -sandbox-go1.8: sandbox-build-go1.8 - docker run -i -t aws-sdk-go-1.8 bash -sandbox-test-go1.8: sandbox-build-go1.8 - docker run -t aws-sdk-go-1.8 - -sandbox-build-go1.9: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.9 -t "aws-sdk-go-1.9" . -sandbox-go1.9: sandbox-build-go1.9 - docker run -i -t aws-sdk-go-1.9 bash -sandbox-test-go1.9: sandbox-build-go1.9 - docker run -t aws-sdk-go-1.9 - -sandbox-build-go1.10: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.10 -t "aws-sdk-go-1.10" . -sandbox-go1.10: sandbox-build-go1.10 - docker run -i -t aws-sdk-go-1.10 bash -sandbox-test-go1.10: sandbox-build-go1.10 - docker run -t aws-sdk-go-1.10 - -sandbox-build-go1.11: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.11 -t "aws-sdk-go-1.11" . -sandbox-go1.11: sandbox-build-go1.11 - docker run -i -t aws-sdk-go-1.11 bash -sandbox-test-go1.11: sandbox-build-go1.11 - docker run -t aws-sdk-go-1.11 - -sandbox-build-go1.12: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.12 -t "aws-sdk-go-1.12" . -sandbox-go1.12: sandbox-build-go1.12 - docker run -i -t aws-sdk-go-1.12 bash -sandbox-test-go1.12: sandbox-build-go1.12 - docker run -t aws-sdk-go-1.12 - -sandbox-build-go1.13: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.13 -t "aws-sdk-go-1.13" . -sandbox-go1.13: sandbox-build-go1.13 - docker run -i -t aws-sdk-go-1.13 bash -sandbox-test-go1.13: sandbox-build-go1.13 - docker run -t aws-sdk-go-1.13 - -sandbox-build-gotip: - @echo "Run make update-aws-golang-tip, if this test fails because missing aws-golang:tip container" - docker build -f ./awstesting/sandbox/Dockerfile.test.gotip -t "aws-sdk-go-tip" . -sandbox-gotip: sandbox-build-gotip - docker run -i -t aws-sdk-go-tip bash -sandbox-test-gotip: sandbox-build-gotip - docker run -t aws-sdk-go-tip - -update-aws-golang-tip: - docker build --no-cache=true -f ./awstesting/sandbox/Dockerfile.golang-tip -t "aws-golang:tip" . - -################## -# Linting/Verify # -################## -verify: lint vet - -lint: - @echo "go lint SDK and vendor packages" - @lint=`golint ./...`; \ - dolint=`echo "$$lint" | grep -E -v -e ${LINTIGNOREDOC} -e ${LINTIGNORECONST} -e ${LINTIGNORESTUTTER} -e ${LINTIGNOREINFLECT} -e ${LINTIGNOREDEPS} -e ${LINTIGNOREINFLECTS3UPLOAD} -e ${LINTIGNOREPKGCOMMENT} -e ${LINTIGNOREENDPOINTS}`; \ - echo "$$dolint"; \ - if [ "$$dolint" != "" ]; then exit 1; fi - -vet: - go vet -tags "example codegen awsinclude integration" --all ${SDK_ALL_PKGS} - -################ -# Dependencies # -################ -get-deps: get-deps-tests get-deps-x-tests get-deps-codegen get-deps-verify - -get-deps-tests: - @echo "go get SDK testing dependencies" - -get-deps-x-tests: - @echo "go get SDK testing golang.org/x dependencies" - go get golang.org/x/net/http2 - -get-deps-codegen: get-deps-x-tests - @echo "go get SDK codegen dependencies" - go get golang.org/x/net/html - -get-deps-verify: - @echo "go get SDK verification utilities" - go get golang.org/x/lint/golint - -############## -# Benchmarks # -############## -bench: - @echo "go bench SDK packages" - go test -count=1 -run NONE -bench . -benchmem -tags 'bench' ${SDK_ALL_PKGS} - -bench-protocol: - @echo "go bench SDK protocol marshallers" - go test -count=1 -run NONE -bench . -benchmem -tags 'bench' ./private/protocol/... - -############# -# Utilities # -############# -docs: - @echo "generate SDK docs" - $(AWS_DOC_GEN_TOOL) `pwd` - -api_info: - @go run private/model/cli/api-info/api-info.go diff --git a/vendor/github.com/aws/aws-sdk-go/README.md b/vendor/github.com/aws/aws-sdk-go/README.md deleted file mode 100644 index 27e1aee..0000000 --- a/vendor/github.com/aws/aws-sdk-go/README.md +++ /dev/null @@ -1,502 +0,0 @@ -[![API Reference](https://img.shields.io/badge/api-reference-blue.svg)](https://docs.aws.amazon.com/sdk-for-go/api) [![Join the chat at https://gitter.im/aws/aws-sdk-go](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aws/aws-sdk-go?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://img.shields.io/travis/aws/aws-sdk-go.svg)](https://travis-ci.org/aws/aws-sdk-go) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt) - -# AWS SDK for Go - -aws-sdk-go is the official AWS SDK for the Go programming language. - -Checkout our [release notes](https://github.com/aws/aws-sdk-go/releases) for -information about the latest bug fixes, updates, and features added to the SDK. - -We [announced](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-2-0-developer-preview/) the Developer Preview for the [v2 AWS SDK for Go](https://github.com/aws/aws-sdk-go-v2). The v2 SDK source is available at https://github.com/aws/aws-sdk-go-v2, and add it to your project with `go get github.com/aws/aws-sdk-go-v2`. Check out the v2 SDK's [changes and updates](https://github.com/aws/aws-sdk-go-v2/blob/master/CHANGELOG.md), and let us know what you think. We want your feedback. - -We have a pilot redesign of the [AWS SDK for Go API reference documentation](https://docs.aws.amazon.com/sdk-for-go/v1/api/gosdk-apiref.html). Let us know what you think. - -## Installing - -Use `go get` to retrieve the SDK to add it to your `GOPATH` workspace, or -project's Go module dependencies. - - go get github.com/aws/aws-sdk-go - -To update the SDK use `go get -u` to retrieve the latest version of the SDK. - - go get -u github.com/aws/aws-sdk-go - -### Dependencies - -The SDK includes a `vendor` folder containing the runtime dependencies of the -SDK. The metadata of the SDK's dependencies can be found in the Go module file -`go.mod` or Dep file `Gopkg.toml`. - -### Go Modules - -If you are using Go modules, your `go get` will default to the latest tagged -release version of the SDK. To get a specific release version of the SDK use -`@` in your `go get` command. - - go get github.com/aws/aws-sdk-go@v1.15.77 - -To get the latest SDK repository change use `@latest`. - - go get github.com/aws/aws-sdk-go@latest - -### Go 1.5 - -If you are using Go 1.5 without vendoring enabled, (`GO15VENDOREXPERIMENT=1`), -you will need to use `...` when retrieving the SDK to get its dependencies. - - go get github.com/aws/aws-sdk-go/... - -This will still include the `vendor` folder. The `vendor` folder can be deleted -if not used by your environment. - - rm -rf $GOPATH/src/github.com/aws/aws-sdk-go/vendor - -## Getting Help - -Please use these community resources for getting help. We use the GitHub issues -for tracking bugs and feature requests. - -* Ask a question on [StackOverflow](http://stackoverflow.com/) and tag it with the [`aws-sdk-go`](http://stackoverflow.com/questions/tagged/aws-sdk-go) tag. -* Come join the AWS SDK for Go community chat on [gitter](https://gitter.im/aws/aws-sdk-go). -* Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html). -* If you think you may have found a bug, please open an [issue](https://github.com/aws/aws-sdk-go/issues/new). - -## Opening Issues - -If you encounter a bug with the AWS SDK for Go we would like to hear about it. -Search the [existing issues](https://github.com/aws/aws-sdk-go/issues) and see -if others are also experiencing the issue before opening a new issue. Please -include the version of AWS SDK for Go, Go language, and OS you’re using. Please -also include reproduction case when appropriate. - -The GitHub issues are intended for bug reports and feature requests. For help -and questions with using AWS SDK for GO please make use of the resources listed -in the [Getting Help](https://github.com/aws/aws-sdk-go#getting-help) section. -Keeping the list of open issues lean will help us respond in a timely manner. - -## Reference Documentation - -[`Getting Started Guide`](https://aws.amazon.com/sdk-for-go/) - This document -is a general introduction on how to configure and make requests with the SDK. -If this is your first time using the SDK, this documentation and the API -documentation will help you get started. This document focuses on the syntax -and behavior of the SDK. The [Service Developer -Guide](https://aws.amazon.com/documentation/) will help you get started using -specific AWS services. - -[`SDK API Reference -Documentation`](https://docs.aws.amazon.com/sdk-for-go/api/) - Use this -document to look up all API operation input and output parameters for AWS -services supported by the SDK. The API reference also includes documentation of -the SDK, and examples how to using the SDK, service client API operations, and -API operation require parameters. - -[`Service Developer Guide`](https://aws.amazon.com/documentation/) - Use this -documentation to learn how to interface with AWS services. These guides are -great for getting started with a service, or when looking for more -information about a service. While this document is not required for coding, -services may supply helpful samples to look out for. - -[`SDK Examples`](https://github.com/aws/aws-sdk-go/tree/master/example) - -Included in the SDK's repo are several hand crafted examples using the SDK -features and AWS services. - -## Overview of SDK's Packages - -The SDK is composed of two main components, SDK core, and service clients. -The SDK core packages are all available under the aws package at the root of -the SDK. Each client for a supported AWS service is available within its own -package under the service folder at the root of the SDK. - - * aws - SDK core, provides common shared types such as Config, Logger, - and utilities to make working with API parameters easier. - - * awserr - Provides the error interface that the SDK will use for all - errors that occur in the SDK's processing. This includes service API - response errors as well. The Error type is made up of a code and message. - Cast the SDK's returned error type to awserr.Error and call the Code - method to compare returned error to specific error codes. See the package's - documentation for additional values that can be extracted such as RequestID. - - * credentials - Provides the types and built in credentials providers - the SDK will use to retrieve AWS credentials to make API requests with. - Nested under this folder are also additional credentials providers such as - stscreds for assuming IAM roles, and ec2rolecreds for EC2 Instance roles. - - * endpoints - Provides the AWS Regions and Endpoints metadata for the SDK. - Use this to lookup AWS service endpoint information such as which services - are in a region, and what regions a service is in. Constants are also provided - for all region identifiers, e.g UsWest2RegionID for "us-west-2". - - * session - Provides initial default configuration, and load - configuration from external sources such as environment and shared - credentials file. - - * request - Provides the API request sending, and retry logic for the SDK. - This package also includes utilities for defining your own request - retryer, and configuring how the SDK processes the request. - - * service - Clients for AWS services. All services supported by the SDK are - available under this folder. - -## How to Use the SDK's AWS Service Clients - -The SDK includes the Go types and utilities you can use to make requests to -AWS service APIs. Within the service folder at the root of the SDK you'll find -a package for each AWS service the SDK supports. All service clients follow common pattern of creation and usage. - -When creating a client for an AWS service you'll first need to have a Session -value constructed. The Session provides shared configuration that can be shared -between your service clients. When service clients are created you can pass -in additional configuration via the aws.Config type to override configuration -provided by in the Session to create service client instances with custom -configuration. - -Once the service's client is created you can use it to make API requests the -AWS service. These clients are safe to use concurrently. - -## Configuring the SDK - -In the AWS SDK for Go, you can configure settings for service clients, such -as the log level and maximum number of retries. Most settings are optional; -however, for each service client, you must specify a region and your credentials. -The SDK uses these values to send requests to the correct AWS region and sign -requests with the correct credentials. You can specify these values as part -of a session or as environment variables. - -See the SDK's [configuration guide][config_guide] for more information. - -See the [session][session_pkg] package documentation for more information on how to use Session -with the SDK. - -See the [Config][config_typ] type in the [aws][aws_pkg] package for more information on configuration -options. - -[config_guide]: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html -[session_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ -[config_typ]: https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -[aws_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/ - -### Configuring Credentials - -When using the SDK you'll generally need your AWS credentials to authenticate -with AWS services. The SDK supports multiple methods of supporting these -credentials. By default the SDK will source credentials automatically from -its default credential chain. See the session package for more information -on this chain, and how to configure it. The common items in the credential -chain are the following: - - * Environment Credentials - Set of environment variables that are useful - when sub processes are created for specific roles. - - * Shared Credentials file (~/.aws/credentials) - This file stores your - credentials based on a profile name and is useful for local development. - - * EC2 Instance Role Credentials - Use EC2 Instance Role to assign credentials - to application running on an EC2 instance. This removes the need to manage - credential files in production. - -Credentials can be configured in code as well by setting the Config's Credentials -value to a custom provider or using one of the providers included with the -SDK to bypass the default credential chain and use a custom one. This is -helpful when you want to instruct the SDK to only use a specific set of -credentials or providers. - -This example creates a credential provider for assuming an IAM role, "myRoleARN" -and configures the S3 service client to use that role for API requests. - -```go - // Initial credentials loaded from SDK's default credential chain. Such as - // the environment, shared credentials (~/.aws/credentials), or EC2 Instance - // Role. These credentials will be used to to make the STS Assume Role API. - sess := session.Must(session.NewSession()) - - // Create the credentials from AssumeRoleProvider to assume the role - // referenced by the "myRoleARN" ARN. - creds := stscreds.NewCredentials(sess, "myRoleArn") - - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess, &aws.Config{Credentials: creds}) -``` - -See the [credentials][credentials_pkg] package documentation for more information on credential -providers included with the SDK, and how to customize the SDK's usage of -credentials. - -The SDK has support for the shared configuration file (~/.aws/config). This -support can be enabled by setting the environment variable, "AWS_SDK_LOAD_CONFIG=1", -or enabling the feature in code when creating a Session via the -Option's SharedConfigState parameter. - -```go - sess := session.Must(session.NewSessionWithOptions(session.Options{ - SharedConfigState: session.SharedConfigEnable, - })) -``` - -[credentials_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials - -### Configuring AWS Region - -In addition to the credentials you'll need to specify the region the SDK -will use to make AWS API requests to. In the SDK you can specify the region -either with an environment variable, or directly in code when a Session or -service client is created. The last value specified in code wins if the region -is specified multiple ways. - -To set the region via the environment variable set the "AWS_REGION" to the -region you want to the SDK to use. Using this method to set the region will -allow you to run your application in multiple regions without needing additional -code in the application to select the region. - - AWS_REGION=us-west-2 - -The endpoints package includes constants for all regions the SDK knows. The -values are all suffixed with RegionID. These values are helpful, because they -reduce the need to type the region string manually. - -To set the region on a Session use the aws package's Config struct parameter -Region to the AWS region you want the service clients created from the session to -use. This is helpful when you want to create multiple service clients, and -all of the clients make API requests to the same region. - -```go - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String(endpoints.UsWest2RegionID), - })) -``` - -See the [endpoints][endpoints_pkg] package for the AWS Regions and Endpoints metadata. - -In addition to setting the region when creating a Session you can also set -the region on a per service client bases. This overrides the region of a -Session. This is helpful when you want to create service clients in specific -regions different from the Session's region. - -```go - svc := s3.New(sess, &aws.Config{ - Region: aws.String(endpoints.UsWest2RegionID), - }) -``` - -See the [Config][config_typ] type in the [aws][aws_pkg] package for more information and additional -options such as setting the Endpoint, and other service client configuration options. - -[endpoints_pkg]: https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/ - -## Making API Requests - -Once the client is created you can make an API request to the service. -Each API method takes a input parameter, and returns the service response -and an error. The SDK provides methods for making the API call in multiple ways. - -In this list we'll use the S3 ListObjects API as an example for the different -ways of making API requests. - - * ListObjects - Base API operation that will make the API request to the service. - - * ListObjectsRequest - API methods suffixed with Request will construct the - API request, but not send it. This is also helpful when you want to get a - presigned URL for a request, and share the presigned URL instead of your - application making the request directly. - - * ListObjectsPages - Same as the base API operation, but uses a callback to - automatically handle pagination of the API's response. - - * ListObjectsWithContext - Same as base API operation, but adds support for - the Context pattern. This is helpful for controlling the canceling of in - flight requests. See the Go standard library context package for more - information. This method also takes request package's Option functional - options as the variadic argument for modifying how the request will be - made, or extracting information from the raw HTTP response. - - * ListObjectsPagesWithContext - same as ListObjectsPages, but adds support for - the Context pattern. Similar to ListObjectsWithContext this method also - takes the request package's Option function option types as the variadic - argument. - -In addition to the API operations the SDK also includes several higher level -methods that abstract checking for and waiting for an AWS resource to be in -a desired state. In this list we'll use WaitUntilBucketExists to demonstrate -the different forms of waiters. - - * WaitUntilBucketExists. - Method to make API request to query an AWS service for - a resource's state. Will return successfully when that state is accomplished. - - * WaitUntilBucketExistsWithContext - Same as WaitUntilBucketExists, but adds - support for the Context pattern. In addition these methods take request - package's WaiterOptions to configure the waiter, and how underlying request - will be made by the SDK. - -The API method will document which error codes the service might return for -the operation. These errors will also be available as const strings prefixed -with "ErrCode" in the service client's package. If there are no errors listed -in the API's SDK documentation you'll need to consult the AWS service's API -documentation for the errors that could be returned. - -```go - ctx := context.Background() - - result, err := svc.GetObjectWithContext(ctx, &s3.GetObjectInput{ - Bucket: aws.String("my-bucket"), - Key: aws.String("my-key"), - }) - if err != nil { - // Cast err to awserr.Error to handle specific error codes. - aerr, ok := err.(awserr.Error) - if ok && aerr.Code() == s3.ErrCodeNoSuchKey { - // Specific error code handling - } - return err - } - - // Make sure to close the body when done with it for S3 GetObject APIs or - // will leak connections. - defer result.Body.Close() - - fmt.Println("Object Size:", aws.Int64Value(result.ContentLength)) -``` - -### API Request Pagination and Resource Waiters - -Pagination helper methods are suffixed with "Pages", and provide the -functionality needed to round trip API page requests. Pagination methods -take a callback function that will be called for each page of the API's response. - -```go - objects := []string{} - err := svc.ListObjectsPagesWithContext(ctx, &s3.ListObjectsInput{ - Bucket: aws.String(myBucket), - }, func(p *s3.ListObjectsOutput, lastPage bool) bool { - for _, o := range p.Contents { - objects = append(objects, aws.StringValue(o.Key)) - } - return true // continue paging - }) - if err != nil { - panic(fmt.Sprintf("failed to list objects for bucket, %s, %v", myBucket, err)) - } - - fmt.Println("Objects in bucket:", objects) -``` - -Waiter helper methods provide the functionality to wait for an AWS resource -state. These methods abstract the logic needed to check the state of an -AWS resource, and wait until that resource is in a desired state. The waiter -will block until the resource is in the state that is desired, an error occurs, -or the waiter times out. If a resource times out the error code returned will -be request.WaiterResourceNotReadyErrorCode. - -```go - err := svc.WaitUntilBucketExistsWithContext(ctx, &s3.HeadBucketInput{ - Bucket: aws.String(myBucket), - }) - if err != nil { - aerr, ok := err.(awserr.Error) - if ok && aerr.Code() == request.WaiterResourceNotReadyErrorCode { - fmt.Fprintf(os.Stderr, "timed out while waiting for bucket to exist") - } - panic(fmt.Errorf("failed to wait for bucket to exist, %v", err)) - } - fmt.Println("Bucket", myBucket, "exists") -``` - -## Complete SDK Example - -This example shows a complete working Go file which will upload a file to S3 -and use the Context pattern to implement timeout logic that will cancel the -request if it takes too long. This example highlights how to use sessions, -create a service client, make a request, handle the error, and process the -response. - -```go - package main - - import ( - "context" - "flag" - "fmt" - "os" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" - ) - - // Uploads a file to S3 given a bucket and object key. Also takes a duration - // value to terminate the update if it doesn't complete within that time. - // - // The AWS Region needs to be provided in the AWS shared config or on the - // environment variable as `AWS_REGION`. Credentials also must be provided - // Will default to shared config file, but can load from environment if provided. - // - // Usage: - // # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail - // go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt - func main() { - var bucket, key string - var timeout time.Duration - - flag.StringVar(&bucket, "b", "", "Bucket name.") - flag.StringVar(&key, "k", "", "Object key name.") - flag.DurationVar(&timeout, "d", 0, "Upload timeout.") - flag.Parse() - - // All clients require a Session. The Session provides the client with - // shared configuration such as region, endpoint, and credentials. A - // Session should be shared where possible to take advantage of - // configuration and credential caching. See the session package for - // more information. - sess := session.Must(session.NewSession()) - - // Create a new instance of the service's client with a Session. - // Optional aws.Config values can also be provided as variadic arguments - // to the New function. This option allows you to provide service - // specific configuration. - svc := s3.New(sess) - - // Create a context with a timeout that will abort the upload if it takes - // more than the passed in timeout. - ctx := context.Background() - var cancelFn func() - if timeout > 0 { - ctx, cancelFn = context.WithTimeout(ctx, timeout) - } - // Ensure the context is canceled to prevent leaking. - // See context package for more information, https://golang.org/pkg/context/ - if cancelFn != nil { - defer cancelFn() - } - - // Uploads the object to S3. The Context will interrupt the request if the - // timeout expires. - _, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - Body: os.Stdin, - }) - if err != nil { - if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode { - // If the SDK can determine the request or retry delay was canceled - // by a context the CanceledErrorCode error code will be returned. - fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err) - } else { - fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err) - } - os.Exit(1) - } - - fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) - } -``` - -## License - -This SDK is distributed under the -[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), -see LICENSE.txt and NOTICE.txt for more information. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go b/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go index 854f939..1c49674 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go @@ -75,10 +75,11 @@ func Parse(arn string) (ARN, error) { }, nil } -// IsARN returns whether the given string is an arn -// by looking for whether the string starts with arn: +// IsARN returns whether the given string is an ARN by looking for +// whether the string starts with "arn:" and contains the correct number +// of sections delimited by colons(:). func IsARN(arn string) bool { - return strings.HasPrefix(arn, arnPrefix) && strings.Count(arn, ":") > arnSections-1 + return strings.HasPrefix(arn, arnPrefix) && strings.Count(arn, ":") >= arnSections-1 } // String returns the canonical representation of the ARN diff --git a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn_test.go b/vendor/github.com/aws/aws-sdk-go/aws/arn/arn_test.go deleted file mode 100644 index 3dda784..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn_test.go +++ /dev/null @@ -1,90 +0,0 @@ -// +build go1.7 - -package arn - -import ( - "errors" - "testing" -) - -func TestParseARN(t *testing.T) { - cases := []struct { - input string - arn ARN - err error - }{ - { - input: "invalid", - err: errors.New(invalidPrefix), - }, - { - input: "arn:nope", - err: errors.New(invalidSections), - }, - { - input: "arn:aws:ecr:us-west-2:123456789012:repository/foo/bar", - arn: ARN{ - Partition: "aws", - Service: "ecr", - Region: "us-west-2", - AccountID: "123456789012", - Resource: "repository/foo/bar", - }, - }, - { - input: "arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment", - arn: ARN{ - Partition: "aws", - Service: "elasticbeanstalk", - Region: "us-east-1", - AccountID: "123456789012", - Resource: "environment/My App/MyEnvironment", - }, - }, - { - input: "arn:aws:iam::123456789012:user/David", - arn: ARN{ - Partition: "aws", - Service: "iam", - Region: "", - AccountID: "123456789012", - Resource: "user/David", - }, - }, - { - input: "arn:aws:rds:eu-west-1:123456789012:db:mysql-db", - arn: ARN{ - Partition: "aws", - Service: "rds", - Region: "eu-west-1", - AccountID: "123456789012", - Resource: "db:mysql-db", - }, - }, - { - input: "arn:aws:s3:::my_corporate_bucket/exampleobject.png", - arn: ARN{ - Partition: "aws", - Service: "s3", - Region: "", - AccountID: "", - Resource: "my_corporate_bucket/exampleobject.png", - }, - }, - } - for _, tc := range cases { - t.Run(tc.input, func(t *testing.T) { - spec, err := Parse(tc.input) - if tc.arn != spec { - t.Errorf("Expected %q to parse as %v, but got %v", tc.input, tc.arn, spec) - } - if err == nil && tc.err != nil { - t.Errorf("Expected err to be %v, but got nil", tc.err) - } else if err != nil && tc.err == nil { - t.Errorf("Expected err to be nil, but got %v", err) - } else if err != nil && tc.err != nil && err.Error() != tc.err.Error() { - t.Errorf("Expected err to be %v, but got %v", tc.err, err) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go deleted file mode 100644 index 007b37b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go +++ /dev/null @@ -1,353 +0,0 @@ -package awsutil_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -func ExampleCopy() { - type Foo struct { - A int - B []*string - } - - // Create the initial value - str1 := "hello" - str2 := "bye bye" - f1 := &Foo{A: 1, B: []*string{&str1, &str2}} - - // Do the copy - var f2 Foo - awsutil.Copy(&f2, f1) - - // Print the result - fmt.Println(awsutil.Prettify(f2)) - - // Output: - // { - // A: 1, - // B: ["hello","bye bye"] - // } -} - -func TestCopy1(t *testing.T) { - type Bar struct { - a *int - B *int - c int - D int - } - type Foo struct { - A int - B []*string - C map[string]*int - D *time.Time - E *Bar - } - - // Create the initial value - str1 := "hello" - str2 := "bye bye" - int1 := 1 - int2 := 2 - intPtr1 := 1 - intPtr2 := 2 - now := time.Now() - f1 := &Foo{ - A: 1, - B: []*string{&str1, &str2}, - C: map[string]*int{ - "A": &int1, - "B": &int2, - }, - D: &now, - E: &Bar{ - &intPtr1, - &intPtr2, - 2, - 3, - }, - } - - // Do the copy - var f2 Foo - awsutil.Copy(&f2, f1) - - // Values are equal - if v1, v2 := f2.A, f1.A; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.B, f1.B; !reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.C, f1.C; !reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.D, f1.D; !v1.Equal(*v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.E.B, f1.E.B; !reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.E.D, f1.E.D; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - - // But pointers are not! - str3 := "nothello" - int3 := 57 - f2.A = 100 - *f2.B[0] = str3 - *f2.C["B"] = int3 - *f2.D = time.Now() - f2.E.a = &int3 - *f2.E.B = int3 - f2.E.c = 5 - f2.E.D = 5 - if v1, v2 := f2.A, f1.A; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.B, f1.B; reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.C, f1.C; reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.D, f1.D; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.E.a, f1.E.a; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.E.B, f1.E.B; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.E.c, f1.E.c; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.E.D, f1.E.D; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } -} - -func TestCopyNestedWithUnexported(t *testing.T) { - type Bar struct { - a int - B int - } - type Foo struct { - A string - B Bar - } - - f1 := &Foo{A: "string", B: Bar{a: 1, B: 2}} - - var f2 Foo - awsutil.Copy(&f2, f1) - - // Values match - if v1, v2 := f2.A, f1.A; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.B, f1.B; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.B.a, f1.B.a; v1 == v2 { - t.Errorf("expected values to be not equivalent, but received %v", v1) - } - if v1, v2 := f2.B.B, f2.B.B; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } -} - -func TestCopyIgnoreNilMembers(t *testing.T) { - type Foo struct { - A *string - B []string - C map[string]string - } - - f := &Foo{} - if v1 := f.A; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f.B; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f.C; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - - var f2 Foo - awsutil.Copy(&f2, f) - if v1 := f2.A; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f2.B; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f2.C; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - - fcopy := awsutil.CopyOf(f) - f3 := fcopy.(*Foo) - if v1 := f3.A; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f3.B; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1 := f3.C; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } -} - -func TestCopyPrimitive(t *testing.T) { - str := "hello" - var s string - awsutil.Copy(&s, &str) - if v1, v2 := "hello", s; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } -} - -func TestCopyNil(t *testing.T) { - var s string - awsutil.Copy(&s, nil) - if v1, v2 := "", s; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } -} - -func TestCopyReader(t *testing.T) { - var buf io.Reader = bytes.NewReader([]byte("hello world")) - var r io.Reader - awsutil.Copy(&r, buf) - b, err := ioutil.ReadAll(r) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if v1, v2 := []byte("hello world"), b; !bytes.Equal(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - - // empty bytes because this is not a deep copy - b, err = ioutil.ReadAll(buf) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if v1, v2 := []byte(""), b; !bytes.Equal(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } -} - -func TestCopyDifferentStructs(t *testing.T) { - type SrcFoo struct { - A int - B []*string - C map[string]*int - SrcUnique string - SameNameDiffType int - unexportedPtr *int - ExportedPtr *int - } - type DstFoo struct { - A int - B []*string - C map[string]*int - DstUnique int - SameNameDiffType string - unexportedPtr *int - ExportedPtr *int - } - - // Create the initial value - str1 := "hello" - str2 := "bye bye" - int1 := 1 - int2 := 2 - f1 := &SrcFoo{ - A: 1, - B: []*string{&str1, &str2}, - C: map[string]*int{ - "A": &int1, - "B": &int2, - }, - SrcUnique: "unique", - SameNameDiffType: 1, - unexportedPtr: &int1, - ExportedPtr: &int2, - } - - // Do the copy - var f2 DstFoo - awsutil.Copy(&f2, f1) - - // Values are equal - if v1, v2 := f2.A, f1.A; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.B, f1.B; !reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := f2.C, f1.C; !reflect.DeepEqual(v1, v2) { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := "unique", f1.SrcUnique; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := 1, f1.SameNameDiffType; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := 0, f2.DstUnique; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := "", f2.SameNameDiffType; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := int1, *f1.unexportedPtr; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1 := f2.unexportedPtr; v1 != nil { - t.Errorf("expected nil, but received %v", v1) - } - if v1, v2 := int2, *f1.ExportedPtr; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } - if v1, v2 := int2, *f2.ExportedPtr; v1 != v2 { - t.Errorf("expected values to be equivalent but received %v and %v", v1, v2) - } -} - -func ExampleCopyOf() { - type Foo struct { - A int - B []*string - } - - // Create the initial value - str1 := "hello" - str2 := "bye bye" - f1 := &Foo{A: 1, B: []*string{&str1, &str2}} - - // Do the copy - v := awsutil.CopyOf(f1) - var f2 *Foo = v.(*Foo) - - // Print the result - fmt.Println(awsutil.Prettify(f2)) - - // Output: - // { - // A: 1, - // B: ["hello","bye bye"] - // } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go deleted file mode 100644 index 18d3c5b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package awsutil_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -func TestDeepEqual(t *testing.T) { - cases := []struct { - a, b interface{} - equal bool - }{ - {"a", "a", true}, - {"a", "b", false}, - {"a", aws.String(""), false}, - {"a", nil, false}, - {"a", aws.String("a"), true}, - {(*bool)(nil), (*bool)(nil), true}, - {(*bool)(nil), (*string)(nil), false}, - {nil, nil, true}, - } - - for i, c := range cases { - if awsutil.DeepEqual(c.a, c.b) != c.equal { - t.Errorf("%d, a:%v b:%v, %t", i, c.a, c.b, c.equal) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go deleted file mode 100644 index 58a05d6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go +++ /dev/null @@ -1,182 +0,0 @@ -package awsutil_test - -import ( - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -type Struct struct { - A []Struct - z []Struct - B *Struct - D *Struct - C string - E map[string]string -} - -var data = Struct{ - A: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}}, - z: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}}, - B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}}, - C: "initial", -} -var data2 = Struct{A: []Struct{ - {A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}}, - {A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}}, -}} - -func TestValueAtPathSuccess(t *testing.T) { - var testCases = []struct { - expect []interface{} - data interface{} - path string - }{ - {[]interface{}{"initial"}, data, "C"}, - {[]interface{}{"value1"}, data, "A[0].C"}, - {[]interface{}{"value2"}, data, "A[1].C"}, - {[]interface{}{"value3"}, data, "A[2].C"}, - {[]interface{}{"value3"}, data, "a[2].c"}, - {[]interface{}{"value3"}, data, "A[-1].C"}, - {[]interface{}{"value1", "value2", "value3"}, data, "A[].C"}, - {[]interface{}{"terminal"}, data, "B . B . C"}, - {[]interface{}{"initial"}, data, "A.D.X || C"}, - {[]interface{}{"initial"}, data, "A[0].B || C"}, - {[]interface{}{ - Struct{A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}}, - Struct{A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}}, - }, data2, "A"}, - } - for i, c := range testCases { - v, err := awsutil.ValuesAtPath(c.data, c.path) - if err != nil { - t.Errorf("case %v, expected no error, %v", i, c.path) - } - if e, a := c.expect, v; !awsutil.DeepEqual(e, a) { - t.Errorf("case %v, %v", i, c.path) - } - } -} - -func TestValueAtPathFailure(t *testing.T) { - var testCases = []struct { - expect []interface{} - errContains string - data interface{} - path string - }{ - {nil, "", data, "C.x"}, - {nil, "SyntaxError: Invalid token: tDot", data, ".x"}, - {nil, "", data, "X.Y.Z"}, - {nil, "", data, "A[100].C"}, - {nil, "", data, "A[3].C"}, - {nil, "", data, "B.B.C.Z"}, - {nil, "", data, "z[-1].C"}, - {nil, "", nil, "A.B.C"}, - {[]interface{}{}, "", Struct{}, "A"}, - {nil, "", data, "A[0].B.C"}, - {nil, "", data, "D"}, - } - - for i, c := range testCases { - v, err := awsutil.ValuesAtPath(c.data, c.path) - if c.errContains != "" { - if !strings.Contains(err.Error(), c.errContains) { - t.Errorf("case %v, expected error, %v", i, c.path) - } - continue - } else { - if err != nil { - t.Errorf("case %v, expected no error, %v", i, c.path) - } - } - if e, a := c.expect, v; !awsutil.DeepEqual(e, a) { - t.Errorf("case %v, %v", i, c.path) - } - } -} - -func TestSetValueAtPathSuccess(t *testing.T) { - var s Struct - awsutil.SetValueAtPath(&s, "C", "test1") - awsutil.SetValueAtPath(&s, "B.B.C", "test2") - awsutil.SetValueAtPath(&s, "B.D.C", "test3") - if e, a := "test1", s.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := "test2", s.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := "test3", s.B.D.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - awsutil.SetValueAtPath(&s, "B.*.C", "test0") - if e, a := "test0", s.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := "test0", s.B.D.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - var s2 Struct - awsutil.SetValueAtPath(&s2, "b.b.c", "test0") - if e, a := "test0", s2.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - awsutil.SetValueAtPath(&s2, "A", []Struct{{}}) - if e, a := []Struct{{}}, s2.A; !awsutil.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - str := "foo" - - s3 := Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", str) - if e, a := "foo", s3.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s3 = Struct{B: &Struct{B: &Struct{C: str}}} - awsutil.SetValueAtPath(&s3, "b.b.c", nil) - if e, a := "", s3.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s3 = Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", nil) - if e, a := "", s3.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s3 = Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", &str) - if e, a := "foo", s3.B.B.C; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - var s4 struct{ Name *string } - awsutil.SetValueAtPath(&s4, "Name", str) - if e, a := str, *s4.Name; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s4 = struct{ Name *string }{} - awsutil.SetValueAtPath(&s4, "Name", nil) - if e, a := (*string)(nil), s4.Name; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s4 = struct{ Name *string }{Name: &str} - awsutil.SetValueAtPath(&s4, "Name", nil) - if e, a := (*string)(nil), s4.Name; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - s4 = struct{ Name *string }{} - awsutil.SetValueAtPath(&s4, "Name", &str) - if e, a := str, *s4.Name; e != a { - t.Errorf("expected %v, but received %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value_test.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value_test.go deleted file mode 100644 index bf42d1e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// +build go1.7 - -package awsutil - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -type testStruct struct { - Field1 string - Field2 *string - Field3 []byte `sensitive:"true"` - Value []*string -} - -func TestStringValue(t *testing.T) { - cases := map[string]struct { - Value interface{} - Expect string - }{ - "general": { - Value: testStruct{ - Field1: "abc123", - Field2: aws.String("abc123"), - Field3: []byte("don't show me"), - Value: []*string{ - aws.String("first"), - aws.String("second"), - }, - }, - Expect: `{ - Field1: "abc123", - Field2: "abc123", - Field3: , - Value: ["first","second"], - -}`, - }, - } - - for d, c := range cases { - t.Run(d, func(t *testing.T) { - actual := StringValue(c.Value) - if e, a := c.Expect, actual; e != a { - t.Errorf("expect:\n%v\nactual:\n%v\n", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client_test.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client_test.go deleted file mode 100644 index 30d3b99..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/client_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package client - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" -) - -func pushBackTestHandler(name string, list *request.HandlerList) *bool { - called := false - (*list).PushBackNamed(request.NamedHandler{ - Name: name, - Fn: func(r *request.Request) { - called = true - }, - }) - - return &called -} - -func pushFrontTestHandler(name string, list *request.HandlerList) *bool { - called := false - (*list).PushFrontNamed(request.NamedHandler{ - Name: name, - Fn: func(r *request.Request) { - called = true - }, - }) - - return &called -} - -func TestNewClient_CopyHandlers(t *testing.T) { - handlers := request.Handlers{} - firstCalled := pushBackTestHandler("first", &handlers.Send) - secondCalled := pushBackTestHandler("second", &handlers.Send) - - var clientHandlerCalled *bool - c := New(aws.Config{}, metadata.ClientInfo{}, handlers, - func(c *Client) { - clientHandlerCalled = pushFrontTestHandler("client handler", &c.Handlers.Send) - }, - ) - - if e, a := 2, handlers.Send.Len(); e != a { - t.Errorf("expect %d original handlers, got %d", e, a) - } - if e, a := 3, c.Handlers.Send.Len(); e != a { - t.Errorf("expect %d client handlers, got %d", e, a) - } - - handlers.Send.Run(nil) - if !*firstCalled { - t.Errorf("expect first handler to of been called") - } - *firstCalled = false - if !*secondCalled { - t.Errorf("expect second handler to of been called") - } - *secondCalled = false - if *clientHandlerCalled { - t.Errorf("expect client handler to not of been called, but was") - } - - c.Handlers.Send.Run(nil) - if !*firstCalled { - t.Errorf("expect client's first handler to of been called") - } - if !*secondCalled { - t.Errorf("expect client's second handler to of been called") - } - if !*clientHandlerCalled { - t.Errorf("expect client's client handler to of been called") - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer_test.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer_test.go deleted file mode 100644 index b8794f3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer_test.go +++ /dev/null @@ -1,199 +0,0 @@ -package client - -import ( - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestRetryThrottleStatusCodes(t *testing.T) { - cases := []struct { - expectThrottle bool - expectRetry bool - r request.Request - }{ - { - false, - false, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 200}, - }, - }, - { - true, - true, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 429}, - }, - }, - { - true, - true, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 502}, - }, - }, - { - true, - true, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 503}, - }, - }, - { - true, - true, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 504}, - }, - }, - { - false, - true, - request.Request{ - HTTPResponse: &http.Response{StatusCode: 500}, - }, - }, - } - - d := DefaultRetryer{NumMaxRetries: 10} - for i, c := range cases { - throttle := c.r.IsErrorThrottle() - retry := d.ShouldRetry(&c.r) - - if e, a := c.expectThrottle, throttle; e != a { - t.Errorf("%d: expected %v, but received %v", i, e, a) - } - - if e, a := c.expectRetry, retry; e != a { - t.Errorf("%d: expected %v, but received %v", i, e, a) - } - } -} - -func TestCanUseRetryAfter(t *testing.T) { - cases := []struct { - r request.Request - e bool - }{ - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 200}, - }, - false, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 500}, - }, - false, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 429}, - }, - true, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 503}, - }, - true, - }, - } - - for i, c := range cases { - a := canUseRetryAfterHeader(&c.r) - if c.e != a { - t.Errorf("%d: expected %v, but received %v", i, c.e, a) - } - } -} - -func TestGetRetryDelay(t *testing.T) { - cases := []struct { - r request.Request - e time.Duration - equal bool - ok bool - }{ - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 429, Header: http.Header{"Retry-After": []string{"3600"}}}, - }, - 3600 * time.Second, - true, - true, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 503, Header: http.Header{"Retry-After": []string{"120"}}}, - }, - 120 * time.Second, - true, - true, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 503, Header: http.Header{"Retry-After": []string{"120"}}}, - }, - 1 * time.Second, - false, - true, - }, - { - request.Request{ - HTTPResponse: &http.Response{StatusCode: 503, Header: http.Header{"Retry-After": []string{""}}}, - }, - 0 * time.Second, - true, - false, - }, - } - - for i, c := range cases { - a, ok := getRetryAfterDelay(&c.r) - if c.ok != ok { - t.Errorf("%d: expected %v, but received %v", i, c.ok, ok) - } - - if (c.e != a) == c.equal { - t.Errorf("%d: expected %v, but received %v", i, c.e, a) - } - } -} - -func TestRetryDelay(t *testing.T) { - d := DefaultRetryer{NumMaxRetries: 100} - r := request.Request{} - for i := 0; i < 100; i++ { - rTemp := r - rTemp.HTTPResponse = &http.Response{StatusCode: 500, Header: http.Header{"Retry-After": []string{"299"}}} - rTemp.RetryCount = i - a := d.RetryRules(&rTemp) - if a > 5*time.Minute { - t.Errorf("retry delay should never be greater than five minutes, received %s for retrycount %d", a, i) - } - } - - for i := 0; i < 100; i++ { - rTemp := r - rTemp.RetryCount = i - rTemp.HTTPResponse = &http.Response{StatusCode: 503, Header: http.Header{"Retry-After": []string{""}}} - a := d.RetryRules(&rTemp) - if a > 5*time.Minute { - t.Errorf("retry delay should not be greater than five minutes, received %s for retrycount %d", a, i) - } - } - - rTemp := r - rTemp.RetryCount = 1 - rTemp.HTTPResponse = &http.Response{StatusCode: 503, Header: http.Header{"Retry-After": []string{"300"}}} - a := d.RetryRules(&rTemp) - if a < 5*time.Minute { - t.Errorf("retry delay should not be less than retry-after duration, received %s for retrycount %d", a, 1) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger_test.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger_test.go deleted file mode 100644 index 6ee3584..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/logger_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package client - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" -) - -type mockCloser struct { - closed bool -} - -func (closer *mockCloser) Read(b []byte) (int, error) { - return 0, io.EOF -} - -func (closer *mockCloser) Close() error { - closer.closed = true - return nil -} - -func TestTeeReaderCloser(t *testing.T) { - expected := "FOO" - buf := bytes.NewBuffer([]byte(expected)) - lw := bytes.NewBuffer(nil) - c := &mockCloser{} - closer := teeReaderCloser{ - io.TeeReader(buf, lw), - c, - } - - b := make([]byte, len(expected)) - _, err := closer.Read(b) - closer.Close() - - if expected != lw.String() { - t.Errorf("Expected %q, but received %q", expected, lw.String()) - } - - if err != nil { - t.Errorf("Expected 'nil', but received %v", err) - } - - if !c.closed { - t.Error("Expected 'true', but received 'false'") - } -} - -func TestLogWriter(t *testing.T) { - expected := "FOO" - lw := &logWriter{nil, bytes.NewBuffer(nil)} - lw.Write([]byte(expected)) - - if expected != lw.buf.String() { - t.Errorf("Expected %q, but received %q", expected, lw.buf.String()) - } -} - -func TestLogRequest(t *testing.T) { - cases := []struct { - Body io.ReadSeeker - ExpectBody []byte - LogLevel aws.LogLevelType - }{ - { - Body: aws.ReadSeekCloser(bytes.NewBuffer([]byte("body content"))), - ExpectBody: []byte("body content"), - }, - { - Body: aws.ReadSeekCloser(bytes.NewBuffer([]byte("body content"))), - LogLevel: aws.LogDebugWithHTTPBody, - ExpectBody: []byte("body content"), - }, - { - Body: bytes.NewReader([]byte("body content")), - ExpectBody: []byte("body content"), - }, - { - Body: bytes.NewReader([]byte("body content")), - LogLevel: aws.LogDebugWithHTTPBody, - ExpectBody: []byte("body content"), - }, - } - - for i, c := range cases { - logW := bytes.NewBuffer(nil) - req := request.New( - aws.Config{ - Credentials: credentials.AnonymousCredentials, - Logger: &bufLogger{w: logW}, - LogLevel: aws.LogLevel(c.LogLevel), - }, - metadata.ClientInfo{ - Endpoint: "https://mock-service.mock-region.amazonaws.com", - }, - testHandlers(), - nil, - &request.Operation{ - Name: "APIName", - HTTPMethod: "POST", - HTTPPath: "/", - }, - struct{}{}, nil, - ) - req.SetReaderBody(c.Body) - req.Build() - - logRequest(req) - - b, err := ioutil.ReadAll(req.HTTPRequest.Body) - if err != nil { - t.Fatalf("%d, expect to read SDK request Body", i) - } - - if e, a := c.ExpectBody, b; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v body, got %v", i, e, a) - } - } -} - -func TestLogResponse(t *testing.T) { - cases := []struct { - Body *bytes.Buffer - ExpectBody []byte - ReadBody bool - LogLevel aws.LogLevelType - }{ - { - Body: bytes.NewBuffer([]byte("body content")), - ExpectBody: []byte("body content"), - }, - { - Body: bytes.NewBuffer([]byte("body content")), - LogLevel: aws.LogDebug, - ExpectBody: []byte("body content"), - }, - { - Body: bytes.NewBuffer([]byte("body content")), - LogLevel: aws.LogDebugWithHTTPBody, - ReadBody: true, - ExpectBody: []byte("body content"), - }, - } - - for i, c := range cases { - var logW bytes.Buffer - req := request.New( - aws.Config{ - Credentials: credentials.AnonymousCredentials, - Logger: &bufLogger{w: &logW}, - LogLevel: aws.LogLevel(c.LogLevel), - }, - metadata.ClientInfo{ - Endpoint: "https://mock-service.mock-region.amazonaws.com", - }, - testHandlers(), - nil, - &request.Operation{ - Name: "APIName", - HTTPMethod: "POST", - HTTPPath: "/", - }, - struct{}{}, nil, - ) - req.HTTPResponse = &http.Response{ - StatusCode: 200, - Status: "OK", - Header: http.Header{ - "ABC": []string{"123"}, - }, - Body: ioutil.NopCloser(c.Body), - } - - logResponse(req) - req.Handlers.Unmarshal.Run(req) - - if c.ReadBody { - if e, a := len(c.ExpectBody), c.Body.Len(); e != a { - t.Errorf("%d, expect original body not to of been read", i) - } - } - - if logW.Len() == 0 { - t.Errorf("%d, expect HTTP Response headers to be logged", i) - } - - b, err := ioutil.ReadAll(req.HTTPResponse.Body) - if err != nil { - t.Fatalf("%d, expect to read SDK request Body", i) - } - - if e, a := c.ExpectBody, b; !bytes.Equal(e, a) { - t.Errorf("%d, expect %v body, got %v", i, e, a) - } - } -} - -type bufLogger struct { - w *bytes.Buffer -} - -func (l *bufLogger) Log(args ...interface{}) { - fmt.Fprintln(l.w, args...) -} - -func testHandlers() request.Handlers { - var handlers request.Handlers - - handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) - - return handlers -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer_test.go b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer_test.go deleted file mode 100644 index d572268..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package client - -import ( - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestNoOpRetryer(t *testing.T) { - cases := []struct { - r request.Request - expectMaxRetries int - expectRetryDelay time.Duration - expectRetry bool - }{ - { - r: request.Request{ - HTTPResponse: &http.Response{StatusCode: 200}, - }, - expectMaxRetries: 0, - expectRetryDelay: 0, - expectRetry: false, - }, - } - - d := NoOpRetryer{} - for i, c := range cases { - maxRetries := d.MaxRetries() - retry := d.ShouldRetry(&c.r) - retryDelay := d.RetryRules(&c.r) - - if e, a := c.expectMaxRetries, maxRetries; e != a { - t.Errorf("%d: expected %v, but received %v for number of max retries", i, e, a) - } - - if e, a := c.expectRetry, retry; e != a { - t.Errorf("%d: expected %v, but received %v for should retry", i, e, a) - } - - if e, a := c.expectRetryDelay, retryDelay; e != a { - t.Errorf("%d: expected %v, but received %v as retry delay", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config_test.go b/vendor/github.com/aws/aws-sdk-go/aws/config_test.go deleted file mode 100644 index fe97a31..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/config_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package aws - -import ( - "net/http" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" -) - -var testCredentials = credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - -var copyTestConfig = Config{ - Credentials: testCredentials, - Endpoint: String("CopyTestEndpoint"), - Region: String("COPY_TEST_AWS_REGION"), - DisableSSL: Bool(true), - HTTPClient: http.DefaultClient, - LogLevel: LogLevel(LogDebug), - Logger: NewDefaultLogger(), - MaxRetries: Int(3), - DisableParamValidation: Bool(true), - DisableComputeChecksums: Bool(true), - S3ForcePathStyle: Bool(true), -} - -func TestCopy(t *testing.T) { - want := copyTestConfig - got := copyTestConfig.Copy() - if !reflect.DeepEqual(*got, want) { - t.Errorf("Copy() = %+v", got) - t.Errorf(" want %+v", want) - } - - got.Region = String("other") - if got.Region == want.Region { - t.Errorf("Expect setting copy values not not reflect in source") - } -} - -func TestCopyReturnsNewInstance(t *testing.T) { - want := copyTestConfig - got := copyTestConfig.Copy() - if got == &want { - t.Errorf("Copy() = %p; want different instance as source %p", got, &want) - } -} - -var mergeTestZeroValueConfig = Config{} - -var mergeTestConfig = Config{ - Credentials: testCredentials, - Endpoint: String("MergeTestEndpoint"), - Region: String("MERGE_TEST_AWS_REGION"), - DisableSSL: Bool(true), - HTTPClient: http.DefaultClient, - LogLevel: LogLevel(LogDebug), - Logger: NewDefaultLogger(), - MaxRetries: Int(10), - DisableParamValidation: Bool(true), - DisableComputeChecksums: Bool(true), - S3ForcePathStyle: Bool(true), -} - -var mergeTests = []struct { - cfg *Config - in *Config - want *Config -}{ - {&Config{}, nil, &Config{}}, - {&Config{}, &mergeTestZeroValueConfig, &Config{}}, - {&Config{}, &mergeTestConfig, &mergeTestConfig}, -} - -func TestMerge(t *testing.T) { - for i, tt := range mergeTests { - got := tt.cfg.Copy() - got.MergeIn(tt.in) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Config %d %+v", i, tt.cfg) - t.Errorf(" Merge(%+v)", tt.in) - t.Errorf(" got %+v", got) - t.Errorf(" want %+v", tt.want) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_test.go b/vendor/github.com/aws/aws-sdk-go/aws/context_test.go deleted file mode 100644 index edf3b83..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/context_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package aws_test - -import ( - "fmt" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestSleepWithContext(t *testing.T) { - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - - err := aws.SleepWithContext(ctx, 1*time.Millisecond) - if err != nil { - t.Errorf("expect context to not be canceled, got %v", err) - } -} - -func TestSleepWithContext_Canceled(t *testing.T) { - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - - expectErr := fmt.Errorf("context canceled") - - ctx.Error = expectErr - close(ctx.DoneCh) - - err := aws.SleepWithContext(ctx, 10*time.Second) - if err == nil { - t.Fatalf("expect error, did not get one") - } - - if e, a := expectErr, err; e != a { - t.Errorf("expect %v error, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/convert_types_test.go b/vendor/github.com/aws/aws-sdk-go/aws/convert_types_test.go deleted file mode 100644 index 1c83947..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/convert_types_test.go +++ /dev/null @@ -1,1532 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - "time" -) - -var testCasesStringSlice = [][]string{ - {"a", "b", "c", "d", "e"}, - {"a", "b", "", "", "e"}, -} - -func TestStringSlice(t *testing.T) { - for idx, in := range testCasesStringSlice { - if in == nil { - continue - } - out := StringSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := StringValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesStringValueSlice = [][]*string{ - {String("a"), String("b"), nil, String("c")}, -} - -func TestStringValueSlice(t *testing.T) { - for idx, in := range testCasesStringValueSlice { - if in == nil { - continue - } - out := StringValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != "" { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := StringSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != "" { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *in[i], *out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesStringMap = []map[string]string{ - {"a": "1", "b": "2", "c": "3"}, -} - -func TestStringMap(t *testing.T) { - for idx, in := range testCasesStringMap { - if in == nil { - continue - } - out := StringMap(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := StringValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesBoolSlice = [][]bool{ - {true, true, false, false}, -} - -func TestBoolSlice(t *testing.T) { - for idx, in := range testCasesBoolSlice { - if in == nil { - continue - } - out := BoolSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := BoolValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesBoolValueSlice = [][]*bool{} - -func TestBoolValueSlice(t *testing.T) { - for idx, in := range testCasesBoolValueSlice { - if in == nil { - continue - } - out := BoolValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := BoolSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesBoolMap = []map[string]bool{ - {"a": true, "b": false, "c": true}, -} - -func TestBoolMap(t *testing.T) { - for idx, in := range testCasesBoolMap { - if in == nil { - continue - } - out := BoolMap(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := BoolValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUintSlice = [][]uint{ - {1, 2, 3, 4}, -} - -func TestUintSlice(t *testing.T) { - for idx, in := range testCasesUintSlice { - if in == nil { - continue - } - out := UintSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := UintValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUintValueSlice = [][]*uint{} - -func TestUintValueSlice(t *testing.T) { - for idx, in := range testCasesUintValueSlice { - if in == nil { - continue - } - out := UintValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := UintSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesUintMap = []map[string]uint{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUintMap(t *testing.T) { - for idx, in := range testCasesUintMap { - if in == nil { - continue - } - out := UintMap(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := UintValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesIntSlice = [][]int{ - {1, 2, 3, 4}, -} - -func TestIntSlice(t *testing.T) { - for idx, in := range testCasesIntSlice { - if in == nil { - continue - } - out := IntSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := IntValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesIntValueSlice = [][]*int{} - -func TestIntValueSlice(t *testing.T) { - for idx, in := range testCasesIntValueSlice { - if in == nil { - continue - } - out := IntValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := IntSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesIntMap = []map[string]int{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestIntMap(t *testing.T) { - for idx, in := range testCasesIntMap { - if in == nil { - continue - } - out := IntMap(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := IntValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt8Slice = [][]int8{ - {1, 2, 3, 4}, -} - -func TestInt8Slice(t *testing.T) { - for idx, in := range testCasesInt8Slice { - if in == nil { - continue - } - out := Int8Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int8ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt8ValueSlice = [][]*int8{} - -func TestInt8ValueSlice(t *testing.T) { - for idx, in := range testCasesInt8ValueSlice { - if in == nil { - continue - } - out := Int8ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Int8Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesInt8Map = []map[string]int8{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt8Map(t *testing.T) { - for idx, in := range testCasesInt8Map { - if in == nil { - continue - } - out := Int8Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int8ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt16Slice = [][]int16{ - {1, 2, 3, 4}, -} - -func TestInt16Slice(t *testing.T) { - for idx, in := range testCasesInt16Slice { - if in == nil { - continue - } - out := Int16Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int16ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt16ValueSlice = [][]*int16{} - -func TestInt16ValueSlice(t *testing.T) { - for idx, in := range testCasesInt16ValueSlice { - if in == nil { - continue - } - out := Int16ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Int16Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesInt16Map = []map[string]int16{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt16Map(t *testing.T) { - for idx, in := range testCasesInt16Map { - if in == nil { - continue - } - out := Int16Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int16ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt32Slice = [][]int32{ - {1, 2, 3, 4}, -} - -func TestInt32Slice(t *testing.T) { - for idx, in := range testCasesInt32Slice { - if in == nil { - continue - } - out := Int32Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int32ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt32ValueSlice = [][]*int32{} - -func TestInt32ValueSlice(t *testing.T) { - for idx, in := range testCasesInt32ValueSlice { - if in == nil { - continue - } - out := Int32ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Int32Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesInt32Map = []map[string]int32{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt32Map(t *testing.T) { - for idx, in := range testCasesInt32Map { - if in == nil { - continue - } - out := Int32Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int32ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt64Slice = [][]int64{ - {1, 2, 3, 4}, -} - -func TestInt64Slice(t *testing.T) { - for idx, in := range testCasesInt64Slice { - if in == nil { - continue - } - out := Int64Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int64ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesInt64ValueSlice = [][]*int64{} - -func TestInt64ValueSlice(t *testing.T) { - for idx, in := range testCasesInt64ValueSlice { - if in == nil { - continue - } - out := Int64ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Int64Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesInt64Map = []map[string]int64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestInt64Map(t *testing.T) { - for idx, in := range testCasesInt64Map { - if in == nil { - continue - } - out := Int64Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Int64ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint8Slice = [][]uint8{ - {1, 2, 3, 4}, -} - -func TestUint8Slice(t *testing.T) { - for idx, in := range testCasesUint8Slice { - if in == nil { - continue - } - out := Uint8Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint8ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint8ValueSlice = [][]*uint8{} - -func TestUint8ValueSlice(t *testing.T) { - for idx, in := range testCasesUint8ValueSlice { - if in == nil { - continue - } - out := Uint8ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Uint8Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesUint8Map = []map[string]uint8{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint8Map(t *testing.T) { - for idx, in := range testCasesUint8Map { - if in == nil { - continue - } - out := Uint8Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint8ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint16Slice = [][]uint16{ - {1, 2, 3, 4}, -} - -func TestUint16Slice(t *testing.T) { - for idx, in := range testCasesUint16Slice { - if in == nil { - continue - } - out := Uint16Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint16ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint16ValueSlice = [][]*uint16{} - -func TestUint16ValueSlice(t *testing.T) { - for idx, in := range testCasesUint16ValueSlice { - if in == nil { - continue - } - out := Uint16ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Uint16Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesUint16Map = []map[string]uint16{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint16Map(t *testing.T) { - for idx, in := range testCasesUint16Map { - if in == nil { - continue - } - out := Uint16Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint16ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint32Slice = [][]uint32{ - {1, 2, 3, 4}, -} - -func TestUint32Slice(t *testing.T) { - for idx, in := range testCasesUint32Slice { - if in == nil { - continue - } - out := Uint32Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint32ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint32ValueSlice = [][]*uint32{} - -func TestUint32ValueSlice(t *testing.T) { - for idx, in := range testCasesUint32ValueSlice { - if in == nil { - continue - } - out := Uint32ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Uint32Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesUint32Map = []map[string]uint32{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint32Map(t *testing.T) { - for idx, in := range testCasesUint32Map { - if in == nil { - continue - } - out := Uint32Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint32ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint64Slice = [][]uint64{ - {1, 2, 3, 4}, -} - -func TestUint64Slice(t *testing.T) { - for idx, in := range testCasesUint64Slice { - if in == nil { - continue - } - out := Uint64Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint64ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesUint64ValueSlice = [][]*uint64{} - -func TestUint64ValueSlice(t *testing.T) { - for idx, in := range testCasesUint64ValueSlice { - if in == nil { - continue - } - out := Uint64ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Uint64Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesUint64Map = []map[string]uint64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestUint64Map(t *testing.T) { - for idx, in := range testCasesUint64Map { - if in == nil { - continue - } - out := Uint64Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Uint64ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesFloat32Slice = [][]float32{ - {1, 2, 3, 4}, -} - -func TestFloat32Slice(t *testing.T) { - for idx, in := range testCasesFloat32Slice { - if in == nil { - continue - } - out := Float32Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Float32ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesFloat32ValueSlice = [][]*float32{} - -func TestFloat32ValueSlice(t *testing.T) { - for idx, in := range testCasesFloat32ValueSlice { - if in == nil { - continue - } - out := Float32ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Float32Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesFloat32Map = []map[string]float32{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestFloat32Map(t *testing.T) { - for idx, in := range testCasesFloat32Map { - if in == nil { - continue - } - out := Float32Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Float32ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesFloat64Slice = [][]float64{ - {1, 2, 3, 4}, -} - -func TestFloat64Slice(t *testing.T) { - for idx, in := range testCasesFloat64Slice { - if in == nil { - continue - } - out := Float64Slice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Float64ValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesFloat64ValueSlice = [][]*float64{} - -func TestFloat64ValueSlice(t *testing.T) { - for idx, in := range testCasesFloat64ValueSlice { - if in == nil { - continue - } - out := Float64ValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if out[i] != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := Float64Slice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if *(out2[i]) != 0 { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesFloat64Map = []map[string]float64{ - {"a": 3, "b": 2, "c": 1}, -} - -func TestFloat64Map(t *testing.T) { - for idx, in := range testCasesFloat64Map { - if in == nil { - continue - } - out := Float64Map(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := Float64ValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesTimeSlice = [][]time.Time{ - {time.Now(), time.Now().AddDate(100, 0, 0)}, -} - -func TestTimeSlice(t *testing.T) { - for idx, in := range testCasesTimeSlice { - if in == nil { - continue - } - out := TimeSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := TimeValueSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -var testCasesTimeValueSlice = [][]*time.Time{} - -func TestTimeValueSlice(t *testing.T) { - for idx, in := range testCasesTimeValueSlice { - if in == nil { - continue - } - out := TimeValueSlice(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if in[i] == nil { - if !out[i].IsZero() { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := *(in[i]), out[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - - out2 := TimeSlice(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out2 { - if in[i] == nil { - if !(out2[i]).IsZero() { - t.Errorf("Unexpected value at idx %d", idx) - } - } else { - if e, a := in[i], out2[i]; e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - } - } -} - -var testCasesTimeMap = []map[string]time.Time{ - {"a": time.Now().AddDate(-100, 0, 0), "b": time.Now()}, -} - -func TestTimeMap(t *testing.T) { - for idx, in := range testCasesTimeMap { - if in == nil { - continue - } - out := TimeMap(in) - if e, a := len(out), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - for i := range out { - if e, a := in[i], *(out[i]); e != a { - t.Errorf("Unexpected value at idx %d", idx) - } - } - - out2 := TimeValueMap(out) - if e, a := len(out2), len(in); e != a { - t.Errorf("Unexpected len at idx %d", idx) - } - if e, a := in, out2; !reflect.DeepEqual(e, a) { - t.Errorf("Unexpected value at idx %d", idx) - } - } -} - -type TimeValueTestCase struct { - in int64 - outSecs time.Time - outMillis time.Time -} - -var testCasesTimeValue = []TimeValueTestCase{ - { - in: int64(1501558289000), - outSecs: time.Unix(1501558289, 0), - outMillis: time.Unix(1501558289, 0), - }, - { - in: int64(1501558289001), - outSecs: time.Unix(1501558289, 0), - outMillis: time.Unix(1501558289, 1*1000000), - }, -} - -func TestSecondsTimeValue(t *testing.T) { - for idx, testCase := range testCasesTimeValue { - out := SecondsTimeValue(&testCase.in) - if e, a := testCase.outSecs, out; e != a { - t.Errorf("Unexpected value for time value at %d", idx) - } - } -} - -func TestMillisecondsTimeValue(t *testing.T) { - for idx, testCase := range testCasesTimeValue { - out := MillisecondsTimeValue(&testCase.in) - if e, a := testCase.outMillis, out; e != a { - t.Errorf("Unexpected value for time value at %d", idx) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_1_10_test.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_1_10_test.go deleted file mode 100644 index 0d03ce6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_1_10_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// +build go1.10 - -package corehandlers_test - -import ( - "bytes" - "io" - "net/http" - "net/http/httptest" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestSendHandler_HEADNoBody(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - if e, a := "HEAD", r.Method; e != a { - t.Errorf("expected %v method, got %v", e, a) - } - var buf bytes.Buffer - io.Copy(&buf, r.Body) - - if n := buf.Len(); n != 0 { - t.Errorf("expect empty body, got %d", n) - } - - w.WriteHeader(http.StatusOK) - })) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - Credentials: credentials.AnonymousCredentials, - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - }) - - req, _ := svc.HeadObjectRequest(&s3.HeadObjectInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("keyname"), - }) - - if e, a := request.NoBody, req.HTTPRequest.Body; e != a { - t.Fatalf("expect %T request body, got %T", e, a) - } - - if err := req.Send(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := http.StatusOK, req.HTTPResponse.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go deleted file mode 100644 index dd87cc4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go +++ /dev/null @@ -1,404 +0,0 @@ -package corehandlers_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestValidateEndpointHandler(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - svc := awstesting.NewClient(aws.NewConfig().WithRegion("us-west-2")) - svc.Handlers.Clear() - svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) - - req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} - -func TestValidateEndpointHandlerErrorRegion(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - svc := awstesting.NewClient() - svc.Handlers.Clear() - svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) - - req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - if err == nil { - t.Errorf("expect error, got none") - } - if e, a := aws.ErrMissingRegion, err; e != a { - t.Errorf("expect %v to be %v", e, a) - } -} - -type mockCredsProvider struct { - expired bool - retrieveCalled bool -} - -func (m *mockCredsProvider) Retrieve() (credentials.Value, error) { - m.retrieveCalled = true - return credentials.Value{ProviderName: "mockCredsProvider"}, nil -} - -func (m *mockCredsProvider) IsExpired() bool { - return m.expired -} - -func TestAfterRetryRefreshCreds(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - credProvider := &mockCredsProvider{} - - svc := awstesting.NewClient(&aws.Config{ - Credentials: credentials.NewCredentials(credProvider), - MaxRetries: aws.Int(1), - }) - - svc.Handlers.Clear() - svc.Handlers.ValidateResponse.PushBack(func(r *request.Request) { - r.Error = awserr.New("UnknownError", "", nil) - r.HTTPResponse = &http.Response{StatusCode: 400, Body: ioutil.NopCloser(bytes.NewBuffer([]byte{}))} - }) - svc.Handlers.UnmarshalError.PushBack(func(r *request.Request) { - r.Error = awserr.New("ExpiredTokenException", "", nil) - }) - svc.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) - - if !svc.Config.Credentials.IsExpired() { - t.Errorf("Expect to start out expired") - } - if credProvider.retrieveCalled { - t.Errorf("expect not called") - } - - req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - req.Send() - - if !svc.Config.Credentials.IsExpired() { - t.Errorf("Expect to start out expired") - } - if credProvider.retrieveCalled { - t.Errorf("expect not called") - } - - _, err := svc.Config.Credentials.Get() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if !credProvider.retrieveCalled { - t.Errorf("expect not called") - } -} - -func TestAfterRetryWithContextCanceled(t *testing.T) { - c := awstesting.NewClient() - - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - req.SetContext(ctx) - - req.Error = fmt.Errorf("some error") - req.Retryable = aws.Bool(true) - req.HTTPResponse = &http.Response{ - StatusCode: 500, - } - - close(ctx.DoneCh) - ctx.Error = fmt.Errorf("context canceled") - - corehandlers.AfterRetryHandler.Fn(req) - - if req.Error == nil { - t.Fatalf("expect error but didn't receive one") - } - - aerr := req.Error.(awserr.Error) - - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expect %q, error code got %q", e, a) - } -} - -func TestAfterRetryWithContext(t *testing.T) { - c := awstesting.NewClient() - - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - req.SetContext(ctx) - - req.Error = fmt.Errorf("some error") - req.Retryable = aws.Bool(true) - req.HTTPResponse = &http.Response{ - StatusCode: 500, - } - - corehandlers.AfterRetryHandler.Fn(req) - - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } - if e, a := 1, req.RetryCount; e != a { - t.Errorf("expect retry count to be %d, got %d", e, a) - } -} - -func TestSendWithContextCanceled(t *testing.T) { - c := awstesting.NewClient(&aws.Config{ - SleepDelay: func(dur time.Duration) { - t.Errorf("SleepDelay should not be called") - }, - }) - - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - req.SetContext(ctx) - - req.Error = fmt.Errorf("some error") - req.Retryable = aws.Bool(true) - req.HTTPResponse = &http.Response{ - StatusCode: 500, - } - - close(ctx.DoneCh) - ctx.Error = fmt.Errorf("context canceled") - - corehandlers.SendHandler.Fn(req) - - if req.Error == nil { - t.Fatalf("expect error but didn't receive one") - } - - aerr := req.Error.(awserr.Error) - - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expect %q, error code got %q", e, a) - } -} - -type testSendHandlerTransport struct{} - -func (t *testSendHandlerTransport) RoundTrip(r *http.Request) (*http.Response, error) { - return nil, fmt.Errorf("mock error") -} - -func TestSendHandlerError(t *testing.T) { - svc := awstesting.NewClient(&aws.Config{ - HTTPClient: &http.Client{ - Transport: &testSendHandlerTransport{}, - }, - }) - svc.Handlers.Clear() - svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler) - r := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - r.Send() - - if r.Error == nil { - t.Errorf("expect error, got none") - } - if r.HTTPResponse == nil { - t.Errorf("expect response, got none") - } -} - -func TestSendWithoutFollowRedirects(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case "/original": - w.Header().Set("Location", "/redirected") - w.WriteHeader(301) - case "/redirected": - t.Fatalf("expect not to redirect, but was") - } - })) - defer server.Close() - - svc := awstesting.NewClient(&aws.Config{ - DisableSSL: aws.Bool(true), - Endpoint: aws.String(server.URL), - }) - svc.Handlers.Clear() - svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler) - - r := svc.NewRequest(&request.Operation{ - Name: "Operation", - HTTPPath: "/original", - }, nil, nil) - r.DisableFollowRedirects = true - - err := r.Send() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := 301, r.HTTPResponse.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} - -func TestValidateReqSigHandler(t *testing.T) { - cases := []struct { - Req *request.Request - Resign bool - }{ - { - Req: &request.Request{ - Config: aws.Config{Credentials: credentials.AnonymousCredentials}, - Time: time.Now().Add(-15 * time.Minute), - }, - Resign: false, - }, - { - Req: &request.Request{ - Time: time.Now().Add(-15 * time.Minute), - }, - Resign: true, - }, - { - Req: &request.Request{ - Time: time.Now().Add(-1 * time.Minute), - }, - Resign: false, - }, - } - - for i, c := range cases { - resigned := false - c.Req.Handlers.Sign.PushBack(func(r *request.Request) { - resigned = true - }) - - corehandlers.ValidateReqSigHandler.Fn(c.Req) - - if c.Req.Error != nil { - t.Errorf("expect no error, got %v", c.Req.Error) - } - if e, a := c.Resign, resigned; e != a { - t.Errorf("%d, expect %v to be %v", i, e, a) - } - } -} - -func setupContentLengthTestServer(t *testing.T, hasContentLength bool, contentLength int64) *httptest.Server { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, ok := r.Header["Content-Length"] - if e, a := hasContentLength, ok; e != a { - t.Errorf("expect %v to be %v", e, a) - } - if hasContentLength { - if e, a := contentLength, r.ContentLength; e != a { - t.Errorf("expect %v to be %v", e, a) - } - } - - b, err := ioutil.ReadAll(r.Body) - if err != nil { - t.Errorf("expect no error, got %v", err) - } - r.Body.Close() - - authHeader := r.Header.Get("Authorization") - if hasContentLength { - if e, a := "content-length", authHeader; !strings.Contains(a, e) { - t.Errorf("expect %v to be in %v", e, a) - } - } else { - if e, a := "content-length", authHeader; strings.Contains(a, e) { - t.Errorf("expect %v to not be in %v", e, a) - } - } - - if e, a := contentLength, int64(len(b)); e != a { - t.Errorf("expect %v to be %v", e, a) - } - })) - - return server -} - -func TestBuildContentLength_ZeroBody(t *testing.T) { - server := setupContentLengthTestServer(t, false, 0) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - }) - _, err := svc.GetObject(&s3.GetObjectInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("keyname"), - }) - - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} - -func TestBuildContentLength_NegativeBody(t *testing.T) { - server := setupContentLengthTestServer(t, false, 0) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - }) - req, _ := svc.GetObjectRequest(&s3.GetObjectInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("keyname"), - }) - - req.HTTPRequest.Header.Set("Content-Length", "-1") - - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } -} - -func TestBuildContentLength_WithBody(t *testing.T) { - server := setupContentLengthTestServer(t, true, 1024) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - }) - _, err := svc.PutObject(&s3.PutObjectInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("keyname"), - Body: bytes.NewReader(make([]byte, 1024)), - }) - - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go deleted file mode 100644 index 0779941..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go +++ /dev/null @@ -1,286 +0,0 @@ -package corehandlers_test - -import ( - "fmt" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/kinesis" -) - -var testSvc = func() *client.Client { - s := &client.Client{ - Config: aws.Config{}, - ClientInfo: metadata.ClientInfo{ - ServiceName: "mock-service", - APIVersion: "2015-01-01", - }, - } - return s -}() - -type StructShape struct { - _ struct{} `type:"structure"` - - RequiredList []*ConditionalStructShape `required:"true"` - RequiredMap map[string]*ConditionalStructShape `required:"true"` - RequiredBool *bool `required:"true"` - OptionalStruct *ConditionalStructShape - - hiddenParameter *string -} - -func (s *StructShape) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StructShape"} - if s.RequiredList == nil { - invalidParams.Add(request.NewErrParamRequired("RequiredList")) - } - if s.RequiredMap == nil { - invalidParams.Add(request.NewErrParamRequired("RequiredMap")) - } - if s.RequiredBool == nil { - invalidParams.Add(request.NewErrParamRequired("RequiredBool")) - } - if s.RequiredList != nil { - for i, v := range s.RequiredList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequiredList", i), err.(request.ErrInvalidParams)) - } - } - } - if s.RequiredMap != nil { - for i, v := range s.RequiredMap { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequiredMap", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OptionalStruct != nil { - if err := s.OptionalStruct.Validate(); err != nil { - invalidParams.AddNested("OptionalStruct", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -type ConditionalStructShape struct { - _ struct{} `type:"structure"` - - Name *string `required:"true"` -} - -func (s *ConditionalStructShape) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConditionalStructShape"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -func TestNoErrors(t *testing.T) { - input := &StructShape{ - RequiredList: []*ConditionalStructShape{}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": {Name: aws.String("Name")}, - "key2": {Name: aws.String("Name")}, - }, - RequiredBool: aws.Bool(true), - OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")}, - } - - req := testSvc.NewRequest(&request.Operation{}, input, nil) - corehandlers.ValidateParametersHandler.Fn(req) - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } -} - -func TestMissingRequiredParameters(t *testing.T) { - input := &StructShape{} - req := testSvc.NewRequest(&request.Operation{}, input, nil) - corehandlers.ValidateParametersHandler.Fn(req) - - if req.Error == nil { - t.Fatalf("expect error") - } - if e, a := "InvalidParameter", req.Error.(awserr.Error).Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "3 validation error(s) found.", req.Error.(awserr.Error).Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - errs := req.Error.(awserr.BatchedErrors).OrigErrs() - if e, a := 3, len(errs); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.RequiredList.", errs[0].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.RequiredMap.", errs[1].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.RequiredBool.", errs[2].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := "InvalidParameter: 3 validation error(s) found.\n- missing required field, StructShape.RequiredList.\n- missing required field, StructShape.RequiredMap.\n- missing required field, StructShape.RequiredBool.\n", req.Error.Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestNestedMissingRequiredParameters(t *testing.T) { - input := &StructShape{ - RequiredList: []*ConditionalStructShape{{}}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": {Name: aws.String("Name")}, - "key2": {}, - }, - RequiredBool: aws.Bool(true), - OptionalStruct: &ConditionalStructShape{}, - } - - req := testSvc.NewRequest(&request.Operation{}, input, nil) - corehandlers.ValidateParametersHandler.Fn(req) - - if req.Error == nil { - t.Fatalf("expect error") - } - if e, a := "InvalidParameter", req.Error.(awserr.Error).Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "3 validation error(s) found.", req.Error.(awserr.Error).Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - errs := req.Error.(awserr.BatchedErrors).OrigErrs() - if e, a := 3, len(errs); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.RequiredList[0].Name.", errs[0].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.RequiredMap[key2].Name.", errs[1].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ParamRequiredError: missing required field, StructShape.OptionalStruct.Name.", errs[2].Error(); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -type testInput struct { - StringField *string `min:"5"` - ListField []string `min:"3"` - MapField map[string]string `min:"4"` -} - -func (s testInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "testInput"} - if s.StringField != nil && len(*s.StringField) < 5 { - invalidParams.Add(request.NewErrParamMinLen("StringField", 5)) - } - if s.ListField != nil && len(s.ListField) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ListField", 3)) - } - if s.MapField != nil && len(s.MapField) < 4 { - invalidParams.Add(request.NewErrParamMinLen("MapField", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -var testsFieldMin = []struct { - err awserr.Error - in testInput -}{ - { - err: func() awserr.Error { - invalidParams := request.ErrInvalidParams{Context: "testInput"} - invalidParams.Add(request.NewErrParamMinLen("StringField", 5)) - return invalidParams - }(), - in: testInput{StringField: aws.String("abcd")}, - }, - { - err: func() awserr.Error { - invalidParams := request.ErrInvalidParams{Context: "testInput"} - invalidParams.Add(request.NewErrParamMinLen("StringField", 5)) - invalidParams.Add(request.NewErrParamMinLen("ListField", 3)) - return invalidParams - }(), - in: testInput{StringField: aws.String("abcd"), ListField: []string{"a", "b"}}, - }, - { - err: func() awserr.Error { - invalidParams := request.ErrInvalidParams{Context: "testInput"} - invalidParams.Add(request.NewErrParamMinLen("StringField", 5)) - invalidParams.Add(request.NewErrParamMinLen("ListField", 3)) - invalidParams.Add(request.NewErrParamMinLen("MapField", 4)) - return invalidParams - }(), - in: testInput{StringField: aws.String("abcd"), ListField: []string{"a", "b"}, MapField: map[string]string{"a": "a", "b": "b"}}, - }, - { - err: nil, - in: testInput{StringField: aws.String("abcde"), - ListField: []string{"a", "b", "c"}, MapField: map[string]string{"a": "a", "b": "b", "c": "c", "d": "d"}}, - }, -} - -func TestValidateFieldMinParameter(t *testing.T) { - for i, c := range testsFieldMin { - req := testSvc.NewRequest(&request.Operation{}, &c.in, nil) - corehandlers.ValidateParametersHandler.Fn(req) - - if e, a := c.err, req.Error; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } -} - -func BenchmarkValidateAny(b *testing.B) { - input := &kinesis.PutRecordsInput{ - StreamName: aws.String("stream"), - } - for i := 0; i < 100; i++ { - record := &kinesis.PutRecordsRequestEntry{ - Data: make([]byte, 10000), - PartitionKey: aws.String("partition"), - } - input.Records = append(input.Records, record) - } - - req, _ := kinesis.New(unit.Session).PutRecordsRequest(input) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - corehandlers.ValidateParametersHandler.Fn(req) - if err := req.Error; err != nil { - b.Fatalf("validation failed: %v", err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent_test.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent_test.go deleted file mode 100644 index a3ae6a2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package corehandlers - -import ( - "net/http" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func TestAddHostExecEnvUserAgentHander(t *testing.T) { - cases := []struct { - ExecEnv string - Expect string - }{ - {ExecEnv: "Lambda", Expect: execEnvUAKey + "/Lambda"}, - {ExecEnv: "", Expect: ""}, - {ExecEnv: "someThingCool", Expect: execEnvUAKey + "/someThingCool"}, - } - - for i, c := range cases { - sdktesting.StashEnv() - os.Setenv(execEnvVar, c.ExecEnv) - - req := &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - } - AddHostExecEnvUserAgentHander.Fn(req) - - if err := req.Error; err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - if e, a := c.Expect, req.HTTPRequest.Header.Get("User-Agent"); e != a { - t.Errorf("%d, expect %v user agent, got %v", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go deleted file mode 100644 index 78ff32d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go +++ /dev/null @@ -1,189 +0,0 @@ -package credentials - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -type secondStubProvider struct { - creds Value - expired bool - err error -} - -func (s *secondStubProvider) Retrieve() (Value, error) { - s.expired = false - s.creds.ProviderName = "secondStubProvider" - return s.creds, s.err -} -func (s *secondStubProvider) IsExpired() bool { - return s.expired -} - -func TestChainProviderWithNames(t *testing.T) { - p := &ChainProvider{ - Providers: []Provider{ - &stubProvider{err: awserr.New("FirstError", "first provider error", nil)}, - &stubProvider{err: awserr.New("SecondError", "second provider error", nil)}, - &secondStubProvider{ - creds: Value{ - AccessKeyID: "AKIF", - SecretAccessKey: "NOSECRET", - SessionToken: "", - }, - }, - &stubProvider{ - creds: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - }, - }, - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("Expect no error, got %v", err) - } - if e, a := "secondStubProvider", creds.ProviderName; e != a { - t.Errorf("Expect provider name to match, %v got, %v", e, a) - } - - // Also check credentials - if e, a := "AKIF", creds.AccessKeyID; e != a { - t.Errorf("Expect access key ID to match, %v got %v", e, a) - } - if e, a := "NOSECRET", creds.SecretAccessKey; e != a { - t.Errorf("Expect secret access key to match, %v got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect session token to be empty, %v", v) - } - -} - -func TestChainProviderGet(t *testing.T) { - p := &ChainProvider{ - Providers: []Provider{ - &stubProvider{err: awserr.New("FirstError", "first provider error", nil)}, - &stubProvider{err: awserr.New("SecondError", "second provider error", nil)}, - &stubProvider{ - creds: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - }, - }, - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("Expect no error, got %v", err) - } - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("Expect access key ID to match, %v got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("Expect secret access key to match, %v got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect session token to be empty, %v", v) - } -} - -func TestChainProviderIsExpired(t *testing.T) { - stubProvider := &stubProvider{expired: true} - p := &ChainProvider{ - Providers: []Provider{ - stubProvider, - }, - } - - if !p.IsExpired() { - t.Errorf("Expect expired to be true before any Retrieve") - } - _, err := p.Retrieve() - if err != nil { - t.Errorf("Expect no error, got %v", err) - } - if p.IsExpired() { - t.Errorf("Expect not expired after retrieve") - } - - stubProvider.expired = true - if !p.IsExpired() { - t.Errorf("Expect return of expired provider") - } - - _, err = p.Retrieve() - if err != nil { - t.Errorf("Expect no error, got %v", err) - } - if p.IsExpired() { - t.Errorf("Expect not expired after retrieve") - } -} - -func TestChainProviderWithNoProvider(t *testing.T) { - p := &ChainProvider{ - Providers: []Provider{}, - } - - if !p.IsExpired() { - t.Errorf("Expect expired with no providers") - } - _, err := p.Retrieve() - if e, a := ErrNoValidProvidersFoundInChain, err; e != a { - t.Errorf("Expect no providers error returned, %v, got %v", e, a) - } -} - -func TestChainProviderWithNoValidProvider(t *testing.T) { - errs := []error{ - awserr.New("FirstError", "first provider error", nil), - awserr.New("SecondError", "second provider error", nil), - } - p := &ChainProvider{ - Providers: []Provider{ - &stubProvider{err: errs[0]}, - &stubProvider{err: errs[1]}, - }, - } - - if !p.IsExpired() { - t.Errorf("Expect expired with no providers") - } - _, err := p.Retrieve() - - if e, a := ErrNoValidProvidersFoundInChain, err; e != a { - t.Errorf("Expect no providers error returned, %v, got %v", e, a) - } -} - -func TestChainProviderWithNoValidProviderWithVerboseEnabled(t *testing.T) { - errs := []error{ - awserr.New("FirstError", "first provider error", nil), - awserr.New("SecondError", "second provider error", nil), - } - p := &ChainProvider{ - VerboseErrors: true, - Providers: []Provider{ - &stubProvider{err: errs[0]}, - &stubProvider{err: errs[1]}, - }, - } - - if !p.IsExpired() { - t.Errorf("Expect expired with no providers") - } - _, err := p.Retrieve() - - expectErr := awserr.NewBatchError("NoCredentialProviders", "no valid providers in chain", errs) - if e, a := expectErr, err; !reflect.DeepEqual(e, a) { - t.Errorf("Expect no providers error returned, %v, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_bench_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_bench_test.go deleted file mode 100644 index 01a5d63..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_bench_test.go +++ /dev/null @@ -1,90 +0,0 @@ -// +build go1.9 - -package credentials - -import ( - "fmt" - "strconv" - "sync" - "testing" - "time" -) - -func BenchmarkCredentials_Get(b *testing.B) { - stub := &stubProvider{} - - cases := []int{1, 10, 100, 500, 1000, 10000} - - for _, c := range cases { - b.Run(strconv.Itoa(c), func(b *testing.B) { - creds := NewCredentials(stub) - var wg sync.WaitGroup - wg.Add(c) - for i := 0; i < c; i++ { - go func() { - for j := 0; j < b.N; j++ { - v, err := creds.Get() - if err != nil { - b.Fatalf("expect no error %v, %v", v, err) - } - } - wg.Done() - }() - } - b.ResetTimer() - - wg.Wait() - }) - } -} - -func BenchmarkCredentials_Get_Expire(b *testing.B) { - p := &blockProvider{} - - expRates := []int{10000, 1000, 100} - cases := []int{1, 10, 100, 500, 1000, 10000} - - for _, expRate := range expRates { - for _, c := range cases { - b.Run(fmt.Sprintf("%d-%d", expRate, c), func(b *testing.B) { - creds := NewCredentials(p) - var wg sync.WaitGroup - wg.Add(c) - for i := 0; i < c; i++ { - go func(id int) { - for j := 0; j < b.N; j++ { - v, err := creds.Get() - if err != nil { - b.Fatalf("expect no error %v, %v", v, err) - } - // periodically expire creds to cause rwlock - if id == 0 && j%expRate == 0 { - creds.Expire() - } - } - wg.Done() - }(i) - } - b.ResetTimer() - - wg.Wait() - }) - } - } -} - -type blockProvider struct { - creds Value - expired bool - err error -} - -func (s *blockProvider) Retrieve() (Value, error) { - s.expired = false - s.creds.ProviderName = "blockProvider" - time.Sleep(time.Millisecond) - return s.creds, s.err -} -func (s *blockProvider) IsExpired() bool { - return s.expired -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go deleted file mode 100644 index 8d9c362..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go +++ /dev/null @@ -1,173 +0,0 @@ -package credentials - -import ( - "math/rand" - "sync" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -type stubProvider struct { - creds Value - expired bool - err error -} - -func (s *stubProvider) Retrieve() (Value, error) { - s.expired = false - s.creds.ProviderName = "stubProvider" - return s.creds, s.err -} -func (s *stubProvider) IsExpired() bool { - return s.expired -} - -func TestCredentialsGet(t *testing.T) { - c := NewCredentials(&stubProvider{ - creds: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - expired: true, - }) - - creds, err := c.Get() - if err != nil { - t.Errorf("Expected no error, got %v", err) - } - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("Expect access key ID to match, %v got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("Expect secret access key to match, %v got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect session token to be empty, %v", v) - } -} - -func TestCredentialsGetWithError(t *testing.T) { - c := NewCredentials(&stubProvider{err: awserr.New("provider error", "", nil), expired: true}) - - _, err := c.Get() - if e, a := "provider error", err.(awserr.Error).Code(); e != a { - t.Errorf("Expected provider error, %v got %v", e, a) - } -} - -func TestCredentialsExpire(t *testing.T) { - stub := &stubProvider{} - c := NewCredentials(stub) - - stub.expired = false - if !c.IsExpired() { - t.Errorf("Expected to start out expired") - } - c.Expire() - if !c.IsExpired() { - t.Errorf("Expected to be expired") - } - - c.forceRefresh = false - if c.IsExpired() { - t.Errorf("Expected not to be expired") - } - - stub.expired = true - if !c.IsExpired() { - t.Errorf("Expected to be expired") - } -} - -type MockProvider struct { - Expiry -} - -func (*MockProvider) Retrieve() (Value, error) { - return Value{}, nil -} - -func TestCredentialsGetWithProviderName(t *testing.T) { - stub := &stubProvider{} - - c := NewCredentials(stub) - - creds, err := c.Get() - if err != nil { - t.Errorf("Expected no error, got %v", err) - } - if e, a := creds.ProviderName, "stubProvider"; e != a { - t.Errorf("Expected provider name to match, %v got %v", e, a) - } -} - -func TestCredentialsIsExpired_Race(t *testing.T) { - creds := NewChainCredentials([]Provider{&MockProvider{}}) - - starter := make(chan struct{}) - var wg sync.WaitGroup - wg.Add(10) - for i := 0; i < 10; i++ { - go func() { - defer wg.Done() - <-starter - for i := 0; i < 100; i++ { - creds.IsExpired() - } - }() - } - close(starter) - - wg.Wait() -} - -func TestCredentialsExpiresAt_NoExpirer(t *testing.T) { - stub := &stubProvider{} - c := NewCredentials(stub) - - _, err := c.ExpiresAt() - if e, a := "ProviderNotExpirer", err.(awserr.Error).Code(); e != a { - t.Errorf("Expected provider error, %v got %v", e, a) - } -} - -type stubProviderExpirer struct { - stubProvider - expiration time.Time -} - -func (s *stubProviderExpirer) ExpiresAt() time.Time { - return s.expiration -} - -func TestCredentialsExpiresAt_HasExpirer(t *testing.T) { - stub := &stubProviderExpirer{} - c := NewCredentials(stub) - - // fetch initial credentials so that forceRefresh is set false - _, err := c.Get() - if err != nil { - t.Errorf("Unexpecte error: %v", err) - } - - stub.expiration = time.Unix(rand.Int63(), 0) - expiration, err := c.ExpiresAt() - if err != nil { - t.Errorf("Expected no error, got %v", err) - } - if stub.expiration != expiration { - t.Errorf("Expected matching expiration, %v got %v", stub.expiration, expiration) - } - - c.Expire() - expiration, err = c.ExpiresAt() - if err != nil { - t.Errorf("Expected no error, got %v", err) - } - if !expiration.IsZero() { - t.Errorf("Expected distant past expiration, got %v", expiration) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go deleted file mode 100644 index 84c99cb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go +++ /dev/null @@ -1,195 +0,0 @@ -package ec2rolecreds_test - -import ( - "fmt" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -const credsRespTmpl = `{ - "Code": "Success", - "Type": "AWS-HMAC", - "AccessKeyId" : "accessKey", - "SecretAccessKey" : "secret", - "Token" : "token", - "Expiration" : "%s", - "LastUpdated" : "2009-11-23T0:00:00Z" -}` - -const credsFailRespTmpl = `{ - "Code": "ErrorCode", - "Message": "ErrorMsg", - "LastUpdated": "2009-11-23T0:00:00Z" -}` - -func initTestServer(expireOn string, failAssume bool) *httptest.Server { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/latest/meta-data/iam/security-credentials/" { - fmt.Fprintln(w, "RoleName") - } else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" { - if failAssume { - fmt.Fprintf(w, credsFailRespTmpl) - } else { - fmt.Fprintf(w, credsRespTmpl, expireOn) - } - } else { - http.Error(w, "Not found", http.StatusNotFound) - } - })) - - return server -} - -func TestEC2RoleProvider(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z", false) - defer server.Close() - - p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("Expect no error, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("Expect access key ID to match, %v got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("Expect secret access key to match, %v got %v", e, a) - } - if e, a := "token", creds.SessionToken; e != a { - t.Errorf("Expect session token to match, %v got %v", e, a) - } -} - -func TestEC2RoleProviderFailAssume(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z", true) - defer server.Close() - - p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), - } - - creds, err := p.Retrieve() - if err == nil { - t.Errorf("Expect error") - } - - e := err.(awserr.Error) - if e, a := "ErrorCode", e.Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "ErrorMsg", e.Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := e.OrigErr(); v != nil { - t.Errorf("expect nil, got %v", v) - } - - if e, a := "", creds.AccessKeyID; e != a { - t.Errorf("Expect access key ID to match, %v got %v", e, a) - } - if e, a := "", creds.SecretAccessKey; e != a { - t.Errorf("Expect secret access key to match, %v got %v", e, a) - } - if e, a := "", creds.SessionToken; e != a { - t.Errorf("Expect session token to match, %v got %v", e, a) - } -} - -func TestEC2RoleProviderIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z", false) - defer server.Close() - - p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), - } - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - if !p.IsExpired() { - t.Errorf("Expect creds to be expired before retrieve.") - } - - _, err := p.Retrieve() - if v := err; v != nil { - t.Errorf("Expect no error, %v", err) - } - - if p.IsExpired() { - t.Errorf("Expect creds to not be expired after retrieve.") - } - - p.CurrentTime = func() time.Time { - return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - if !p.IsExpired() { - t.Errorf("Expect creds to be expired.") - } -} - -func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z", false) - defer server.Close() - - p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), - ExpiryWindow: time.Hour * 1, - } - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC) - } - - if !p.IsExpired() { - t.Errorf("Expect creds to be expired before retrieve.") - } - - _, err := p.Retrieve() - if v := err; v != nil { - t.Errorf("Expect no error, %v", err) - } - - if p.IsExpired() { - t.Errorf("Expect creds to not be expired after retrieve.") - } - - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC) - } - - if !p.IsExpired() { - t.Errorf("Expect creds to be expired.") - } -} - -func BenchmarkEC3RoleProvider(b *testing.B) { - server := initTestServer("2014-12-16T01:51:37Z", false) - defer server.Close() - - p := &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), - } - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if _, err := p.Retrieve(); err != nil { - b.Fatal(err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider_test.go deleted file mode 100644 index fceb077..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package endpointcreds_test - -import ( - "encoding/json" - "fmt" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -func TestRetrieveRefreshableCredentials(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := "/path/to/endpoint", r.URL.Path; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "application/json", r.Header.Get("Accept"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "else", r.URL.Query().Get("something"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - encoder := json.NewEncoder(w) - err := encoder.Encode(map[string]interface{}{ - "AccessKeyID": "AKID", - "SecretAccessKey": "SECRET", - "Token": "TOKEN", - "Expiration": time.Now().Add(1 * time.Hour), - }) - - if err != nil { - fmt.Println("failed to write out creds", err) - } - })) - defer server.Close() - - client := endpointcreds.NewProviderClient(*unit.Session.Config, - unit.Session.Handlers, - server.URL+"/path/to/endpoint?something=else", - ) - creds, err := client.Retrieve() - - if err != nil { - t.Errorf("expect no error, got %v", err) - } - - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if client.IsExpired() { - t.Errorf("expect not expired, was") - } - - client.(*endpointcreds.Provider).CurrentTime = func() time.Time { - return time.Now().Add(2 * time.Hour) - } - - if !client.IsExpired() { - t.Errorf("expect expired, wasn't") - } -} - -func TestRetrieveStaticCredentials(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - encoder := json.NewEncoder(w) - err := encoder.Encode(map[string]interface{}{ - "AccessKeyID": "AKID", - "SecretAccessKey": "SECRET", - }) - - if err != nil { - fmt.Println("failed to write out creds", err) - } - })) - defer server.Close() - - client := endpointcreds.NewProviderClient(*unit.Session.Config, unit.Session.Handlers, server.URL) - creds, err := client.Retrieve() - - if err != nil { - t.Errorf("expect no error, got %v", err) - } - - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect no SessionToken, got %#v", v) - } - if client.IsExpired() { - t.Errorf("expect not expired, was") - } -} - -func TestFailedRetrieveCredentials(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(400) - encoder := json.NewEncoder(w) - err := encoder.Encode(map[string]interface{}{ - "Code": "Error", - "Message": "Message", - }) - - if err != nil { - fmt.Println("failed to write error", err) - } - })) - defer server.Close() - - client := endpointcreds.NewProviderClient(*unit.Session.Config, unit.Session.Handlers, server.URL) - creds, err := client.Retrieve() - - if err == nil { - t.Errorf("expect error, got none") - } - aerr := err.(awserr.Error) - - if e, a := "CredentialsEndpointError", aerr.Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "failed to load credentials", aerr.Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - aerr = aerr.OrigErr().(awserr.Error) - if e, a := "Error", aerr.Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "Message", aerr.Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if v := creds.AccessKeyID; len(v) != 0 { - t.Errorf("expect empty, got %#v", v) - } - if v := creds.SecretAccessKey; len(v) != 0 { - t.Errorf("expect empty, got %#v", v) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %#v", v) - } - if !client.IsExpired() { - t.Errorf("expect expired, wasn't") - } -} - -func TestAuthorizationToken(t *testing.T) { - const expectAuthToken = "Basic abc123" - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := "/path/to/endpoint", r.URL.Path; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "application/json", r.Header.Get("Accept"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectAuthToken, r.Header.Get("Authorization"); e != a { - t.Fatalf("expect %v, got %v", e, a) - } - - encoder := json.NewEncoder(w) - err := encoder.Encode(map[string]interface{}{ - "AccessKeyID": "AKID", - "SecretAccessKey": "SECRET", - "Token": "TOKEN", - "Expiration": time.Now().Add(1 * time.Hour), - }) - - if err != nil { - fmt.Println("failed to write out creds", err) - } - })) - defer server.Close() - - client := endpointcreds.NewProviderClient(*unit.Session.Config, - unit.Session.Handlers, - server.URL+"/path/to/endpoint?something=else", - func(p *endpointcreds.Provider) { - p.AuthorizationToken = expectAuthToken - }, - ) - creds, err := client.Retrieve() - - if err != nil { - t.Errorf("expect no error, got %v", err) - } - - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if client.IsExpired() { - t.Errorf("expect not expired, was") - } - - client.(*endpointcreds.Provider).CurrentTime = func() time.Time { - return time.Now().Add(2 * time.Hour) - } - - if !client.IsExpired() { - t.Errorf("expect expired, wasn't") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go deleted file mode 100644 index b1a223d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package credentials - -import ( - "os" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func TestEnvProviderRetrieve(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - os.Setenv("AWS_ACCESS_KEY_ID", "access") - os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") - os.Setenv("AWS_SESSION_TOKEN", "token") - - e := EnvProvider{} - creds, err := e.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "access", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "token", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestEnvProviderIsExpired(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_ACCESS_KEY_ID", "access") - os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") - os.Setenv("AWS_SESSION_TOKEN", "token") - - e := EnvProvider{} - - if !e.IsExpired() { - t.Errorf("Expect creds to be expired before retrieve.") - } - - _, err := e.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e.IsExpired() { - t.Errorf("Expect creds to not be expired after retrieve.") - } -} - -func TestEnvProviderNoAccessKeyID(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") - - e := EnvProvider{} - _, err := e.Retrieve() - if e, a := ErrAccessKeyIDNotFound, err; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestEnvProviderNoSecretAccessKey(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_ACCESS_KEY_ID", "access") - - e := EnvProvider{} - _, err := e.Retrieve() - if e, a := ErrSecretAccessKeyNotFound, err; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestEnvProviderAlternateNames(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_ACCESS_KEY", "access") - os.Setenv("AWS_SECRET_KEY", "secret") - - e := EnvProvider{} - creds, err := e.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "access", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expected no token, %v", v) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider_test.go deleted file mode 100644 index 50b0753..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider_test.go +++ /dev/null @@ -1,569 +0,0 @@ -package processcreds_test - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "runtime" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials/processcreds" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func TestProcessProviderFromSessionCfg(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - if runtime.GOOS == "windows" { - os.Setenv("AWS_CONFIG_FILE", "testdata\\shconfig_win.ini") - } else { - os.Setenv("AWS_CONFIG_FILE", "testdata/shconfig.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "tokenDefault", creds.SessionToken; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderFromSessionWithProfileCfg(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_PROFILE", "non_expire") - if runtime.GOOS == "windows" { - os.Setenv("AWS_CONFIG_FILE", "testdata\\shconfig_win.ini") - } else { - os.Setenv("AWS_CONFIG_FILE", "testdata/shconfig.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "nonDefaultToken", creds.SessionToken; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderNotFromCredProcCfg(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_PROFILE", "not_alone") - if runtime.GOOS == "windows" { - os.Setenv("AWS_CONFIG_FILE", "testdata\\shconfig_win.ini") - } else { - os.Setenv("AWS_CONFIG_FILE", "testdata/shconfig.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "notFromCredProcAccess", creds.AccessKeyID; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "notFromCredProcSecret", creds.SecretAccessKey; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderFromSessionCrd(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - if runtime.GOOS == "windows" { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata\\shcred_win.ini") - } else { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/shcred.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "tokenDefault", creds.SessionToken; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderFromSessionWithProfileCrd(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_PROFILE", "non_expire") - if runtime.GOOS == "windows" { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata\\shcred_win.ini") - } else { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/shcred.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "nonDefaultToken", creds.SessionToken; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderNotFromCredProcCrd(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_PROFILE", "not_alone") - if runtime.GOOS == "windows" { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata\\shcred_win.ini") - } else { - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "testdata/shcred.ini") - } - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("region")}, - ) - - if err != nil { - t.Errorf("error getting session: %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Errorf("error getting credentials: %v", err) - } - - if e, a := "notFromCredProcAccess", creds.AccessKeyID; e != a { - t.Errorf("expected %v, got %v", e, a) - } - - if e, a := "notFromCredProcSecret", creds.SecretAccessKey; e != a { - t.Errorf("expected %v, got %v", e, a) - } - -} - -func TestProcessProviderBadCommand(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - creds := processcreds.NewCredentials("/bad/process") - _, err := creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderExecution { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderExecution, err) - } -} - -func TestProcessProviderMoreEmptyCommands(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - creds := processcreds.NewCredentials("") - _, err := creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderExecution { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderExecution, err) - } - -} - -func TestProcessProviderExpectErrors(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - creds := processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "malformed.json"}, - string(os.PathSeparator)))) - _, err := creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderParse { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderParse, err) - } - - creds = processcreds.NewCredentials( - fmt.Sprintf("%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "wrongversion.json"}, - string(os.PathSeparator)))) - _, err = creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderVersion { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderVersion, err) - } - - creds = processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "missingkey.json"}, - string(os.PathSeparator)))) - _, err = creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderRequired { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderRequired, err) - } - - creds = processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "missingsecret.json"}, - string(os.PathSeparator)))) - _, err = creds.Get() - if err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderRequired { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderRequired, err) - } - -} - -func TestProcessProviderTimeout(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - command := "/bin/sleep 2" - if runtime.GOOS == "windows" { - // "timeout" command does not work due to pipe redirection - command = "ping -n 2 127.0.0.1>nul" - } - - creds := processcreds.NewCredentialsTimeout( - command, - time.Duration(1)*time.Second) - if _, err := creds.Get(); err == nil || err.(awserr.Error).Code() != processcreds.ErrCodeProcessProviderExecution || err.(awserr.Error).Message() != "credential process timed out" { - t.Errorf("expected %v, got %v", processcreds.ErrCodeProcessProviderExecution, err) - } - -} - -func TestProcessProviderWithLongSessionToken(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - creds := processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "longsessiontoken.json"}, - string(os.PathSeparator)))) - v, err := creds.Get() - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - - // Text string same length as session token returned by AWS for AssumeRoleWithWebIdentity - e := "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" - if a := v.SessionToken; e != a { - t.Errorf("expected %v, got %v", e, a) - } -} - -type credentialTest struct { - Version int - AccessKeyID string `json:"AccessKeyId"` - SecretAccessKey string - Expiration string -} - -func TestProcessProviderStatic(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - // static - creds := processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "static.json"}, - string(os.PathSeparator)))) - _, err := creds.Get() - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if creds.IsExpired() { - t.Errorf("expected %v, got %v", "static credentials/not expired", "expired") - } - -} - -func TestProcessProviderNotExpired(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - // non-static, not expired - exp := &credentialTest{} - exp.Version = 1 - exp.AccessKeyID = "accesskey" - exp.SecretAccessKey = "secretkey" - exp.Expiration = time.Now().Add(1 * time.Hour).UTC().Format(time.RFC3339) - b, err := json.Marshal(exp) - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - - tmpFile, err := ioutil.TempFile(os.TempDir(), "tmp_expiring") - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if _, err = io.Copy(tmpFile, bytes.NewReader(b)); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - defer func() { - if err = tmpFile.Close(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if err = os.Remove(tmpFile.Name()); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - }() - creds := processcreds.NewCredentials( - fmt.Sprintf("%s %s", getOSCat(), tmpFile.Name())) - _, err = creds.Get() - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if creds.IsExpired() { - t.Errorf("expected %v, got %v", "not expired", "expired") - } -} - -func TestProcessProviderExpired(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - // non-static, expired - exp := &credentialTest{} - exp.Version = 1 - exp.AccessKeyID = "accesskey" - exp.SecretAccessKey = "secretkey" - exp.Expiration = time.Now().Add(-1 * time.Hour).UTC().Format(time.RFC3339) - b, err := json.Marshal(exp) - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - - tmpFile, err := ioutil.TempFile(os.TempDir(), "tmp_expired") - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if _, err = io.Copy(tmpFile, bytes.NewReader(b)); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - defer func() { - if err = tmpFile.Close(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if err = os.Remove(tmpFile.Name()); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - }() - creds := processcreds.NewCredentials( - fmt.Sprintf("%s %s", getOSCat(), tmpFile.Name())) - _, err = creds.Get() - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if !creds.IsExpired() { - t.Errorf("expected %v, got %v", "expired", "not expired") - } -} - -func TestProcessProviderForceExpire(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - // non-static, not expired - - // setup test credentials file - exp := &credentialTest{} - exp.Version = 1 - exp.AccessKeyID = "accesskey" - exp.SecretAccessKey = "secretkey" - exp.Expiration = time.Now().Add(1 * time.Hour).UTC().Format(time.RFC3339) - b, err := json.Marshal(exp) - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - tmpFile, err := ioutil.TempFile(os.TempDir(), "tmp_force_expire") - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if _, err = io.Copy(tmpFile, bytes.NewReader(b)); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - defer func() { - if err = tmpFile.Close(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if err = os.Remove(tmpFile.Name()); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - }() - - // get credentials from file - creds := processcreds.NewCredentials( - fmt.Sprintf("%s %s", getOSCat(), tmpFile.Name())) - if _, err = creds.Get(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if creds.IsExpired() { - t.Errorf("expected %v, got %v", "not expired", "expired") - } - - // force expire creds - creds.Expire() - if !creds.IsExpired() { - t.Errorf("expected %v, got %v", "expired", "not expired") - } - - // renew creds - if _, err = creds.Get(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if creds.IsExpired() { - t.Errorf("expected %v, got %v", "not expired", "expired") - } - -} - -func TestProcessProviderAltConstruct(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - // constructing with exec.Cmd instead of string - myCommand := exec.Command( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "static.json"}, - string(os.PathSeparator)))) - creds := processcreds.NewCredentialsCommand(myCommand, func(opt *processcreds.ProcessProvider) { - opt.Timeout = time.Duration(1) * time.Second - }) - _, err := creds.Get() - if err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if creds.IsExpired() { - t.Errorf("expected %v, got %v", "static credentials/not expired", "expired") - } -} - -func BenchmarkProcessProvider(b *testing.B) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - creds := processcreds.NewCredentials( - fmt.Sprintf( - "%s %s", - getOSCat(), - strings.Join( - []string{"testdata", "static.json"}, - string(os.PathSeparator)))) - _, err := creds.Get() - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err := creds.Get() - if err != nil { - b.Fatal(err) - } - } -} - -func getOSCat() string { - if runtime.GOOS == "windows" { - return "type" - } - return "cat" -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go deleted file mode 100644 index 199e690..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go +++ /dev/null @@ -1,205 +0,0 @@ -package credentials - -import ( - "os" - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func TestSharedCredentialsProvider(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "token", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSharedCredentialsProviderIsExpired(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - - if !p.IsExpired() { - t.Errorf("Expect creds to be expired before retrieve") - } - - _, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if p.IsExpired() { - t.Errorf("Expect creds to not be expired after retrieve") - } -} - -func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILE(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "example.ini") - p := SharedCredentialsProvider{} - creds, err := p.Retrieve() - - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "token", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILEAbsPath(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - wd, err := os.Getwd() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", filepath.Join(wd, "example.ini")) - p := SharedCredentialsProvider{} - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "token", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSharedCredentialsProviderWithAWS_PROFILE(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_PROFILE", "no_token") - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect no token, %v", v) - } -} - -func TestSharedCredentialsProviderWithoutTokenFromProfile(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: "no_token"} - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect no token, %v", v) - } -} - -func TestSharedCredentialsProviderColonInCredFile(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: "with_colon"} - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "accessKey", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect no token, %v", v) - } -} - -func TestSharedCredentialsProvider_DefaultFilename(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("USERPROFILE", "profile_dir") - os.Setenv("HOME", "home_dir") - - // default filename and profile - p := SharedCredentialsProvider{} - - filename, err := p.filename() - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := shareddefaults.SharedCredentialsFilename(), filename; e != a { - t.Errorf("expect %q filename, got %q", e, a) - } -} - -func BenchmarkSharedCredentialsProvider(b *testing.B) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go deleted file mode 100644 index 7dd0bc8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package credentials - -import ( - "testing" -) - -func TestStaticProviderGet(t *testing.T) { - s := StaticProvider{ - Value: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - } - - creds, err := s.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("Expect no session token, %v", v) - } -} - -func TestStaticProviderIsExpired(t *testing.T) { - s := StaticProvider{ - Value: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - } - - if s.IsExpired() { - t.Errorf("Expect static credentials to never expire") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index 2e528d1..9f37f44 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -144,6 +144,13 @@ type AssumeRoleProvider struct { // Session name, if you wish to reuse the credentials elsewhere. RoleSessionName string + // Optional, you can pass tag key-value pairs to your session. These tags are called session tags. + Tags []*sts.Tag + + // A list of keys for session tags that you want to set as transitive. + // If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. + TransitiveTagKeys []*string + // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. Duration time.Duration @@ -269,10 +276,12 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { } jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), - RoleArn: aws.String(p.RoleARN), - RoleSessionName: aws.String(p.RoleSessionName), - ExternalId: p.ExternalID, + DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), + RoleArn: aws.String(p.RoleARN), + RoleSessionName: aws.String(p.RoleSessionName), + ExternalId: p.ExternalID, + Tags: p.Tags, + TransitiveTagKeys: p.TransitiveTagKeys, } if p.Policy != nil { input.Policy = p.Policy diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go deleted file mode 100644 index 3711deb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go +++ /dev/null @@ -1,197 +0,0 @@ -package stscreds - -import ( - "fmt" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sts" -) - -type stubSTS struct { - TestInput func(*sts.AssumeRoleInput) -} - -func (s *stubSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { - if s.TestInput != nil { - s.TestInput(input) - } - expiry := time.Now().Add(60 * time.Minute) - return &sts.AssumeRoleOutput{ - Credentials: &sts.Credentials{ - // Just reflect the role arn to the provider. - AccessKeyId: input.RoleArn, - SecretAccessKey: aws.String("assumedSecretAccessKey"), - SessionToken: aws.String("assumedSessionToken"), - Expiration: &expiry, - }, - }, nil -} - -func TestAssumeRoleProvider(t *testing.T) { - stub := &stubSTS{} - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "roleARN", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSecretAccessKey", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSessionToken", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestAssumeRoleProvider_WithTokenCode(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - if e, a := "0123456789", *in.SerialNumber; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "code", *in.TokenCode; e != a { - t.Errorf("expect %v, got %v", e, a) - } - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - TokenCode: aws.String("code"), - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "roleARN", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSecretAccessKey", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSessionToken", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestAssumeRoleProvider_WithTokenProvider(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - if e, a := "0123456789", *in.SerialNumber; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "code", *in.TokenCode; e != a { - t.Errorf("expect %v, got %v", e, a) - } - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - TokenProvider: func() (string, error) { - return "code", nil - }, - } - - creds, err := p.Retrieve() - if err != nil { - t.Errorf("expect nil, got %v", err) - } - - if e, a := "roleARN", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSecretAccessKey", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assumedSessionToken", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestAssumeRoleProvider_WithTokenProviderError(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - t.Errorf("API request should not of been called") - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - TokenProvider: func() (string, error) { - return "", fmt.Errorf("error occurred") - }, - } - - creds, err := p.Retrieve() - if err == nil { - t.Errorf("expect error") - } - - if v := creds.AccessKeyID; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if v := creds.SecretAccessKey; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } -} - -func TestAssumeRoleProvider_MFAWithNoToken(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - t.Errorf("API request should not of been called") - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - } - - creds, err := p.Retrieve() - if err == nil { - t.Errorf("expect error") - } - - if v := creds.AccessKeyID; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if v := creds.SecretAccessKey; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } -} - -func BenchmarkAssumeRoleProvider(b *testing.B) { - stub := &stubSTS{} - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - if _, err := p.Retrieve(); err != nil { - b.Fatal(err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider_test.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider_test.go deleted file mode 100644 index f2d991b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider_test.go +++ /dev/null @@ -1,129 +0,0 @@ -// +build go1.7 - -package stscreds_test - -import ( - "net/http" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/stscreds" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/sts" -) - -func TestWebIdentityProviderRetrieve(t *testing.T) { - var reqCount int - cases := []struct { - name string - onSendReq func(*testing.T, *request.Request) - roleARN string - tokenFilepath string - sessionName string - expectedError error - expectedCredValue credentials.Value - }{ - { - name: "session name case", - roleARN: "arn01234567890123456789", - tokenFilepath: "testdata/token.jwt", - sessionName: "foo", - onSendReq: func(t *testing.T, r *request.Request) { - input := r.Params.(*sts.AssumeRoleWithWebIdentityInput) - if e, a := "foo", *input.RoleSessionName; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - data := r.Data.(*sts.AssumeRoleWithWebIdentityOutput) - *data = sts.AssumeRoleWithWebIdentityOutput{ - Credentials: &sts.Credentials{ - Expiration: aws.Time(time.Now()), - AccessKeyId: aws.String("access-key-id"), - SecretAccessKey: aws.String("secret-access-key"), - SessionToken: aws.String("session-token"), - }, - } - }, - expectedCredValue: credentials.Value{ - AccessKeyID: "access-key-id", - SecretAccessKey: "secret-access-key", - SessionToken: "session-token", - ProviderName: stscreds.WebIdentityProviderName, - }, - }, - { - name: "invalid token retry", - roleARN: "arn01234567890123456789", - tokenFilepath: "testdata/token.jwt", - sessionName: "foo", - onSendReq: func(t *testing.T, r *request.Request) { - input := r.Params.(*sts.AssumeRoleWithWebIdentityInput) - if e, a := "foo", *input.RoleSessionName; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - if reqCount == 0 { - r.HTTPResponse.StatusCode = 400 - r.Error = awserr.New(sts.ErrCodeInvalidIdentityTokenException, - "some error message", nil) - return - } - - data := r.Data.(*sts.AssumeRoleWithWebIdentityOutput) - *data = sts.AssumeRoleWithWebIdentityOutput{ - Credentials: &sts.Credentials{ - Expiration: aws.Time(time.Now()), - AccessKeyId: aws.String("access-key-id"), - SecretAccessKey: aws.String("secret-access-key"), - SessionToken: aws.String("session-token"), - }, - } - }, - expectedCredValue: credentials.Value{ - AccessKeyID: "access-key-id", - SecretAccessKey: "secret-access-key", - SessionToken: "session-token", - ProviderName: stscreds.WebIdentityProviderName, - }, - }, - } - - for _, c := range cases { - t.Run(c.name, func(t *testing.T) { - reqCount = 0 - - svc := sts.New(unit.Session, &aws.Config{ - Logger: t, - }) - svc.Handlers.Send.Swap(corehandlers.SendHandler.Name, request.NamedHandler{ - Name: "custom send stub handler", - Fn: func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: 200, Header: http.Header{}, - } - c.onSendReq(t, r) - reqCount++ - }, - }) - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalError.Clear() - - p := stscreds.NewWebIdentityRoleProvider(svc, c.roleARN, c.sessionName, c.tokenFilepath) - credValue, err := p.Retrieve() - if e, a := c.expectedError, err; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := c.expectedCredValue, credValue; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/address_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/address_test.go deleted file mode 100644 index b0add7c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/address_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// +build go1.7 - -package csm - -import "testing" - -func TestAddressWithDefaults(t *testing.T) { - cases := map[string]struct { - Host, Port string - Expect string - }{ - "ip": { - Host: "127.0.0.2", Port: "", Expect: "127.0.0.2:31000", - }, - "localhost": { - Host: "localhost", Port: "", Expect: "127.0.0.1:31000", - }, - "uppercase localhost": { - Host: "LOCALHOST", Port: "", Expect: "127.0.0.1:31000", - }, - "port": { - Host: "localhost", Port: "32000", Expect: "127.0.0.1:32000", - }, - "ip6": { - Host: "::1", Port: "", Expect: "[::1]:31000", - }, - "unset": { - Host: "", Port: "", Expect: "127.0.0.1:31000", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - actual := AddressWithDefaults(c.Host, c.Port) - if e, a := c.Expect, actual; e != a { - t.Errorf("expect %v, got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable_test.go deleted file mode 100644 index a7504d3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package csm - -import ( - "encoding/json" - "fmt" - "net" - "testing" -) - -func startUDPServer(done chan struct{}, fn func([]byte)) (string, error) { - addr, err := net.ResolveUDPAddr("udp", "127.0.0.1:0") - if err != nil { - return "", err - } - - conn, err := net.ListenUDP("udp", addr) - if err != nil { - return "", err - } - - buf := make([]byte, 1024) - go func() { - defer conn.Close() - - for { - select { - case <-done: - return - default: - } - - n, _, err := conn.ReadFromUDP(buf) - fn(buf[:n]) - - if err != nil { - panic(err) - } - } - }() - - return conn.LocalAddr().String(), nil -} - -func TestDifferentParams(t *testing.T) { - defer func() { - if r := recover(); r == nil { - t.Errorf("expected panic with different parameters") - } - }() - Start("clientID2", ":0") -} - -var MetricsCh = make(chan map[string]interface{}, 1) -var Done = make(chan struct{}) - -func init() { - url, err := startUDPServer(Done, func(b []byte) { - m := map[string]interface{}{} - if err := json.Unmarshal(b, &m); err != nil { - panic(fmt.Sprintf("expected no error, but received %v", err)) - } - - MetricsCh <- m - }) - - if err != nil { - panic(err) - } - - _, err = Start("clientID", url) - if err != nil { - panic(err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/example_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/example_test.go deleted file mode 100644 index 3da43dc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package csm_test - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/csm" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -func ExampleStart() { - r, err := csm.Start("clientID", ":31000") - if err != nil { - panic(fmt.Errorf("failed starting CSM: %v", err)) - } - - sess, err := session.NewSession(&aws.Config{}) - if err != nil { - panic(fmt.Errorf("failed loading session: %v", err)) - } - - r.InjectHandlers(&sess.Handlers) - - client := s3.New(sess) - client.GetObject(&s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - // Pauses monitoring - r.Pause() - client.GetObject(&s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - // Resume monitoring - r.Continue() -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan_test.go deleted file mode 100644 index 81bdb25..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package csm - -import ( - "testing" -) - -func TestMetricChanPush(t *testing.T) { - ch := newMetricChan(5) - defer close(ch.ch) - - pushed := ch.Push(metric{}) - if !pushed { - t.Errorf("expected metrics to be pushed") - } - - if e, a := 1, len(ch.ch); e != a { - t.Errorf("expected %d, but received %d", e, a) - } -} - -func TestMetricChanPauseContinue(t *testing.T) { - ch := newMetricChan(5) - defer close(ch.ch) - ch.Pause() - - if !ch.IsPaused() { - t.Errorf("expected to be paused, but did not pause properly") - } - - ch.Continue() - if ch.IsPaused() { - t.Errorf("expected to be not paused, but did not continue properly") - } - - pushed := ch.Push(metric{}) - if !pushed { - t.Errorf("expected metrics to be pushed") - } - - if e, a := 1, len(ch.ch); e != a { - t.Errorf("expected %d, but received %d", e, a) - } -} - -func TestMetricChanPushWhenPaused(t *testing.T) { - ch := newMetricChan(5) - defer close(ch.ch) - ch.Pause() - - pushed := ch.Push(metric{}) - if pushed { - t.Errorf("expected metrics to not be pushed") - } - - if e, a := 0, len(ch.ch); e != a { - t.Errorf("expected %d, but received %d", e, a) - } -} - -func TestMetricChanNonBlocking(t *testing.T) { - ch := newMetricChan(0) - defer close(ch.ch) - - pushed := ch.Push(metric{}) - if pushed { - t.Errorf("expected metrics to be not pushed") - } - - if e, a := 0, len(ch.ch); e != a { - t.Errorf("expected %d, but received %d", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_test.go deleted file mode 100644 index 7aef212..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_test.go +++ /dev/null @@ -1,106 +0,0 @@ -// +build go1.7 - -package csm - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -func TestTruncateString(t *testing.T) { - cases := map[string]struct { - Val string - Len int - Expect string - }{ - "no change": { - Val: "123456789", Len: 10, - Expect: "123456789", - }, - "max len": { - Val: "1234567890", Len: 10, - Expect: "1234567890", - }, - "too long": { - Val: "12345678901", Len: 10, - Expect: "1234567890", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - v := c.Val - actual := truncateString(&v, c.Len) - if e, a := c.Val, v; e != a { - t.Errorf("expect input value not to change, %v, %v", e, a) - } - if e, a := c.Expect, *actual; e != a { - t.Errorf("expect %v, got %v", e, a) - } - }) - } - -} - -func TestMetric_SetException(t *testing.T) { - cases := map[string]struct { - Exc metricException - Expect metric - Final bool - }{ - "aws exc": { - Exc: awsException{ - requestException{exception: "abc", message: "123"}, - }, - Expect: metric{ - AWSException: aws.String("abc"), - AWSExceptionMessage: aws.String("123"), - }, - }, - "sdk exc": { - Exc: sdkException{ - requestException{exception: "abc", message: "123"}, - }, - Expect: metric{ - SDKException: aws.String("abc"), - SDKExceptionMessage: aws.String("123"), - }, - }, - "final aws exc": { - Exc: awsException{ - requestException{exception: "abc", message: "123"}, - }, - Expect: metric{ - FinalAWSException: aws.String("abc"), - FinalAWSExceptionMessage: aws.String("123"), - }, - Final: true, - }, - "final sdk exc": { - Exc: sdkException{ - requestException{exception: "abc", message: "123"}, - }, - Expect: metric{ - FinalSDKException: aws.String("abc"), - FinalSDKExceptionMessage: aws.String("123"), - }, - Final: true, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - var m metric - if c.Final { - m.SetFinalException(c.Exc) - } else { - m.SetException(c.Exc) - } - if e, a := c.Expect, m; !reflect.DeepEqual(e, a) { - t.Errorf("expect:\n%#v\nactual:\n%#v\n", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_internal_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_internal_test.go deleted file mode 100644 index 43978d2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_internal_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package csm - -import ( - "net/http" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestMaxRetriesExceeded(t *testing.T) { - md := metadata.ClientInfo{ - Endpoint: "http://127.0.0.1", - } - - cfg := aws.Config{ - Region: aws.String("foo"), - Credentials: credentials.NewStaticCredentials("", "", ""), - } - - op := &request.Operation{} - cases := []struct { - name string - httpStatusCode int - expectedMaxRetriesValue int - expectedMetrics int - }{ - { - name: "max retry reached", - httpStatusCode: http.StatusBadGateway, - expectedMaxRetriesValue: 1, - }, - { - name: "status ok", - httpStatusCode: http.StatusOK, - expectedMaxRetriesValue: 0, - }, - } - - for _, c := range cases { - r := request.New(cfg, md, defaults.Handlers(), client.DefaultRetryer{NumMaxRetries: 2}, op, nil, nil) - reporter := newReporter("", "") - r.Handlers.Send.Clear() - reporter.InjectHandlers(&r.Handlers) - - r.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: c.httpStatusCode, - } - }) - r.Send() - - for { - m := <-reporter.metricsCh.ch - - if *m.Type != "ApiCall" { - // ignore non-ApiCall metrics since MaxRetriesExceeded is only on ApiCall events - continue - } - - if val := *m.MaxRetriesExceeded; val != c.expectedMaxRetriesValue { - t.Errorf("%s: expected %d, but received %d", c.name, c.expectedMaxRetriesValue, val) - } - - break - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_test.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_test.go deleted file mode 100644 index 00f9380..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter_test.go +++ /dev/null @@ -1,417 +0,0 @@ -// +build go1.7 - -package csm_test - -import ( - "context" - "fmt" - "net/http" - "net/http/httptest" - "sort" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/csm" - "github.com/aws/aws-sdk-go/aws/request" - v4 "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -func TestReportingMetrics(t *testing.T) { - sess := unit.Session.Copy(&aws.Config{ - SleepDelay: func(time.Duration) {}, - }) - sess.Handlers.Validate.Clear() - sess.Handlers.Sign.Clear() - sess.Handlers.Send.Clear() - - reporter := csm.Get() - if reporter == nil { - t.Errorf("expected non-nil reporter") - } - reporter.InjectHandlers(&sess.Handlers) - - cases := map[string]struct { - Request *request.Request - ExpectMetrics []map[string]interface{} - }{ - "successful request": { - Request: func() *request.Request { - md := metadata.ClientInfo{} - op := &request.Operation{Name: "OperationName"} - req := request.New(*sess.Config, md, sess.Handlers, client.DefaultRetryer{NumMaxRetries: 3}, op, nil, nil) - req.Handlers.Send.PushBack(func(r *request.Request) { - req.HTTPResponse = &http.Response{ - StatusCode: 200, - Header: http.Header{}, - } - }) - return req - }(), - ExpectMetrics: []map[string]interface{}{ - { - "Type": "ApiCallAttempt", - "HttpStatusCode": float64(200), - }, - { - "Type": "ApiCall", - "FinalHttpStatusCode": float64(200), - }, - }, - }, - "failed request, no retry": { - Request: func() *request.Request { - md := metadata.ClientInfo{} - op := &request.Operation{Name: "OperationName"} - req := request.New(*sess.Config, md, sess.Handlers, client.DefaultRetryer{NumMaxRetries: 3}, op, nil, nil) - req.Handlers.Send.PushBack(func(r *request.Request) { - req.HTTPResponse = &http.Response{ - StatusCode: 400, - Header: http.Header{}, - } - req.Retryable = aws.Bool(false) - req.Error = awserr.New("Error", "Message", nil) - }) - - return req - }(), - ExpectMetrics: []map[string]interface{}{ - { - "Type": "ApiCallAttempt", - "HttpStatusCode": float64(400), - "AwsException": "Error", - "AwsExceptionMessage": "Error: Message", - }, - { - "Type": "ApiCall", - "FinalHttpStatusCode": float64(400), - "FinalAwsException": "Error", - "FinalAwsExceptionMessage": "Error: Message", - "AttemptCount": float64(1), - }, - }, - }, - "failed request, with retry": { - Request: func() *request.Request { - md := metadata.ClientInfo{} - op := &request.Operation{Name: "OperationName"} - req := request.New(*sess.Config, md, sess.Handlers, client.DefaultRetryer{NumMaxRetries: 1}, op, nil, nil) - resps := []*http.Response{ - { - StatusCode: 500, - Header: http.Header{}, - }, - { - StatusCode: 500, - Header: http.Header{}, - }, - } - req.Handlers.Send.PushBack(func(r *request.Request) { - req.HTTPResponse = resps[0] - resps = resps[1:] - }) - - return req - }(), - ExpectMetrics: []map[string]interface{}{ - { - "Type": "ApiCallAttempt", - "HttpStatusCode": float64(500), - "AwsException": "UnknownError", - "AwsExceptionMessage": "UnknownError: unknown error", - }, - { - "Type": "ApiCallAttempt", - "HttpStatusCode": float64(500), - "AwsException": "UnknownError", - "AwsExceptionMessage": "UnknownError: unknown error", - }, - { - "Type": "ApiCall", - "FinalHttpStatusCode": float64(500), - "FinalAwsException": "UnknownError", - "FinalAwsExceptionMessage": "UnknownError: unknown error", - "AttemptCount": float64(2), - }, - }, - }, - "success request, with retry": { - Request: func() *request.Request { - md := metadata.ClientInfo{} - op := &request.Operation{Name: "OperationName"} - req := request.New(*sess.Config, md, sess.Handlers, client.DefaultRetryer{NumMaxRetries: 3}, op, nil, nil) - errs := []error{ - awserr.New("AWSError", "aws error", nil), - awserr.New("RequestError", "sdk error", nil), - nil, - } - resps := []*http.Response{ - { - StatusCode: 500, - Header: http.Header{}, - }, - { - StatusCode: 500, - Header: http.Header{}, - }, - { - StatusCode: 200, - Header: http.Header{}, - }, - } - req.Handlers.Send.PushBack(func(r *request.Request) { - req.HTTPResponse = resps[0] - resps = resps[1:] - req.Error = errs[0] - errs = errs[1:] - }) - - return req - }(), - ExpectMetrics: []map[string]interface{}{ - { - "Type": "ApiCallAttempt", - "AwsException": "AWSError", - "AwsExceptionMessage": "AWSError: aws error", - "HttpStatusCode": float64(500), - }, - { - "Type": "ApiCallAttempt", - "SdkException": "RequestError", - "SdkExceptionMessage": "RequestError: sdk error", - "HttpStatusCode": float64(500), - }, - { - "Type": "ApiCallAttempt", - "AwsException": nil, - "AwsExceptionMessage": nil, - "SdkException": nil, - "SdkExceptionMessage": nil, - "HttpStatusCode": float64(200), - }, - { - "Type": "ApiCall", - "FinalHttpStatusCode": float64(200), - "FinalAwsException": nil, - "FinalAwsExceptionMessage": nil, - "FinalSdkException": nil, - "FinalSdkExceptionMessage": nil, - "AttemptCount": float64(3), - }, - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - ctx, cancelFn := context.WithTimeout(context.Background(), time.Second) - defer cancelFn() - - c.Request.Send() - for i := 0; i < len(c.ExpectMetrics); i++ { - select { - case m := <-csm.MetricsCh: - for ek, ev := range c.ExpectMetrics[i] { - if ev == nil { - // must not be set - if _, ok := m[ek]; ok { - t.Errorf("%d, expect %v metric member, not to be set, %v", i, ek, m[ek]) - } - continue - } - if _, ok := m[ek]; !ok { - t.Errorf("%d, expect %v metric member, keys: %v", i, ek, keys(m)) - } - if e, a := ev, m[ek]; e != a { - t.Errorf("%d, expect %v:%v(%T), metric value, got %v(%T)", i, ek, e, e, a, a) - } - } - case <-ctx.Done(): - t.Errorf("timeout waiting for metrics") - return - } - } - - var extraMetrics []map[string]interface{} - Loop: - for { - select { - case m := <-csm.MetricsCh: - extraMetrics = append(extraMetrics, m) - default: - break Loop - } - } - if len(extraMetrics) != 0 { - t.Fatalf("unexpected metrics, %#v", extraMetrics) - } - }) - } -} - -type mockService struct { - *client.Client -} - -type input struct{} -type output struct{} - -func (s *mockService) Request(i input) *request.Request { - op := &request.Operation{ - Name: "foo", - HTTPMethod: "POST", - HTTPPath: "/", - } - - o := output{} - req := s.NewRequest(op, &i, &o) - return req -} - -func BenchmarkWithCSM(b *testing.B) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf("{}"))) - })) - defer server.Close() - - cfg := aws.Config{ - Endpoint: aws.String(server.URL), - } - - sess := unit.Session.Copy(&cfg) - r := csm.Get() - - r.InjectHandlers(&sess.Handlers) - - c := sess.ClientConfig("id", &cfg) - - svc := mockService{ - client.New( - *c.Config, - metadata.ClientInfo{ - ServiceName: "service", - ServiceID: "id", - SigningName: "signing", - SigningRegion: "region", - Endpoint: server.URL, - APIVersion: "0", - JSONVersion: "1.1", - TargetPrefix: "prefix", - }, - c.Handlers, - ), - } - - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - for i := 0; i < b.N; i++ { - req := svc.Request(input{}) - req.Send() - } -} - -func BenchmarkWithCSMNoUDPConnection(b *testing.B) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf("{}"))) - })) - defer server.Close() - - cfg := aws.Config{ - Endpoint: aws.String(server.URL), - } - - sess := unit.Session.Copy(&cfg) - r := csm.Get() - r.Pause() - r.InjectHandlers(&sess.Handlers) - defer r.Pause() - - c := sess.ClientConfig("id", &cfg) - - svc := mockService{ - client.New( - *c.Config, - metadata.ClientInfo{ - ServiceName: "service", - ServiceID: "id", - SigningName: "signing", - SigningRegion: "region", - Endpoint: server.URL, - APIVersion: "0", - JSONVersion: "1.1", - TargetPrefix: "prefix", - }, - c.Handlers, - ), - } - - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - for i := 0; i < b.N; i++ { - req := svc.Request(input{}) - req.Send() - } -} - -func BenchmarkWithoutCSM(b *testing.B) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf("{}"))) - })) - defer server.Close() - - cfg := aws.Config{ - Endpoint: aws.String(server.URL), - } - sess := unit.Session.Copy(&cfg) - c := sess.ClientConfig("id", &cfg) - - svc := mockService{ - client.New( - *c.Config, - metadata.ClientInfo{ - ServiceName: "service", - ServiceID: "id", - SigningName: "signing", - SigningRegion: "region", - Endpoint: server.URL, - APIVersion: "0", - JSONVersion: "1.1", - TargetPrefix: "prefix", - }, - c.Handlers, - ), - } - - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - for i := 0; i < b.N; i++ { - req := svc.Request(input{}) - req.Send() - } -} - -func keys(m map[string]interface{}) []string { - ks := make([]string, 0, len(m)) - for k := range m { - ks = append(ks, k) - } - sort.Strings(ks) - return ks -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go deleted file mode 100644 index a27cf9b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package defaults - -import ( - "fmt" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func TestHTTPCredProvider(t *testing.T) { - origFn := lookupHostFn - defer func() { lookupHostFn = origFn }() - - lookupHostFn = func(host string) ([]string, error) { - m := map[string]struct { - Addrs []string - Err error - }{ - "localhost": {Addrs: []string{"::1", "127.0.0.1"}}, - "actuallylocal": {Addrs: []string{"127.0.0.2"}}, - "notlocal": {Addrs: []string{"::1", "127.0.0.1", "192.168.1.10"}}, - "www.example.com": {Addrs: []string{"10.10.10.10"}}, - } - - h, ok := m[host] - if !ok { - t.Fatalf("unknown host in test, %v", host) - return nil, fmt.Errorf("unknown host") - } - - return h.Addrs, h.Err - } - - cases := []struct { - Host string - AuthToken string - Fail bool - }{ - {Host: "localhost", Fail: false}, - {Host: "actuallylocal", Fail: false}, - {Host: "127.0.0.1", Fail: false}, - {Host: "127.1.1.1", Fail: false}, - {Host: "[::1]", Fail: false}, - {Host: "www.example.com", Fail: true}, - {Host: "169.254.170.2", Fail: true}, - {Host: "localhost", Fail: false, AuthToken: "Basic abc123"}, - } - - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - for i, c := range cases { - u := fmt.Sprintf("http://%s/abc/123", c.Host) - os.Setenv(httpProviderEnvVar, u) - os.Setenv(httpProviderAuthorizationEnvVar, c.AuthToken) - - provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) - if provider == nil { - t.Fatalf("%d, expect provider not to be nil, but was", i) - } - - if c.Fail { - creds, err := provider.Retrieve() - if err == nil { - t.Fatalf("%d, expect error but got none", i) - } else { - aerr := err.(awserr.Error) - if e, a := "CredentialsEndpointError", aerr.Code(); e != a { - t.Errorf("%d, expect %s error code, got %s", i, e, a) - } - } - if e, a := endpointcreds.ProviderName, creds.ProviderName; e != a { - t.Errorf("%d, expect %s provider name got %s", i, e, a) - } - } else { - httpProvider := provider.(*endpointcreds.Provider) - if e, a := u, httpProvider.Client.Endpoint; e != a { - t.Errorf("%d, expect %q endpoint, got %q", i, e, a) - } - if e, a := c.AuthToken, httpProvider.AuthorizationToken; e != a { - t.Errorf("%d, expect %q auth token, got %q", i, e, a) - } - } - } -} - -func TestECSCredProvider(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - os.Setenv(shareddefaults.ECSCredsProviderEnvVar, "/abc/123") - - provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) - if provider == nil { - t.Fatalf("expect provider not to be nil, but was") - } - - httpProvider := provider.(*endpointcreds.Provider) - if httpProvider == nil { - t.Fatalf("expect provider not to be nil, but was") - } - if e, a := "http://169.254.170.2/abc/123", httpProvider.Client.Endpoint; e != a { - t.Errorf("expect %q endpoint, got %q", e, a) - } -} - -func TestDefaultEC2RoleProvider(t *testing.T) { - provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) - if provider == nil { - t.Fatalf("expect provider not to be nil, but was") - } - - ec2Provider := provider.(*ec2rolecreds.EC2RoleProvider) - if ec2Provider == nil { - t.Fatalf("expect provider not to be nil, but was") - } - if e, a := "http://169.254.169.254/latest", ec2Provider.Client.Endpoint; e != a { - t.Errorf("expect %q endpoint, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go deleted file mode 100644 index eaa5dc1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go +++ /dev/null @@ -1,1096 +0,0 @@ -// +build go1.7 - -package ec2metadata_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "path" - "reflect" - "strings" - "sync" - "sync/atomic" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -const instanceIdentityDocument = `{ - "devpayProductCodes" : null, - "marketplaceProductCodes" : [ "1abc2defghijklm3nopqrs4tu" ], - "availabilityZone" : "us-east-1d", - "privateIp" : "10.158.112.84", - "version" : "2010-08-31", - "region" : "us-east-1", - "instanceId" : "i-1234567890abcdef0", - "billingProducts" : null, - "instanceType" : "t1.micro", - "accountId" : "123456789012", - "pendingTime" : "2015-11-19T16:32:11Z", - "imageId" : "ami-5fb8c835", - "kernelId" : "aki-919dcaf8", - "ramdiskId" : null, - "architecture" : "x86_64" -}` - -const validIamInfo = `{ - "Code" : "Success", - "LastUpdated" : "2016-03-17T12:27:32Z", - "InstanceProfileArn" : "arn:aws:iam::123456789012:instance-profile/my-instance-profile", - "InstanceProfileId" : "AIPAABCDEFGHIJKLMN123" -}` - -const unsuccessfulIamInfo = `{ - "Code" : "Failed", - "LastUpdated" : "2016-03-17T12:27:32Z", - "InstanceProfileArn" : "arn:aws:iam::123456789012:instance-profile/my-instance-profile", - "InstanceProfileId" : "AIPAABCDEFGHIJKLMN123" -}` - -const ( - ttlHeader = "x-aws-ec2-metadata-token-ttl-seconds" - tokenHeader = "x-aws-ec2-metadata-token" -) - -type testType int - -const ( - SecureTestType testType = iota - InsecureTestType - BadRequestTestType - ServerErrorForTokenTestType - pageNotFoundForTokenTestType - pageNotFoundWith401TestType -) - -type testServer struct { - t *testing.T - - tokens []string - activeToken atomic.Value - data string -} - -type operationListProvider struct { - operationsPerformed []string -} - -func getTokenRequiredParams(t *testing.T, fn http.HandlerFunc) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - if e, a := "PUT", r.Method; e != a { - t.Errorf("expect %v, http method got %v", e, a) - http.Error(w, "wrong method", 400) - return - } - if len(r.Header.Get(ttlHeader)) == 0 { - t.Errorf("expect ttl header to be present in the request headers, got none") - http.Error(w, "wrong method", 400) - return - } - - fn(w, r) - } -} - -func newTestServer(t *testing.T, testType testType, testServer *testServer) *httptest.Server { - mux := http.NewServeMux() - switch testType { - case SecureTestType: - mux.HandleFunc("/latest/api/token", getTokenRequiredParams(t, testServer.secureGetTokenHandler)) - mux.HandleFunc("/latest/", testServer.secureGetLatestHandler) - case InsecureTestType: - mux.HandleFunc("/latest/api/token", testServer.insecureGetTokenHandler) - mux.HandleFunc("/latest/", testServer.insecureGetLatestHandler) - case BadRequestTestType: - mux.HandleFunc("/latest/api/token", getTokenRequiredParams(t, testServer.badRequestGetTokenHandler)) - mux.HandleFunc("/latest/", testServer.badRequestGetLatestHandler) - case ServerErrorForTokenTestType: - mux.HandleFunc("/latest/api/token", getTokenRequiredParams(t, testServer.serverErrorGetTokenHandler)) - mux.HandleFunc("/latest/", testServer.insecureGetLatestHandler) - case pageNotFoundForTokenTestType: - mux.HandleFunc("/latest/api/token", getTokenRequiredParams(t, testServer.pageNotFoundGetTokenHandler)) - mux.HandleFunc("/latest/", testServer.insecureGetLatestHandler) - case pageNotFoundWith401TestType: - mux.HandleFunc("/latest/api/token", getTokenRequiredParams(t, testServer.pageNotFoundGetTokenHandler)) - mux.HandleFunc("/latest/", testServer.unauthorizedGetLatestHandler) - - } - - return httptest.NewServer(mux) -} - -func (s *testServer) secureGetTokenHandler(w http.ResponseWriter, r *http.Request) { - token := s.tokens[0] - - // set the active token - s.activeToken.Store(token) - - // rotate the token - if len(s.tokens) > 1 { - s.tokens = s.tokens[1:] - } - - // set the header and response body - w.Header().Set(ttlHeader, r.Header.Get(ttlHeader)) - if activeToken, ok := s.activeToken.Load().(string); ok { - w.Write([]byte(activeToken)) - } else { - s.t.Fatalf("Expected activeToken to be of type string, got %v", activeToken) - } -} - -func (s *testServer) secureGetLatestHandler(w http.ResponseWriter, r *http.Request) { - if s.activeToken.Load() == nil { - s.t.Errorf("expect token to have been requested, was not") - http.Error(w, "", 401) - return - } - - if e, a := s.activeToken.Load(), r.Header.Get(tokenHeader); e != a { - s.t.Errorf("expect %v token, got %v", e, a) - http.Error(w, "", 401) - return - } - - w.Header().Set(ttlHeader, r.Header.Get(ttlHeader)) - w.Write([]byte(s.data)) -} - -func (s *testServer) insecureGetTokenHandler(w http.ResponseWriter, r *http.Request) { - http.Error(w, "", 404) -} - -func (s *testServer) insecureGetLatestHandler(w http.ResponseWriter, r *http.Request) { - if len(r.Header.Get(tokenHeader)) != 0 { - s.t.Errorf("Request token found, expected none") - http.Error(w, "", 400) - return - } - - w.Write([]byte(s.data)) -} - -func (s *testServer) badRequestGetTokenHandler(w http.ResponseWriter, r *http.Request) { - http.Error(w, "", 400) -} - -func (s *testServer) badRequestGetLatestHandler(w http.ResponseWriter, r *http.Request) { - s.t.Errorf("Expected no call to this handler, incorrect behavior found") -} - -func (s *testServer) serverErrorGetTokenHandler(w http.ResponseWriter, r *http.Request) { - http.Error(w, "", 403) -} - -func (s *testServer) pageNotFoundGetTokenHandler(w http.ResponseWriter, r *http.Request) { - http.Error(w, "Page not found error", 404) -} - -func (s *testServer) unauthorizedGetLatestHandler(w http.ResponseWriter, r *http.Request) { - http.Error(w, "", 401) -} - -func (opListProvider *operationListProvider) addToOperationPerformedList(r *request.Request) { - opListProvider.operationsPerformed = append(opListProvider.operationsPerformed, r.Operation.Name) -} - -func TestEndpoint(t *testing.T) { - c := ec2metadata.New(unit.Session) - op := &request.Operation{ - Name: "GetMetadata", - HTTPMethod: "GET", - HTTPPath: path.Join("/", "meta-data", "testpath"), - } - - req := c.NewRequest(op, nil, nil) - if e, a := "http://169.254.169.254/latest", req.ClientInfo.Endpoint; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestGetMetadata(t *testing.T) { - cases := map[string]struct { - NewServer func(t *testing.T) *httptest.Server - expectedData string - expectedError string - expectedOperationsPerformed []string - }{ - "Insecure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := InsecureTestType - Ts := &testServer{ - t: t, - data: "IMDSProfileForGoSDK", - } - return newTestServer(t, testType, Ts) - }, - expectedData: "IMDSProfileForGoSDK", - expectedOperationsPerformed: []string{"GetToken", "GetMetadata", "GetMetadata"}, - }, - "Secure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := SecureTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: "IMDSProfileForGoSDK", - } - return newTestServer(t, testType, Ts) - }, - expectedData: "IMDSProfileForGoSDK", - expectedError: "", - expectedOperationsPerformed: []string{"GetToken", "GetMetadata", "GetMetadata"}, - }, - "Bad request case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := BadRequestTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: "IMDSProfileForGoSDK", - } - return newTestServer(t, testType, Ts) - }, - expectedError: "400", - expectedOperationsPerformed: []string{"GetToken", "GetMetadata", "GetToken", "GetMetadata"}, - }, - "ServerErrorForTokenTestType": { - NewServer: func(t *testing.T) *httptest.Server { - testType := ServerErrorForTokenTestType - Ts := &testServer{ - t: t, - tokens: []string{}, - data: "IMDSProfileForGoSDK", - } - return newTestServer(t, testType, Ts) - }, - expectedData: "IMDSProfileForGoSDK", - expectedOperationsPerformed: []string{"GetToken", "GetMetadata", "GetMetadata"}, - }, - } - - for name, x := range cases { - t.Run(name, func(t *testing.T) { - - server := x.NewServer(t) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.GetMetadata("some/path") - - // token should stay alive, since default duration is 26000 seconds - resp, err = c.GetMetadata("some/path") - - if len(x.expectedError) != 0 { - if err == nil { - t.Fatalf("expect %v error, got none", x.expectedError) - } - if e, a := x.expectedError, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect %v error, got %v", e, a) - } - } else if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := x.expectedData, resp; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - - if e, a := x.expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v operations, got %v", e, a) - } - - }) - } -} - -func TestGetUserData_Error(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - reader := strings.NewReader(` - - - - 404 - Not Found - - -

404 - Not Found

- -`) - w.Header().Set("Content-Type", "text/html") - w.Header().Set("Content-Length", fmt.Sprintf("%d", reader.Len())) - w.WriteHeader(http.StatusNotFound) - io.Copy(w, reader) - })) - - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - resp, err := c.GetUserData() - if err == nil { - t.Fatalf("expect error") - } - if len(resp) != 0 { - t.Fatalf("expect empty, got %v", resp) - } - - if requestFailedError, ok := err.(awserr.RequestFailure); ok { - if e, a := http.StatusNotFound, requestFailedError.StatusCode(); e != a { - t.Fatalf("expect %v, got %v", e, a) - } - } -} - -func TestGetRegion(t *testing.T) { - cases := map[string]struct { - NewServer func(t *testing.T) *httptest.Server - expectedData string - expectedError string - expectedOperationsPerformed []string - }{ - "Insecure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := InsecureTestType - Ts := &testServer{ - t: t, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedData: "us-east-1", - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - "Secure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := SecureTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedData: "us-east-1", - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - "Bad request case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := BadRequestTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedError: "400", - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - "ServerErrorForTokenTestType": { - NewServer: func(t *testing.T) *httptest.Server { - testType := ServerErrorForTokenTestType - Ts := &testServer{ - t: t, - tokens: []string{}, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedData: "us-east-1", - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - } - - for name, x := range cases { - t.Run(name, func(t *testing.T) { - - server := x.NewServer(t) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.Region() - - if len(x.expectedError) != 0 { - if err == nil { - t.Fatalf("expect %v error, got none", x.expectedError) - } - if e, a := x.expectedError, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect %v error, got %v", e, a) - } - } else if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := x.expectedData, resp; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - - if e, a := x.expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } - }) - } -} - -func TestMetadataIAMInfo_success(t *testing.T) { - cases := map[string]struct { - NewServer func(t *testing.T) *httptest.Server - expectedData string - expectedError string - expectedOperationsPerformed []string - }{ - "Insecure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := InsecureTestType - Ts := &testServer{ - t: t, - data: validIamInfo, - } - return newTestServer(t, testType, Ts) - }, - expectedData: validIamInfo, - expectedOperationsPerformed: []string{"GetToken", "GetMetadata"}, - }, - "Secure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := SecureTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: validIamInfo, - } - return newTestServer(t, testType, Ts) - }, - expectedData: validIamInfo, - expectedOperationsPerformed: []string{"GetToken", "GetMetadata"}, - }, - } - - for name, x := range cases { - t.Run(name, func(t *testing.T) { - - server := x.NewServer(t) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - iamInfo, err := c.IAMInfo() - - if len(x.expectedError) != 0 { - if err == nil { - t.Fatalf("expect %v error, got none", x.expectedError) - } - if e, a := x.expectedError, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect %v error, got %v", e, a) - } - } else if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := "Success", iamInfo.Code; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := "arn:aws:iam::123456789012:instance-profile/my-instance-profile", iamInfo.InstanceProfileArn; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := "AIPAABCDEFGHIJKLMN123", iamInfo.InstanceProfileID; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - - if e, a := x.expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } - }) - } -} - -func TestMetadataIAMInfo_failure(t *testing.T) { - cases := map[string]struct { - NewServer func(t *testing.T) *httptest.Server - expectedData string - expectedError string - expectedOperationsPerformed []string - }{ - "Insecure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := InsecureTestType - Ts := &testServer{ - t: t, - tokens: nil, - data: unsuccessfulIamInfo, - } - return newTestServer(t, testType, Ts) - }, - expectedData: unsuccessfulIamInfo, - expectedOperationsPerformed: []string{"GetToken", "GetMetadata"}, - }, - "Secure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := SecureTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: unsuccessfulIamInfo, - } - return newTestServer(t, testType, Ts) - }, - expectedData: unsuccessfulIamInfo, - expectedOperationsPerformed: []string{"GetToken", "GetMetadata"}, - }, - } - - for name, x := range cases { - t.Run(name, func(t *testing.T) { - - server := x.NewServer(t) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - iamInfo, err := c.IAMInfo() - if err == nil { - t.Fatalf("expect error") - } - if e, a := "", iamInfo.Code; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := "", iamInfo.InstanceProfileArn; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := "", iamInfo.InstanceProfileID; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := x.expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } - }) - } -} - -func TestMetadataNotAvailable(t *testing.T) { - c := ec2metadata.New(unit.Session) - c.Handlers.Send.Clear() - c.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: int(0), - Status: http.StatusText(int(0)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - r.Error = awserr.New("RequestError", "send request failed", nil) - r.Retryable = aws.Bool(true) // network errors are retryable - }) - - if c.Available() { - t.Fatalf("expect not available") - } -} - -func TestMetadataErrorResponse(t *testing.T) { - c := ec2metadata.New(unit.Session) - c.Handlers.Send.Clear() - c.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusBadRequest, - Status: http.StatusText(http.StatusBadRequest), - Body: ioutil.NopCloser(strings.NewReader("error message text")), - } - r.Retryable = aws.Bool(false) // network errors are retryable - }) - - data, err := c.GetMetadata("uri/path") - if e, a := "error message text", err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect %v to be in %v", e, a) - } - if len(data) != 0 { - t.Fatalf("expect empty, got %v", data) - } - -} - -func TestEC2RoleProviderInstanceIdentity(t *testing.T) { - cases := map[string]struct { - NewServer func(t *testing.T) *httptest.Server - expectedData string - expectedOperationsPerformed []string - }{ - "Insecure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := InsecureTestType - Ts := &testServer{ - t: t, - tokens: nil, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedData: instanceIdentityDocument, - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - "Secure server success case": { - NewServer: func(t *testing.T) *httptest.Server { - testType := SecureTestType - Ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken", "thirdToken"}, - data: instanceIdentityDocument, - } - return newTestServer(t, testType, Ts) - }, - expectedData: instanceIdentityDocument, - expectedOperationsPerformed: []string{"GetToken", "GetDynamicData"}, - }, - } - - for name, x := range cases { - t.Run(name, func(t *testing.T) { - - server := x.NewServer(t) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - doc, err := c.GetInstanceIdentityDocument() - - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - - if e, a := doc.AccountID, "123456789012"; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := doc.AvailabilityZone, "us-east-1d"; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := doc.Region, "us-east-1"; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - if e, a := x.expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } - }) - } -} - -func TestEC2MetadataRetryFailure(t *testing.T) { - mux := http.NewServeMux() - - mux.HandleFunc("/latest/api/token", func(w http.ResponseWriter, r *http.Request) { - if r.Method == "PUT" && r.Header.Get(ttlHeader) != "" { - w.Header().Set(ttlHeader, "200") - http.Error(w, "service unavailable", http.StatusServiceUnavailable) - return - } - http.Error(w, "bad request", http.StatusBadRequest) - }) - - // meta-data endpoint for this test, just returns the token - mux.HandleFunc("/latest/meta-data/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("profile_name")) - }) - - server := httptest.NewServer(mux) - defer server.Close() - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - c.Handlers.AfterRetry.PushBack(func(i *request.Request) { - t.Logf("%v received, retrying operation %v", i.HTTPResponse.StatusCode, i.Operation.Name) - }) - c.Handlers.Complete.PushBack(func(i *request.Request) { - t.Logf("%v operation exited with status %v", i.Operation.Name, i.HTTPResponse.StatusCode) - }) - - resp, err := c.GetMetadata("some/path") - if err != nil { - t.Fatalf("Expected none, got error %v", err) - } - if resp != "profile_name" { - t.Fatalf("Expected response to be profile_name, got %v", resp) - } - - resp, err = c.GetMetadata("some/path") - if err != nil { - t.Fatalf("Expected none, got error %v", err) - } - if resp != "profile_name" { - t.Fatalf("Expected response to be profile_name, got %v", resp) - } -} - -func TestEC2MetadataRetryOnce(t *testing.T) { - var secureDataFlow bool - var retry = true - mux := http.NewServeMux() - - mux.HandleFunc("/latest/api/token", func(w http.ResponseWriter, r *http.Request) { - if r.Method == "PUT" && r.Header.Get(ttlHeader) != "" { - w.Header().Set(ttlHeader, "200") - for retry { - retry = false - http.Error(w, "service unavailable", http.StatusServiceUnavailable) - return - } - w.Write([]byte("token")) - secureDataFlow = true - return - } - http.Error(w, "bad request", http.StatusBadRequest) - }) - - // meta-data endpoint for this test, just returns the token - mux.HandleFunc("/latest/meta-data/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(r.Header.Get(tokenHeader))) - }) - - var tokenRetryCount int - - server := httptest.NewServer(mux) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - // Handler on client that logs if retried - c.Handlers.AfterRetry.PushBack(func(i *request.Request) { - t.Logf("%v received, retrying operation %v", i.HTTPResponse.StatusCode, i.Operation.Name) - tokenRetryCount++ - }) - - _, err := c.GetMetadata("some/path") - - if tokenRetryCount != 1 { - t.Fatalf("Expected number of retries for fetching token to be 1, got %v", tokenRetryCount) - } - - if !secureDataFlow { - t.Fatalf("Expected secure data flow to be %v, got %v", secureDataFlow, !secureDataFlow) - } - - if err != nil { - t.Fatalf("Expected none, got error %v", err) - } -} - -func TestEC2Metadata_Concurrency(t *testing.T) { - ts := &testServer{ - t: t, - tokens: []string{"firstToken"}, - data: "IMDSProfileForSDKGo", - } - - server := newTestServer(t, SecureTestType, ts) - defer server.Close() - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - var wg sync.WaitGroup - wg.Add(10) - for i := 0; i < 10; i++ { - go func() { - defer wg.Done() - for j := 0; j < 10; j++ { - resp, err := c.GetMetadata("some/data") - if err != nil { - t.Errorf("expect no error, got %v", err) - } - - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Errorf("expect %v, got %v", e, a) - } - } - }() - } - wg.Wait() -} - -func TestRequestOnMetadata(t *testing.T) { - ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken"}, - data: "profile_name", - } - server := newTestServer(t, SecureTestType, ts) - defer server.Close() - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - req := c.NewRequest(&request.Operation{ - Name: "Ec2Metadata request", - HTTPMethod: "GET", - HTTPPath: "/latest", - Paginator: nil, - BeforePresignFn: nil, - }, nil, nil) - - op := &operationListProvider{} - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - err := req.Send() - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if len(op.operationsPerformed) < 1 { - t.Fatalf("Expected atleast one operation GetToken to be called on EC2Metadata client") - return - } - - if op.operationsPerformed[0] != "GetToken" { - t.Fatalf("Expected GetToken operation to be called") - } - -} - -func TestExhaustiveRetryToFetchToken(t *testing.T) { - ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken"}, - data: "IMDSProfileForSDKGo", - } - - server := newTestServer(t, pageNotFoundForTokenTestType, ts) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.GetMetadata("/some/path") - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - resp, err = c.GetMetadata("/some/path") - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - resp, err = c.GetMetadata("/some/path") - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - resp, err = c.GetMetadata("/some/path") - expectedOperationsPerformed := []string{"GetToken", "GetMetadata", "GetMetadata", "GetMetadata", "GetMetadata"} - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - if e, a := expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } -} - -func TestExhaustiveRetryWith401(t *testing.T) { - ts := &testServer{ - t: t, - tokens: []string{"firstToken", "secondToken"}, - data: "IMDSProfileForSDKGo", - } - - server := newTestServer(t, pageNotFoundWith401TestType, ts) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.GetMetadata("/some/path") - if err == nil { - t.Fatalf("Expected %v error, got none", err) - } - if e, a := "", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - resp, err = c.GetMetadata("/some/path") - if err == nil { - t.Fatalf("Expected %v error, got none", err) - } - if e, a := "", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - resp, err = c.GetMetadata("/some/path") - if err == nil { - t.Fatalf("Expected %v error, got none", err) - } - if e, a := "", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - resp, err = c.GetMetadata("/some/path") - - expectedOperationsPerformed := []string{"GetToken", "GetMetadata", "GetToken", "GetMetadata", "GetToken", "GetMetadata", "GetToken", "GetMetadata"} - - if err == nil { - t.Fatalf("Expected %v error, got none", err) - } - if e, a := "", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - if e, a := expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } -} - -func TestRequestTimeOut(t *testing.T) { - mux := http.NewServeMux() - done := make(chan bool) - mux.HandleFunc("/latest/api/token", func(w http.ResponseWriter, r *http.Request) { - // wait to read from channel done - <-done - }) - - mux.HandleFunc("/latest/", func(w http.ResponseWriter, r *http.Request) { - if len(r.Header.Get(tokenHeader)) != 0 { - http.Error(w, "", 400) - return - } - w.Write([]byte("IMDSProfileForSDKGo")) - }) - - server := httptest.NewServer(mux) - defer server.Close() - defer close(done) - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - // for test, change the timeout to 100 ms - c.Config.HTTPClient.Timeout = 100 * time.Millisecond - - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.GetMetadata("/some/path") - - expectedOperationsPerformed := []string{"GetToken", "GetMetadata"} - - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - - if e, a := expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } - - resp, err = c.GetMetadata("/some/path") - - expectedOperationsPerformed = []string{"GetToken", "GetMetadata", "GetMetadata"} - - if e, a := "IMDSProfileForSDKGo", resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - - if e, a := expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } -} - -func TestTokenExpiredBehavior(t *testing.T) { - tokens := []string{"firstToken", "secondToken", "thirdToken"} - var activeToken string - mux := http.NewServeMux() - - mux.HandleFunc("/latest/api/token", func(w http.ResponseWriter, r *http.Request) { - if r.Method == "PUT" && r.Header.Get(ttlHeader) != "" { - // set ttl to 0, so TTL is expired. - w.Header().Set(ttlHeader, "0") - activeToken = tokens[0] - if len(tokens) > 1 { - tokens = tokens[1:] - } - - w.Write([]byte(activeToken)) - return - } - http.Error(w, "bad request", http.StatusBadRequest) - }) - - // meta-data endpoint for this test, just returns the token - mux.HandleFunc("/latest/meta-data/", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(ttlHeader, r.Header.Get(ttlHeader)) - w.Write([]byte(r.Header.Get(tokenHeader))) - }) - - server := httptest.NewServer(mux) - defer server.Close() - - op := &operationListProvider{} - - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - c.Handlers.Complete.PushBack(op.addToOperationPerformedList) - - resp, err := c.GetMetadata("/some/path") - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := activeToken, resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - // store the token received before - var firstToken = activeToken - - resp, err = c.GetMetadata("/some/path") - if err != nil { - t.Fatalf("Expected no error, got %v", err) - } - if e, a := activeToken, resp; e != a { - t.Fatalf("Expected %v, got %v", e, a) - } - - // Since TTL is 0, we should have received a new token - if firstToken == activeToken { - t.Fatalf("Expected token should have expired, and not the same") - } - - expectedOperationsPerformed := []string{"GetToken", "GetMetadata", "GetToken", "GetMetadata"} - - if e, a := expectedOperationsPerformed, op.operationsPerformed; !reflect.DeepEqual(e, a) { - t.Fatalf("expect %v operations, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go deleted file mode 100644 index 8e62533..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package ec2metadata_test - -import ( - "net/http" - "net/http/httptest" - "os" - "strings" - "sync" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func TestClientOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(unit.Session) - - if e, a := http.DefaultClient, svc.Config.HTTPClient; e == a { - t.Errorf("expect %v, not to equal %v", e, a) - } - - if e, a := 5*time.Second, svc.Config.HTTPClient.Timeout; e != a { - t.Errorf("expect %v to be %v", e, a) - } -} - -func TestClientNotOverrideDefaultHTTPClientTimeout(t *testing.T) { - http.DefaultClient.Transport = &http.Transport{} - defer func() { - http.DefaultClient.Transport = nil - }() - - svc := ec2metadata.New(unit.Session) - - if e, a := http.DefaultClient, svc.Config.HTTPClient; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - tr := svc.Config.HTTPClient.Transport.(*http.Transport) - if tr == nil { - t.Fatalf("expect transport not to be nil") - } - if tr.Dial != nil { - t.Errorf("expect dial to be nil, was not") - } -} - -func TestClientDisableOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(unit.Session, aws.NewConfig().WithEC2MetadataDisableTimeoutOverride(true)) - - if e, a := http.DefaultClient, svc.Config.HTTPClient; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestClientOverrideDefaultHTTPClientTimeoutRace(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("us-east-1a")) - })) - defer server.Close() - - cfg := aws.NewConfig().WithEndpoint(server.URL) - runEC2MetadataClients(t, cfg, 50) -} - -func TestClientOverrideDefaultHTTPClientTimeoutRaceWithTransport(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("us-east-1a")) - })) - defer server.Close() - - cfg := aws.NewConfig().WithEndpoint(server.URL).WithHTTPClient(&http.Client{ - Transport: &http.Transport{ - DisableKeepAlives: true, - }, - }) - - runEC2MetadataClients(t, cfg, 50) -} - -func TestClientDisableIMDS(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("AWS_EC2_METADATA_DISABLED", "true") - - svc := ec2metadata.New(unit.Session, &aws.Config{ - LogLevel: aws.LogLevel(aws.LogDebugWithHTTPBody), - }) - resp, err := svc.GetUserData() - if err == nil { - t.Fatalf("expect error, got none") - } - if len(resp) != 0 { - t.Errorf("expect no response, got %v", resp) - } - - aerr := err.(awserr.Error) - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expect %v error code, got %v", e, a) - } - if e, a := "AWS_EC2_METADATA_DISABLED", aerr.Message(); !strings.Contains(a, e) { - t.Errorf("expect %v in error message, got %v", e, a) - } -} - -func runEC2MetadataClients(t *testing.T, cfg *aws.Config, atOnce int) { - var wg sync.WaitGroup - wg.Add(atOnce) - svc := ec2metadata.New(unit.Session, cfg) - for i := 0; i < atOnce; i++ { - go func() { - defer wg.Done() - _, err := svc.GetUserData() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - }() - } - wg.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode_test.go deleted file mode 100644 index bed125c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode_test.go +++ /dev/null @@ -1,224 +0,0 @@ -package endpoints - -import ( - "strings" - "testing" -) - -func TestDecodeEndpoints_V3(t *testing.T) { - const v3Doc = ` -{ - "version": 3, - "partitions": [ - { - "defaults": { - "hostname": "{service}.{region}.{dnsSuffix}", - "protocols": [ - "https" - ], - "signatureVersions": [ - "v4" - ] - }, - "dnsSuffix": "amazonaws.com", - "partition": "aws", - "partitionName": "AWS Standard", - "regionRegex": "^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$", - "regions": { - "ap-northeast-1": { - "description": "Asia Pacific (Tokyo)" - } - }, - "services": { - "acm": { - "endpoints": { - "ap-northeast-1": {} - } - }, - "s3": { - "endpoints": { - "ap-northeast-1": {} - } - } - } - } - ] -}` - - resolver, err := DecodeModel(strings.NewReader(v3Doc)) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - - endpoint, err := resolver.EndpointFor("acm", "ap-northeast-1") - if err != nil { - t.Fatalf("failed to resolve endpoint, %v", err) - } - - if a, e := endpoint.URL, "https://acm.ap-northeast-1.amazonaws.com"; a != e { - t.Errorf("expected %q URL got %q", e, a) - } - - p := resolver.(partitions)[0] - - s3Defaults := p.Services["s3"].Defaults - if a, e := s3Defaults.HasDualStack, boxedTrue; a != e { - t.Errorf("expect s3 service to have dualstack enabled") - } - if a, e := s3Defaults.DualStackHostname, "{service}.dualstack.{region}.{dnsSuffix}"; a != e { - t.Errorf("expect s3 dualstack host pattern to be %q, got %q", e, a) - } - - ec2metaEndpoint := p.Services["ec2metadata"].Endpoints["aws-global"] - if a, e := ec2metaEndpoint.Hostname, "169.254.169.254/latest"; a != e { - t.Errorf("expect ec2metadata host to be %q, got %q", e, a) - } -} - -func TestDecodeEndpoints_NoPartitions(t *testing.T) { - const doc = `{ "version": 3 }` - - resolver, err := DecodeModel(strings.NewReader(doc)) - if err == nil { - t.Fatalf("expected error") - } - - if resolver != nil { - t.Errorf("expect resolver to be nil") - } -} - -func TestDecodeEndpoints_UnsupportedVersion(t *testing.T) { - const doc = `{ "version": 2 }` - - resolver, err := DecodeModel(strings.NewReader(doc)) - if err == nil { - t.Fatalf("expected error decoding model") - } - - if resolver != nil { - t.Errorf("expect resolver to be nil") - } -} - -func TestDecodeModelOptionsSet(t *testing.T) { - var actual DecodeModelOptions - actual.Set(func(o *DecodeModelOptions) { - o.SkipCustomizations = true - }) - - expect := DecodeModelOptions{ - SkipCustomizations: true, - } - - if actual != expect { - t.Errorf("expect %v options got %v", expect, actual) - } -} - -func TestCustFixAppAutoscalingChina(t *testing.T) { - const doc = ` -{ - "version": 3, - "partitions": [{ - "defaults" : { - "hostname" : "{service}.{region}.{dnsSuffix}", - "protocols" : [ "https" ], - "signatureVersions" : [ "v4" ] - }, - "dnsSuffix" : "amazonaws.com.cn", - "partition" : "aws-cn", - "partitionName" : "AWS China", - "regionRegex" : "^cn\\-\\w+\\-\\d+$", - "regions" : { - "cn-north-1" : { - "description" : "China (Beijing)" - }, - "cn-northwest-1" : { - "description" : "China (Ningxia)" - } - }, - "services" : { - "application-autoscaling" : { - "defaults" : { - "credentialScope" : { - "service" : "application-autoscaling" - }, - "hostname" : "autoscaling.{region}.amazonaws.com", - "protocols" : [ "http", "https" ] - }, - "endpoints" : { - "cn-north-1" : { }, - "cn-northwest-1" : { } - } - } - } - }] -}` - - resolver, err := DecodeModel(strings.NewReader(doc)) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - endpoint, err := resolver.EndpointFor( - "application-autoscaling", "cn-northwest-1", - ) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := `https://autoscaling.cn-northwest-1.amazonaws.com.cn`, endpoint.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestCustFixAppAutoscalingUsGov(t *testing.T) { - const doc = ` -{ - "version": 3, - "partitions": [{ - "defaults" : { - "hostname" : "{service}.{region}.{dnsSuffix}", - "protocols" : [ "https" ], - "signatureVersions" : [ "v4" ] - }, - "dnsSuffix" : "amazonaws.com", - "partition" : "aws-us-gov", - "partitionName" : "AWS GovCloud (US)", - "regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$", - "regions" : { - "us-gov-east-1" : { - "description" : "AWS GovCloud (US-East)" - }, - "us-gov-west-1" : { - "description" : "AWS GovCloud (US)" - } - }, - "services" : { - "application-autoscaling" : { - "endpoints" : { - "us-gov-east-1" : { }, - "us-gov-west-1" : { } - } - } - } - }] -}` - - resolver, err := DecodeModel(strings.NewReader(doc)) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - endpoint, err := resolver.EndpointFor( - "application-autoscaling", "us-gov-west-1", - ) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := `https://autoscaling.us-gov-west-1.amazonaws.com`, endpoint.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 767b2f6..6d10f9b 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -179,17 +179,47 @@ var awsPartition = partition{ "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "ca-central-1-fips": endpoint{ + Hostname: "acm-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "acm-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "acm-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "acm-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "acm-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "acm-pca": service{ @@ -209,12 +239,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "acm-pca-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "acm-pca-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "acm-pca-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "acm-pca-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "acm-pca-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "api.ecr": service{ @@ -523,6 +583,7 @@ var awsPartition = partition{ "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -667,9 +728,15 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -856,6 +923,7 @@ var awsPartition = partition{ "codecommit": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1071,8 +1139,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, @@ -1279,6 +1349,12 @@ var awsPartition = partition{ Region: "ap-southeast-2", }, }, + "ca-central-1": endpoint{ + Hostname: "rds.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1337,6 +1413,7 @@ var awsPartition = partition{ "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1854,8 +1931,10 @@ var awsPartition = partition{ "groundstation": service{ Endpoints: endpoints{ - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "eu-north-1": endpoint{}, + "me-south-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "guardduty": service{ @@ -2166,11 +2245,13 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -2179,11 +2260,20 @@ var awsPartition = partition{ "kinesisvideo": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2465,9 +2555,10 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "monitoring": service{ @@ -2505,6 +2596,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2532,6 +2624,7 @@ var awsPartition = partition{ Region: "us-west-2", }, }, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -2743,6 +2836,20 @@ var awsPartition = partition{ }, }, }, + "outposts": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "pinpoint": service{ Defaults: endpoint{ CredentialScope: credentialScope{ @@ -3062,6 +3169,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -3078,9 +3186,10 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "runtime.sagemaker": service{ @@ -3157,7 +3266,8 @@ var awsPartition = partition{ SignatureVersions: []string{"s3", "s3v4"}, }, "aws-global": endpoint{ - Hostname: "s3.amazonaws.com", + Hostname: "s3.amazonaws.com", + SignatureVersions: []string{"s3", "s3v4"}, CredentialScope: credentialScope{ Region: "us-east-1", }, @@ -3183,7 +3293,10 @@ var awsPartition = partition{ Hostname: "s3.sa-east-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, - "us-east-1": endpoint{}, + "us-east-1": endpoint{ + Hostname: "s3.us-east-1.amazonaws.com", + SignatureVersions: []string{"s3", "s3v4"}, + }, "us-east-2": endpoint{}, "us-west-1": endpoint{ Hostname: "s3.us-west-1.amazonaws.com", @@ -4579,6 +4692,13 @@ var awscnPartition = partition{ }, }, }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "sms": service{ Endpoints: endpoints{ @@ -4701,6 +4821,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "xray": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, }, } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go index 1f53d9c..ca956e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go @@ -317,7 +317,7 @@ func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) ( // Regions returns a map of Regions indexed by their ID. This is useful for // enumerating over the regions in a partition. func (p Partition) Regions() map[string]Region { - rs := map[string]Region{} + rs := make(map[string]Region, len(p.p.Regions)) for id, r := range p.p.Regions { rs[id] = Region{ id: id, @@ -332,7 +332,7 @@ func (p Partition) Regions() map[string]Region { // Services returns a map of Service indexed by their ID. This is useful for // enumerating over the services in a partition. func (p Partition) Services() map[string]Service { - ss := map[string]Service{} + ss := make(map[string]Service, len(p.p.Services)) for id := range p.p.Services { ss[id] = Service{ id: id, @@ -419,7 +419,7 @@ func (s Service) Regions() map[string]Region { // A region is the AWS region the service exists in. Whereas a Endpoint is // an URL that can be resolved to a instance of a service. func (s Service) Endpoints() map[string]Endpoint { - es := map[string]Endpoint{} + es := make(map[string]Endpoint, len(s.p.Services[s.id].Endpoints)) for id := range s.p.Services[s.id].Endpoints { es[id] = Endpoint{ id: id, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints_test.go deleted file mode 100644 index 7c56925..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints_test.go +++ /dev/null @@ -1,348 +0,0 @@ -package endpoints - -import "testing" - -func TestEnumDefaultPartitions(t *testing.T) { - resolver := DefaultResolver() - enum, ok := resolver.(EnumPartitions) - - if ok != true { - t.Fatalf("resolver must satisfy EnumPartition interface") - } - - ps := enum.Partitions() - - if a, e := len(ps), len(defaultPartitions); a != e { - t.Errorf("expected %d partitions, got %d", e, a) - } -} - -func TestEnumDefaultRegions(t *testing.T) { - expectPart := defaultPartitions[0] - partEnum := defaultPartitions[0].Partition() - - regEnum := partEnum.Regions() - - if a, e := len(regEnum), len(expectPart.Regions); a != e { - t.Errorf("expected %d regions, got %d", e, a) - } -} - -func TestEnumPartitionServices(t *testing.T) { - expectPart := testPartitions[0] - partEnum := testPartitions[0].Partition() - - if a, e := partEnum.ID(), "part-id"; a != e { - t.Errorf("expect %q partition ID, got %q", e, a) - } - - svcEnum := partEnum.Services() - - if a, e := len(svcEnum), len(expectPart.Services); a != e { - t.Errorf("expected %d regions, got %d", e, a) - } -} - -func TestEnumRegionServices(t *testing.T) { - p := testPartitions[0].Partition() - - rs := p.Regions() - - if a, e := len(rs), 2; a != e { - t.Errorf("expect %d regions got %d", e, a) - } - - if _, ok := rs["us-east-1"]; !ok { - t.Errorf("expect us-east-1 region to be found, was not") - } - if _, ok := rs["us-west-2"]; !ok { - t.Errorf("expect us-west-2 region to be found, was not") - } - - r := rs["us-east-1"] - - if a, e := r.ID(), "us-east-1"; a != e { - t.Errorf("expect %q region ID, got %q", e, a) - } - - if a, e := r.Description(), "region description"; a != e { - t.Errorf("expect %q region Description, got %q", e, a) - } - - ss := r.Services() - if a, e := len(ss), 1; a != e { - t.Errorf("expect %d services for us-east-1, got %d", e, a) - } - - if _, ok := ss["service1"]; !ok { - t.Errorf("expect service1 service to be found, was not") - } - - resolved, err := r.ResolveEndpoint("service1") - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if a, e := resolved.URL, "https://service1.us-east-1.amazonaws.com"; a != e { - t.Errorf("expect %q resolved URL, got %q", e, a) - } -} - -func TestEnumServiceRegions(t *testing.T) { - p := testPartitions[0].Partition() - - rs := p.Services()["service1"].Regions() - if e, a := 2, len(rs); e != a { - t.Errorf("expect %d regions, got %d", e, a) - } - - if _, ok := rs["us-east-1"]; !ok { - t.Errorf("expect region to be found") - } - if _, ok := rs["us-west-2"]; !ok { - t.Errorf("expect region to be found") - } -} - -func TestEnumServicesEndpoints(t *testing.T) { - p := testPartitions[0].Partition() - - ss := p.Services() - - if a, e := len(ss), 5; a != e { - t.Errorf("expect %d regions got %d", e, a) - } - - if _, ok := ss["service1"]; !ok { - t.Errorf("expect service1 region to be found, was not") - } - if _, ok := ss["service2"]; !ok { - t.Errorf("expect service2 region to be found, was not") - } - - s := ss["service1"] - if a, e := s.ID(), "service1"; a != e { - t.Errorf("expect %q service ID, got %q", e, a) - } - - resolved, err := s.ResolveEndpoint("us-west-2") - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if a, e := resolved.URL, "https://service1.us-west-2.amazonaws.com"; a != e { - t.Errorf("expect %q resolved URL, got %q", e, a) - } -} - -func TestEnumEndpoints(t *testing.T) { - p := testPartitions[0].Partition() - s := p.Services()["service1"] - - es := s.Endpoints() - if a, e := len(es), 2; a != e { - t.Errorf("expect %d endpoints for service2, got %d", e, a) - } - if _, ok := es["us-east-1"]; !ok { - t.Errorf("expect us-east-1 to be found, was not") - } - - e := es["us-east-1"] - if a, e := e.ID(), "us-east-1"; a != e { - t.Errorf("expect %q endpoint ID, got %q", e, a) - } - if a, e := e.ServiceID(), "service1"; a != e { - t.Errorf("expect %q service ID, got %q", e, a) - } - - resolved, err := e.ResolveEndpoint() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if a, e := resolved.URL, "https://service1.us-east-1.amazonaws.com"; a != e { - t.Errorf("expect %q resolved URL, got %q", e, a) - } -} - -func TestResolveEndpointForPartition(t *testing.T) { - enum := testPartitions.Partitions()[0] - - expected, err := testPartitions.EndpointFor("service1", "us-east-1") - if err != nil { - t.Fatalf("unexpected error, %v", err) - } - - actual, err := enum.EndpointFor("service1", "us-east-1") - if err != nil { - t.Fatalf("unexpected error, %v", err) - } - - if expected != actual { - t.Errorf("expect resolved endpoint to be %v, but got %v", expected, actual) - } -} - -func TestAddScheme(t *testing.T) { - cases := []struct { - In string - Expect string - DisableSSL bool - }{ - { - In: "https://example.com", - Expect: "https://example.com", - }, - { - In: "example.com", - Expect: "https://example.com", - }, - { - In: "http://example.com", - Expect: "http://example.com", - }, - { - In: "example.com", - Expect: "http://example.com", - DisableSSL: true, - }, - { - In: "https://example.com", - Expect: "https://example.com", - DisableSSL: true, - }, - } - - for i, c := range cases { - actual := AddScheme(c.In, c.DisableSSL) - if actual != c.Expect { - t.Errorf("%d, expect URL to be %q, got %q", i, c.Expect, actual) - } - } -} - -func TestResolverFunc(t *testing.T) { - var resolver Resolver - - resolver = ResolverFunc(func(s, r string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return ResolvedEndpoint{ - URL: "https://service.region.dnssuffix.com", - SigningRegion: "region", - SigningName: "service", - }, nil - }) - - resolved, err := resolver.EndpointFor("service", "region", func(o *Options) { - o.DisableSSL = true - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if a, e := resolved.URL, "https://service.region.dnssuffix.com"; a != e { - t.Errorf("expect %q endpoint URL, got %q", e, a) - } - - if a, e := resolved.SigningRegion, "region"; a != e { - t.Errorf("expect %q region, got %q", e, a) - } - if a, e := resolved.SigningName, "service"; a != e { - t.Errorf("expect %q signing name, got %q", e, a) - } -} - -func TestOptionsSet(t *testing.T) { - var actual Options - actual.Set(DisableSSLOption, UseDualStackOption, StrictMatchingOption) - - expect := Options{ - DisableSSL: true, - UseDualStack: true, - StrictMatching: true, - } - - if actual != expect { - t.Errorf("expect %v options got %v", expect, actual) - } -} - -func TestRegionsForService(t *testing.T) { - ps := DefaultPartitions() - - var expect map[string]Region - var serviceID string - for _, s := range ps[0].Services() { - expect = s.Regions() - serviceID = s.ID() - if len(expect) > 0 { - break - } - } - - actual, ok := RegionsForService(ps, ps[0].ID(), serviceID) - if !ok { - t.Fatalf("expect regions to be found, was not") - } - - if len(actual) == 0 { - t.Fatalf("expect service %s to have regions", serviceID) - } - if e, a := len(expect), len(actual); e != a { - t.Fatalf("expect %d regions, got %d", e, a) - } - - for id, r := range actual { - if e, a := id, r.ID(); e != a { - t.Errorf("expect %s region id, got %s", e, a) - } - if _, ok := expect[id]; !ok { - t.Errorf("expect %s region to be found", id) - } - if a, e := r.Description(), expect[id].desc; a != e { - t.Errorf("expect %q region Description, got %q", e, a) - } - } -} - -func TestRegionsForService_NotFound(t *testing.T) { - ps := testPartitions.Partitions() - - actual, ok := RegionsForService(ps, ps[0].ID(), "service-not-exists") - if ok { - t.Fatalf("expect no regions to be found, but were") - } - if len(actual) != 0 { - t.Errorf("expect no regions, got %v", actual) - } -} - -func TestPartitionForRegion(t *testing.T) { - ps := DefaultPartitions() - expect := ps[len(ps)%2] - - var regionID string - for id := range expect.Regions() { - regionID = id - break - } - - actual, ok := PartitionForRegion(ps, regionID) - if !ok { - t.Fatalf("expect partition to be found") - } - if e, a := expect.DNSSuffix(), actual.DNSSuffix(); e != a { - t.Errorf("expect %s partition DNSSuffix, got %s", e, a) - } - if e, a := expect.ID(), actual.ID(); e != a { - t.Errorf("expect %s partition ID, got %s", e, a) - } -} - -func TestPartitionForRegion_NotFound(t *testing.T) { - ps := DefaultPartitions() - - actual, ok := PartitionForRegion(ps, "regionNotExists") - if ok { - t.Errorf("expect no partition to be found, got %v", actual) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/example_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/example_test.go deleted file mode 100644 index 007fed2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package endpoints_test - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/sqs" -) - -func ExampleEnumPartitions() { - resolver := endpoints.DefaultResolver() - partitions := resolver.(endpoints.EnumPartitions).Partitions() - - for _, p := range partitions { - fmt.Println("Regions for", p.ID()) - for id := range p.Regions() { - fmt.Println("*", id) - } - - fmt.Println("Services for", p.ID()) - for id := range p.Services() { - fmt.Println("*", id) - } - } -} - -func ExampleResolverFunc() { - myCustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - if service == endpoints.S3ServiceID { - return endpoints.ResolvedEndpoint{ - URL: "s3.custom.endpoint.com", - SigningRegion: "custom-signing-region", - }, nil - } - - return endpoints.DefaultResolver().EndpointFor(service, region, optFns...) - } - - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String("us-west-2"), - EndpointResolver: endpoints.ResolverFunc(myCustomResolver), - })) - - // Create the S3 service client with the shared session. This will - // automatically use the S3 custom endpoint configured in the custom - // endpoint resolver wrapping the default endpoint resolver. - s3Svc := s3.New(sess) - // Operation calls will be made to the custom endpoint. - s3Svc.GetObject(&s3.GetObjectInput{ - Bucket: aws.String("myBucket"), - Key: aws.String("myObjectKey"), - }) - - // Create the SQS service client with the shared session. This will - // fallback to the default endpoint resolver because the customization - // passes any non S3 service endpoint resolve to the default resolver. - sqsSvc := sqs.New(sess) - // Operation calls will be made to the default endpoint for SQS for the - // region configured. - sqsSvc.ReceiveMessage(&sqs.ReceiveMessageInput{ - QueueUrl: aws.String("my-queue-url"), - }) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_legacy_region_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_legacy_region_test.go deleted file mode 100644 index 30745b2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_legacy_region_test.go +++ /dev/null @@ -1,792 +0,0 @@ -// +build go1.7 - -package endpoints - -import ( - "regexp" - "testing" -) - -func TestEndpointFor_STSRegionalFlag(t *testing.T) { - - // mock STS regional endpoints model - mockSTSModelPartition := partition{ - ID: "aws", - Name: "AWS Standard", - DNSSuffix: "amazonaws.com", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "ap-east-1": region{ - Description: "Asia Pacific (Hong Kong)", - }, - "ap-northeast-1": region{ - Description: "Asia Pacific (Tokyo)", - }, - "ap-northeast-2": region{ - Description: "Asia Pacific (Seoul)", - }, - "ap-south-1": region{ - Description: "Asia Pacific (Mumbai)", - }, - "ap-southeast-1": region{ - Description: "Asia Pacific (Singapore)", - }, - "ap-southeast-2": region{ - Description: "Asia Pacific (Sydney)", - }, - "ca-central-1": region{ - Description: "Canada (Central)", - }, - "eu-central-1": region{ - Description: "EU (Frankfurt)", - }, - "eu-north-1": region{ - Description: "EU (Stockholm)", - }, - "eu-west-1": region{ - Description: "EU (Ireland)", - }, - "eu-west-2": region{ - Description: "EU (London)", - }, - "eu-west-3": region{ - Description: "EU (Paris)", - }, - "me-south-1": region{ - Description: "Middle East (Bahrain)", - }, - "sa-east-1": region{ - Description: "South America (Sao Paulo)", - }, - "us-east-1": region{ - Description: "US East (N. Virginia)", - }, - "us-east-2": region{ - Description: "US East (Ohio)", - }, - "us-west-1": region{ - Description: "US West (N. California)", - }, - "us-west-2": region{ - Description: "US West (Oregon)", - }, - }, - Services: services{ - "sts": service{ - PartitionEndpoint: "aws-global", - Defaults: endpoint{}, - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "aws-global": endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-1-fips": endpoint{ - Hostname: "sts-fips.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoint{}, - "us-east-2-fips": endpoint{ - Hostname: "sts-fips.us-east-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoint{}, - "us-west-1-fips": endpoint{ - Hostname: "sts-fips.us-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoint{}, - "us-west-2-fips": endpoint{ - Hostname: "sts-fips.us-west-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-west-2", - }, - }, - }, - }, - }, - } - - // resolver for mock STS regional endpoints model - resolver := mockSTSModelPartition - - cases := map[string]struct { - service, region string - regional bool - ExpectURL, ExpectSigningMethod, ExpectSigningRegion string - ExpectSigningNameDerived bool - }{ - // STS Endpoints resolver tests : - "sts/us-west-2/regional": { - service: "sts", - region: "us-west-2", - regional: true, - ExpectURL: "https://sts.us-west-2.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-west-2", - }, - "sts/us-west-2/legacy": { - service: "sts", - region: "us-west-2", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/ap-east-1/regional": { - service: "sts", - region: "ap-east-1", - regional: true, - ExpectURL: "https://sts.ap-east-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-east-1", - }, - "sts/ap-east-1/legacy": { - service: "sts", - region: "ap-east-1", - regional: false, - ExpectURL: "https://sts.ap-east-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-east-1", - }, - "sts/us-west-2-fips/regional": { - service: "sts", - region: "us-west-2-fips", - regional: true, - ExpectURL: "https://sts-fips.us-west-2.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-west-2", - }, - "sts/us-west-2-fips/legacy": { - service: "sts", - region: "us-west-2-fips", - regional: false, - ExpectURL: "https://sts-fips.us-west-2.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-west-2", - }, - "sts/aws-global/regional": { - service: "sts", - region: "aws-global", - regional: true, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/aws-global/legacy": { - service: "sts", - region: "aws-global", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/ap-south-1/regional": { - service: "sts", - region: "ap-south-1", - regional: true, - ExpectURL: "https://sts.ap-south-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-south-1", - }, - "sts/ap-south-1/legacy": { - service: "sts", - region: "ap-south-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/ap-northeast-1/regional": { - service: "sts", - region: "ap-northeast-1", - regional: true, - ExpectURL: "https://sts.ap-northeast-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-northeast-1", - }, - "sts/ap-northeast-1/legacy": { - service: "sts", - region: "ap-northeast-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/ap-southeast-1/regional": { - service: "sts", - region: "ap-southeast-1", - regional: true, - ExpectURL: "https://sts.ap-southeast-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-southeast-1", - }, - "sts/ap-southeast-1/legacy": { - service: "sts", - region: "ap-southeast-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/ca-central-1/regional": { - service: "sts", - region: "ca-central-1", - regional: true, - ExpectURL: "https://sts.ca-central-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ca-central-1", - }, - "sts/ca-central-1/legacy": { - service: "sts", - region: "ca-central-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/eu-central-1/regional": { - service: "sts", - region: "eu-central-1", - regional: true, - ExpectURL: "https://sts.eu-central-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "eu-central-1", - }, - "sts/eu-central-1/legacy": { - service: "sts", - region: "eu-central-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/eu-north-1/regional": { - service: "sts", - region: "eu-north-1", - regional: true, - ExpectURL: "https://sts.eu-north-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "eu-north-1", - }, - "sts/eu-north-1/legacy": { - service: "sts", - region: "eu-north-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/eu-west-1/regional": { - service: "sts", - region: "eu-west-1", - regional: true, - ExpectURL: "https://sts.eu-west-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "eu-west-1", - }, - "sts/eu-west-1/legacy": { - service: "sts", - region: "eu-west-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/eu-west-2/regional": { - service: "sts", - region: "eu-west-2", - regional: true, - ExpectURL: "https://sts.eu-west-2.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "eu-west-2", - }, - "sts/eu-west-2/legacy": { - service: "sts", - region: "eu-west-2", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/eu-west-3/regional": { - service: "sts", - region: "eu-west-3", - regional: true, - ExpectURL: "https://sts.eu-west-3.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "eu-west-3", - }, - "sts/eu-west-3/legacy": { - service: "sts", - region: "eu-west-3", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/sa-east-1/regional": { - service: "sts", - region: "sa-east-1", - regional: true, - ExpectURL: "https://sts.sa-east-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "sa-east-1", - }, - "sts/sa-east-1/legacy": { - service: "sts", - region: "sa-east-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/us-east-1/regional": { - service: "sts", - region: "us-east-1", - regional: true, - ExpectURL: "https://sts.us-east-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/us-east-1/legacy": { - service: "sts", - region: "us-east-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/us-east-2/regional": { - service: "sts", - region: "us-east-2", - regional: true, - ExpectURL: "https://sts.us-east-2.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-2", - }, - "sts/us-east-2/legacy": { - service: "sts", - region: "us-east-2", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - "sts/us-west-1/regional": { - service: "sts", - region: "us-west-1", - regional: true, - ExpectURL: "https://sts.us-west-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-west-1", - }, - "sts/us-west-1/legacy": { - service: "sts", - region: "us-west-1", - regional: false, - ExpectURL: "https://sts.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "us-east-1", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - var optionSlice []func(o *Options) - optionSlice = append(optionSlice, func(o *Options) { - if c.regional { - o.STSRegionalEndpoint = RegionalSTSEndpoint - } - }) - - actual, err := resolver.EndpointFor(c.service, c.region, optionSlice...) - if err != nil { - t.Fatalf("failed to resolve endpoint, %v", err) - } - - if e, a := c.ExpectURL, actual.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningMethod, actual.SigningMethod; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningNameDerived, actual.SigningNameDerived; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningRegion, actual.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - }) - } -} - -func TestEndpointFor_S3UsEast1RegionalFlag(t *testing.T) { - - // mock S3 regional endpoints model - mockS3ModelPartition := partition{ - ID: "aws", - Name: "AWS Standard", - DNSSuffix: "amazonaws.com", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "ap-east-1": region{ - Description: "Asia Pacific (Hong Kong)", - }, - "ap-northeast-1": region{ - Description: "Asia Pacific (Tokyo)", - }, - "ap-northeast-2": region{ - Description: "Asia Pacific (Seoul)", - }, - "ap-south-1": region{ - Description: "Asia Pacific (Mumbai)", - }, - "ap-southeast-1": region{ - Description: "Asia Pacific (Singapore)", - }, - "ap-southeast-2": region{ - Description: "Asia Pacific (Sydney)", - }, - "ca-central-1": region{ - Description: "Canada (Central)", - }, - "eu-central-1": region{ - Description: "EU (Frankfurt)", - }, - "eu-north-1": region{ - Description: "EU (Stockholm)", - }, - "eu-west-1": region{ - Description: "EU (Ireland)", - }, - "eu-west-2": region{ - Description: "EU (London)", - }, - "eu-west-3": region{ - Description: "EU (Paris)", - }, - "me-south-1": region{ - Description: "Middle East (Bahrain)", - }, - "sa-east-1": region{ - Description: "South America (Sao Paulo)", - }, - "us-east-1": region{ - Description: "US East (N. Virginia)", - }, - "us-east-2": region{ - Description: "US East (Ohio)", - }, - "us-west-1": region{ - Description: "US West (N. California)", - }, - "us-west-2": region{ - Description: "US West (Oregon)", - }, - }, - Services: services{ - "s3": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedTrue, - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - Endpoints: endpoints{ - "ap-east-1": endpoint{}, - "ap-northeast-1": endpoint{ - Hostname: "s3.ap-northeast-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "ap-northeast-2": endpoint{}, - "ap-northeast-3": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{ - Hostname: "s3.ap-southeast-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "ap-southeast-2": endpoint{ - Hostname: "s3.ap-southeast-2.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "aws-global": endpoint{ - Hostname: "s3.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{ - Hostname: "s3.eu-west-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "s3-external-1": endpoint{ - Hostname: "s3-external-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "sa-east-1": endpoint{ - Hostname: "s3.sa-east-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-east-1": endpoint{ - Hostname: "s3.us-east-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{ - Hostname: "s3.us-west-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "us-west-2": endpoint{ - Hostname: "s3.us-west-2.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - }, - }, - }, - } - - // resolver for mock S3 regional endpoints model - resolver := mockS3ModelPartition - - cases := map[string]struct { - service, region string - regional S3UsEast1RegionalEndpoint - ExpectURL string - ExpectSigningRegion string - }{ - // S3 Endpoints resolver tests: - "s3/us-east-1/regional": { - service: "s3", - region: "us-east-1", - regional: RegionalS3UsEast1Endpoint, - ExpectURL: "https://s3.us-east-1.amazonaws.com", - ExpectSigningRegion: "us-east-1", - }, - "s3/us-east-1/legacy": { - service: "s3", - region: "us-east-1", - ExpectURL: "https://s3.amazonaws.com", - ExpectSigningRegion: "us-east-1", - }, - "s3/us-west-1/regional": { - service: "s3", - region: "us-west-1", - regional: RegionalS3UsEast1Endpoint, - ExpectURL: "https://s3.us-west-1.amazonaws.com", - ExpectSigningRegion: "us-west-1", - }, - "s3/us-west-1/legacy": { - service: "s3", - region: "us-west-1", - regional: RegionalS3UsEast1Endpoint, - ExpectURL: "https://s3.us-west-1.amazonaws.com", - ExpectSigningRegion: "us-west-1", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - var optionSlice []func(o *Options) - optionSlice = append(optionSlice, func(o *Options) { - o.S3UsEast1RegionalEndpoint = c.regional - }) - - actual, err := resolver.EndpointFor(c.service, c.region, optionSlice...) - if err != nil { - t.Fatalf("failed to resolve endpoint, %v", err) - } - - if e, a := c.ExpectURL, actual.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningRegion, actual.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - }) - } -} - -func TestSTSRegionalEndpoint_CNPartition(t *testing.T) { - mockSTSCNPartition := partition{ - ID: "aws-cn", - Name: "AWS China", - DNSSuffix: "amazonaws.com.cn", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^cn\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "cn-north-1": region{ - Description: "China (Beijing)", - }, - "cn-northwest-1": region{ - Description: "China (Ningxia)", - }, - }, - Services: services{ - "sts": service{ - Endpoints: endpoints{ - "cn-north-1": endpoint{}, - "cn-northwest-1": endpoint{}, - }, - }, - }, - } - - resolver := mockSTSCNPartition - - cases := map[string]struct { - service, region string - regional bool - ExpectURL, ExpectSigningMethod, ExpectSigningRegion string - ExpectSigningNameDerived bool - }{ - "sts/cn-north-1/regional": { - service: "sts", - region: "cn-north-1", - regional: true, - ExpectURL: "https://sts.cn-north-1.amazonaws.com.cn", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "cn-north-1", - }, - "sts/cn-north-1/legacy": { - service: "sts", - region: "cn-north-1", - regional: false, - ExpectURL: "https://sts.cn-north-1.amazonaws.com.cn", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "cn-north-1", - }, - } - - for name, c := range cases { - var optionSlice []func(o *Options) - t.Run(name, func(t *testing.T) { - if c.regional { - optionSlice = append(optionSlice, STSRegionalEndpointOption) - } - actual, err := resolver.EndpointFor(c.service, c.region, optionSlice...) - if err != nil { - t.Fatalf("failed to resolve endpoint, %v", err) - } - - if e, a := c.ExpectURL, actual.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.ExpectSigningMethod, actual.SigningMethod; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.ExpectSigningNameDerived, actual.SigningNameDerived; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.ExpectSigningRegion, actual.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - }) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_shared_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_shared_test.go deleted file mode 100644 index b0b00b1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_shared_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package endpoints - -import "regexp" - -var testPartitions = partitions{ - partition{ - ID: "part-id", - Name: "partitionName", - DNSSuffix: "amazonaws.com", - RegionRegex: regionRegex{ - Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$") - return reg - }(), - }, - Defaults: endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - Regions: regions{ - "us-east-1": region{ - Description: "region description", - }, - "us-west-2": region{}, - }, - Services: services{ - "s3": service{}, - "service1": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "service1", - }, - }, - Endpoints: endpoints{ - "us-east-1": {}, - "us-west-2": { - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - }, - }, - "service2": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "service2", - }, - }, - }, - "httpService": service{ - Defaults: endpoint{ - Protocols: []string{"http"}, - }, - }, - "globalService": service{ - IsRegionalized: boxedFalse, - PartitionEndpoint: "aws-global", - Endpoints: endpoints{ - "aws-global": endpoint{ - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - Hostname: "globalService.amazonaws.com", - }, - }, - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_test.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_test.go deleted file mode 100644 index 28b27ae..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_test.go +++ /dev/null @@ -1,600 +0,0 @@ -// +build go1.7 - -package endpoints - -import ( - "encoding/json" - "reflect" - "regexp" - "strings" - "testing" -) - -func TestUnmarshalRegionRegex(t *testing.T) { - var input = []byte(` -{ - "regionRegex": "^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$" -}`) - - p := partition{} - err := json.Unmarshal(input, &p) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expectRegexp, err := regexp.Compile(`^(us|eu|ap|sa|ca)\-\w+\-\d+$`) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := expectRegexp.String(), p.RegionRegex.Regexp.String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestUnmarshalRegion(t *testing.T) { - var input = []byte(` -{ - "aws-global": { - "description": "AWS partition-global endpoint" - }, - "us-east-1": { - "description": "US East (N. Virginia)" - } -}`) - - rs := regions{} - err := json.Unmarshal(input, &rs) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := 2, len(rs); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - r, ok := rs["aws-global"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := "AWS partition-global endpoint", r.Description; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - r, ok = rs["us-east-1"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := "US East (N. Virginia)", r.Description; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestUnmarshalServices(t *testing.T) { - var input = []byte(` -{ - "acm": { - "endpoints": { - "us-east-1": {} - } - }, - "apigateway": { - "isRegionalized": true, - "endpoints": { - "us-east-1": {}, - "us-west-2": {} - } - }, - "notRegionalized": { - "isRegionalized": false, - "endpoints": { - "us-east-1": {}, - "us-west-2": {} - } - } -}`) - - ss := services{} - err := json.Unmarshal(input, &ss) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := 3, len(ss); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - s, ok := ss["acm"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := 1, len(s.Endpoints); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - if e, a := boxedBoolUnset, s.IsRegionalized; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - s, ok = ss["apigateway"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := 2, len(s.Endpoints); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - if e, a := boxedTrue, s.IsRegionalized; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - s, ok = ss["notRegionalized"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := 2, len(s.Endpoints); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - if e, a := boxedFalse, s.IsRegionalized; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestUnmarshalEndpoints(t *testing.T) { - var inputs = []byte(` -{ - "aws-global": { - "hostname": "cloudfront.amazonaws.com", - "protocols": [ - "http", - "https" - ], - "signatureVersions": [ "v4" ], - "credentialScope": { - "region": "us-east-1", - "service": "serviceName" - }, - "sslCommonName": "commonName" - }, - "us-east-1": {} -}`) - - es := endpoints{} - err := json.Unmarshal(inputs, &es) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := 2, len(es); e != a { - t.Errorf("expect %v len, got %v", e, a) - } - s, ok := es["aws-global"] - if !ok { - t.Errorf("expect found, was not") - } - if e, a := "cloudfront.amazonaws.com", s.Hostname; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := []string{"http", "https"}, s.Protocols; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := []string{"v4"}, s.SignatureVersions; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := (credentialScope{"us-east-1", "serviceName"}), s.CredentialScope; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "commonName", s.SSLCommonName; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestEndpointResolve(t *testing.T) { - defs := []endpoint{ - { - Hostname: "{service}.{region}.{dnsSuffix}", - SignatureVersions: []string{"v2"}, - SSLCommonName: "sslCommonName", - }, - { - Hostname: "other-hostname", - Protocols: []string{"http"}, - CredentialScope: credentialScope{ - Region: "signing_region", - Service: "signing_service", - }, - }, - } - - e := endpoint{ - Hostname: "{service}.{region}.{dnsSuffix}", - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v4"}, - SSLCommonName: "new sslCommonName", - } - - resolved := e.resolve("service", "partitionID", "region", "dnsSuffix", - defs, Options{}, - ) - - if e, a := "https://service.region.dnsSuffix", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "signing_service", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "signing_region", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "v4", resolved.SigningMethod; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestEndpointMergeIn(t *testing.T) { - expected := endpoint{ - Hostname: "other hostname", - Protocols: []string{"http"}, - SignatureVersions: []string{"v4"}, - SSLCommonName: "ssl common name", - CredentialScope: credentialScope{ - Region: "region", - Service: "service", - }, - } - - actual := endpoint{} - actual.mergeIn(endpoint{ - Hostname: "other hostname", - Protocols: []string{"http"}, - SignatureVersions: []string{"v4"}, - SSLCommonName: "ssl common name", - CredentialScope: credentialScope{ - Region: "region", - Service: "service", - }, - }) - - if e, a := expected, actual; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestResolveEndpoint(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-west-2") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://service2.us-west-2.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-west-2", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "service2", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if resolved.SigningNameDerived { - t.Errorf("expect the signing name not to be derived, but was") - } -} - -func TestResolveEndpoint_DisableSSL(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-west-2", DisableSSLOption) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "http://service2.us-west-2.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-west-2", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "service2", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if resolved.SigningNameDerived { - t.Errorf("expect the signing name not to be derived, but was") - } -} - -func TestResolveEndpoint_UseDualStack(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service1", "us-west-2", UseDualStackOption) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://service1.dualstack.us-west-2.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-west-2", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "service1", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if resolved.SigningNameDerived { - t.Errorf("expect the signing name not to be derived, but was") - } -} - -func TestResolveEndpoint_HTTPProtocol(t *testing.T) { - resolved, err := testPartitions.EndpointFor("httpService", "us-west-2") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "http://httpService.us-west-2.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-west-2", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "httpService", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !resolved.SigningNameDerived { - t.Errorf("expect the signing name to be derived") - } -} - -func TestResolveEndpoint_UnknownService(t *testing.T) { - _, err := testPartitions.EndpointFor("unknownservice", "us-west-2") - - if err == nil { - t.Errorf("expect error, got none") - } - - _, ok := err.(UnknownServiceError) - if !ok { - t.Errorf("expect error to be UnknownServiceError") - } -} - -func TestResolveEndpoint_ResolveUnknownService(t *testing.T) { - resolved, err := testPartitions.EndpointFor("unknown-service", "us-region-1", - ResolveUnknownServiceOption) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := "https://unknown-service.us-region-1.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-region-1", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "unknown-service", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !resolved.SigningNameDerived { - t.Errorf("expect the signing name to be derived") - } -} - -func TestResolveEndpoint_UnknownMatchedRegion(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-region-1") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://service2.us-region-1.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-region-1", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "service2", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if resolved.SigningNameDerived { - t.Errorf("expect the signing name not to be derived, but was") - } -} - -func TestResolveEndpoint_UnknownRegion(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "unknownregion") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://service2.unknownregion.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "unknownregion", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "service2", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if resolved.SigningNameDerived { - t.Errorf("expect the signing name not to be derived, but was") - } -} - -func TestResolveEndpoint_StrictPartitionUnknownEndpoint(t *testing.T) { - _, err := testPartitions[0].EndpointFor("service2", "unknownregion", StrictMatchingOption) - - if err == nil { - t.Errorf("expect error, got none") - } - - _, ok := err.(UnknownEndpointError) - if !ok { - t.Errorf("expect error to be UnknownEndpointError") - } -} - -func TestResolveEndpoint_StrictPartitionsUnknownEndpoint(t *testing.T) { - _, err := testPartitions.EndpointFor("service2", "us-region-1", StrictMatchingOption) - - if err == nil { - t.Errorf("expect error, got none") - } - - _, ok := err.(UnknownEndpointError) - if !ok { - t.Errorf("expect error to be UnknownEndpointError") - } -} - -func TestResolveEndpoint_NotRegionalized(t *testing.T) { - resolved, err := testPartitions.EndpointFor("globalService", "us-west-2") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://globalService.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-east-1", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "globalService", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !resolved.SigningNameDerived { - t.Errorf("expect the signing name to be derived") - } -} - -func TestResolveEndpoint_AwsGlobal(t *testing.T) { - resolved, err := testPartitions.EndpointFor("globalService", "aws-global") - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "https://globalService.amazonaws.com", resolved.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "us-east-1", resolved.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "globalService", resolved.SigningName; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !resolved.SigningNameDerived { - t.Errorf("expect the signing name to be derived") - } -} - -func TestEndpointFor_RegionalFlag(t *testing.T) { - // AwsPartition resolver for STS regional endpoints in AWS Partition - resolver := AwsPartition() - - cases := map[string]struct { - service, region string - regional bool - ExpectURL, ExpectSigningMethod, ExpectSigningRegion string - ExpectSigningNameDerived bool - }{ - "acm/ap-northeast-1/regional": { - service: "acm", - region: "ap-northeast-1", - regional: true, - ExpectURL: "https://acm.ap-northeast-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-northeast-1", - }, - "acm/ap-northeast-1/legacy": { - service: "acm", - region: "ap-northeast-1", - regional: false, - ExpectURL: "https://acm.ap-northeast-1.amazonaws.com", - ExpectSigningMethod: "v4", - ExpectSigningNameDerived: true, - ExpectSigningRegion: "ap-northeast-1", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - var optionSlice []func(o *Options) - optionSlice = append(optionSlice, func(o *Options) { - if c.regional { - o.STSRegionalEndpoint = RegionalSTSEndpoint - } - }) - - actual, err := resolver.EndpointFor(c.service, c.region, optionSlice...) - if err != nil { - t.Fatalf("failed to resolve endpoint, %v", err) - } - - if e, a := c.ExpectURL, actual.URL; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningMethod, actual.SigningMethod; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningNameDerived, actual.SigningNameDerived; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - if e, a := c.ExpectSigningRegion, actual.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - }) - } -} - -func TestEndpointFor_EmptyRegion(t *testing.T) { - // skip this test for partitions outside `aws` partition - if DefaultPartitions()[0].id != "aws" { - t.Skip() - } - - cases := map[string]struct { - Service string - Region string - RealRegion string - ExpectErr string - }{ - // Legacy services that previous accepted empty region - "budgets": {Service: "budgets", RealRegion: "aws-global"}, - "ce": {Service: "ce", RealRegion: "aws-global"}, - "chime": {Service: "chime", RealRegion: "aws-global"}, - "ec2metadata": {Service: "ec2metadata", RealRegion: "aws-global"}, - "iam": {Service: "iam", RealRegion: "aws-global"}, - "importexport": {Service: "importexport", RealRegion: "aws-global"}, - "organizations": {Service: "organizations", RealRegion: "aws-global"}, - "route53": {Service: "route53", RealRegion: "aws-global"}, - "sts": {Service: "sts", RealRegion: "aws-global"}, - "support": {Service: "support", RealRegion: "aws-global"}, - "waf": {Service: "waf", RealRegion: "aws-global"}, - - // Other services - "s3": {Service: "s3", Region: "us-east-1", RealRegion: "us-east-1"}, - "s3 no region": {Service: "s3", ExpectErr: "could not resolve endpoint"}, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - actual, err := DefaultResolver().EndpointFor(c.Service, c.Region) - if len(c.ExpectErr) != 0 { - if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %q error in %q", e, a) - } - return - } - if err != nil { - t.Fatalf("expect no error got, %v", err) - } - - expect, err := DefaultResolver().EndpointFor(c.Service, c.RealRegion) - if err != nil { - t.Fatalf("failed to get endpoint for default resolver") - } - if e, a := expect.URL, actual.URL; e != a { - t.Errorf("expect %v URL, got %v", e, a) - } - if e, a := expect.SigningRegion, actual.SigningRegion; e != a { - t.Errorf("expect %v signing region, got %v", e, a) - } - - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_test.go deleted file mode 100644 index 1024614..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// +build go1.7 - -package request_test - -import ( - "net/http" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - v4 "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -type connResetCloser struct { - Err error -} - -func (rc *connResetCloser) Read(b []byte) (int, error) { - return 0, rc.Err -} - -func (rc *connResetCloser) Close() error { - return nil -} - -func TestSerializationErrConnectionReset_accept(t *testing.T) { - cases := map[string]struct { - Err error - ExpectAttempts int - }{ - "accept with temporary": { - Err: errAcceptConnectionResetStub, - ExpectAttempts: 6, - }, - "read not temporary": { - Err: errReadConnectionResetStub, - ExpectAttempts: 1, - }, - "write with temporary": { - Err: errWriteConnectionResetStub, - ExpectAttempts: 6, - }, - "write broken pipe with temporary": { - Err: errWriteBrokenPipeStub, - ExpectAttempts: 6, - }, - "generic connection reset": { - Err: errConnectionResetStub, - ExpectAttempts: 6, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - count := 0 - handlers := request.Handlers{} - handlers.Send.PushBack(func(r *request.Request) { - count++ - r.HTTPResponse = &http.Response{} - r.HTTPResponse.Body = &connResetCloser{ - Err: c.Err, - } - }) - - handlers.Sign.PushBackNamed(v4.SignRequestHandler) - handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) - - op := &request.Operation{ - Name: "op", - HTTPMethod: "POST", - HTTPPath: "/", - } - - meta := metadata.ClientInfo{ - ServiceName: "fooService", - SigningName: "foo", - SigningRegion: "foo", - Endpoint: "localhost", - APIVersion: "2001-01-01", - JSONVersion: "1.1", - TargetPrefix: "Foo", - } - cfg := unit.Session.Config.Copy() - cfg.MaxRetries = aws.Int(5) - cfg.SleepDelay = func(time.Duration) {} - - req := request.New( - *cfg, - meta, - handlers, - client.DefaultRetryer{NumMaxRetries: 5}, - op, - &struct{}{}, - &struct{}{}, - ) - - osErr := c.Err - req.ApplyOptions(request.WithResponseReadTimeout(time.Second)) - err := req.Send() - if err == nil { - t.Error("Expected error 'SerializationError', but received nil") - } - if aerr, ok := err.(awserr.Error); ok && aerr.Code() != request.ErrCodeSerialization { - t.Errorf("Expected 'SerializationError', but received %q", aerr.Code()) - } else if !ok { - t.Errorf("Expected 'awserr.Error', but received %v", reflect.TypeOf(err)) - } else if aerr.OrigErr().Error() != osErr.Error() { - t.Errorf("Expected %q, but received %q", osErr.Error(), aerr.OrigErr().Error()) - } - - if e, a := c.ExpectAttempts, count; e != a { - t.Errorf("Expected %v, but received %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go deleted file mode 100644 index b2da558..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go +++ /dev/null @@ -1,266 +0,0 @@ -package request_test - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestHandlerList(t *testing.T) { - s := "" - r := &request.Request{} - l := request.HandlerList{} - l.PushBack(func(r *request.Request) { - s += "a" - r.Data = s - }) - l.Run(r) - if e, a := "a", s; e != a { - t.Errorf("expect %q update got %q", e, a) - } - if e, a := "a", r.Data.(string); e != a { - t.Errorf("expect %q data update got %q", e, a) - } -} - -func TestMultipleHandlers(t *testing.T) { - r := &request.Request{} - l := request.HandlerList{} - l.PushBack(func(r *request.Request) { r.Data = nil }) - l.PushFront(func(r *request.Request) { r.Data = aws.Bool(true) }) - l.Run(r) - if r.Data != nil { - t.Error("Expected handler to execute") - } -} - -func TestNamedHandlers(t *testing.T) { - l := request.HandlerList{} - named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) {}} - named2 := request.NamedHandler{Name: "NotName", Fn: func(r *request.Request) {}} - l.PushBackNamed(named) - l.PushBackNamed(named) - l.PushBackNamed(named2) - l.PushBack(func(r *request.Request) {}) - if e, a := 4, l.Len(); e != a { - t.Errorf("expect %d list length, got %d", e, a) - } - l.Remove(named) - if e, a := 2, l.Len(); e != a { - t.Errorf("expect %d list length, got %d", e, a) - } -} - -func TestSwapHandlers(t *testing.T) { - firstHandlerCalled := 0 - swappedOutHandlerCalled := 0 - swappedInHandlerCalled := 0 - - l := request.HandlerList{} - named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) { - firstHandlerCalled++ - }} - named2 := request.NamedHandler{Name: "SwapOutName", Fn: func(r *request.Request) { - swappedOutHandlerCalled++ - }} - l.PushBackNamed(named) - l.PushBackNamed(named2) - l.PushBackNamed(named) - - l.SwapNamed(request.NamedHandler{Name: "SwapOutName", Fn: func(r *request.Request) { - swappedInHandlerCalled++ - }}) - - l.Run(&request.Request{}) - - if e, a := 2, firstHandlerCalled; e != a { - t.Errorf("expect first handler to be called %d, was called %d times", e, a) - } - if n := swappedOutHandlerCalled; n != 0 { - t.Errorf("expect swapped out handler to not be called, was called %d times", n) - } - if e, a := 1, swappedInHandlerCalled; e != a { - t.Errorf("expect swapped in handler to be called %d, was called %d times", e, a) - } -} - -func TestSetBackNamed_Exists(t *testing.T) { - firstHandlerCalled := 0 - swappedOutHandlerCalled := 0 - swappedInHandlerCalled := 0 - - l := request.HandlerList{} - named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) { - firstHandlerCalled++ - }} - named2 := request.NamedHandler{Name: "SwapOutName", Fn: func(r *request.Request) { - swappedOutHandlerCalled++ - }} - l.PushBackNamed(named) - l.PushBackNamed(named2) - - l.SetBackNamed(request.NamedHandler{Name: "SwapOutName", Fn: func(r *request.Request) { - swappedInHandlerCalled++ - }}) - - l.Run(&request.Request{}) - - if e, a := 1, firstHandlerCalled; e != a { - t.Errorf("expect first handler to be called %d, was called %d times", e, a) - } - if n := swappedOutHandlerCalled; n != 0 { - t.Errorf("expect swapped out handler to not be called, was called %d times", n) - } - if e, a := 1, swappedInHandlerCalled; e != a { - t.Errorf("expect swapped in handler to be called %d, was called %d times", e, a) - } -} - -func TestSetBackNamed_NotExists(t *testing.T) { - firstHandlerCalled := 0 - secondHandlerCalled := 0 - swappedInHandlerCalled := 0 - - l := request.HandlerList{} - named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) { - firstHandlerCalled++ - }} - named2 := request.NamedHandler{Name: "OtherName", Fn: func(r *request.Request) { - secondHandlerCalled++ - }} - l.PushBackNamed(named) - l.PushBackNamed(named2) - - l.SetBackNamed(request.NamedHandler{Name: "SwapOutName", Fn: func(r *request.Request) { - swappedInHandlerCalled++ - }}) - - l.Run(&request.Request{}) - - if e, a := 1, firstHandlerCalled; e != a { - t.Errorf("expect first handler to be called %d, was called %d times", e, a) - } - if e, a := 1, secondHandlerCalled; e != a { - t.Errorf("expect second handler to be called %d, was called %d times", e, a) - } - if e, a := 1, swappedInHandlerCalled; e != a { - t.Errorf("expect swapped in handler to be called %d, was called %d times", e, a) - } -} - -func TestLoggedHandlers(t *testing.T) { - expectedHandlers := []string{"name1", "name2"} - l := request.HandlerList{} - loggedHandlers := []string{} - l.AfterEachFn = request.HandlerListLogItem - cfg := aws.Config{Logger: aws.LoggerFunc(func(args ...interface{}) { - loggedHandlers = append(loggedHandlers, args[2].(string)) - })} - - named1 := request.NamedHandler{Name: "name1", Fn: func(r *request.Request) {}} - named2 := request.NamedHandler{Name: "name2", Fn: func(r *request.Request) {}} - l.PushBackNamed(named1) - l.PushBackNamed(named2) - l.Run(&request.Request{Config: cfg}) - - if !reflect.DeepEqual(expectedHandlers, loggedHandlers) { - t.Errorf("expect handlers executed %v to match logged handlers, %v", - expectedHandlers, loggedHandlers) - } -} - -func TestStopHandlers(t *testing.T) { - l := request.HandlerList{} - stopAt := 1 - l.AfterEachFn = func(item request.HandlerListRunItem) bool { - return item.Index != stopAt - } - - called := 0 - l.PushBackNamed(request.NamedHandler{Name: "name1", Fn: func(r *request.Request) { - called++ - }}) - l.PushBackNamed(request.NamedHandler{Name: "name2", Fn: func(r *request.Request) { - called++ - }}) - l.PushBackNamed(request.NamedHandler{Name: "name3", Fn: func(r *request.Request) { - t.Fatalf("third handler should not be called") - }}) - l.Run(&request.Request{}) - - if e, a := 2, called; e != a { - t.Errorf("expect %d handlers called, got %d", e, a) - } -} - -func BenchmarkNewRequest(b *testing.B) { - svc := s3.New(unit.Session) - - for i := 0; i < b.N; i++ { - r, _ := svc.GetObjectRequest(nil) - if r == nil { - b.Fatal("r should not be nil") - } - } -} - -func BenchmarkHandlersCopy(b *testing.B) { - handlers := request.Handlers{} - - handlers.Validate.PushBack(func(r *request.Request) {}) - handlers.Validate.PushBack(func(r *request.Request) {}) - handlers.Build.PushBack(func(r *request.Request) {}) - handlers.Build.PushBack(func(r *request.Request) {}) - handlers.Send.PushBack(func(r *request.Request) {}) - handlers.Send.PushBack(func(r *request.Request) {}) - handlers.Unmarshal.PushBack(func(r *request.Request) {}) - handlers.Unmarshal.PushBack(func(r *request.Request) {}) - - for i := 0; i < b.N; i++ { - h := handlers.Copy() - if e, a := handlers.Validate.Len(), h.Validate.Len(); e != a { - b.Fatalf("expected %d handlers got %d", e, a) - } - } -} - -func BenchmarkHandlersPushBack(b *testing.B) { - handlers := request.Handlers{} - - for i := 0; i < b.N; i++ { - h := handlers.Copy() - h.Validate.PushBack(func(r *request.Request) {}) - h.Validate.PushBack(func(r *request.Request) {}) - h.Validate.PushBack(func(r *request.Request) {}) - h.Validate.PushBack(func(r *request.Request) {}) - } -} - -func BenchmarkHandlersPushFront(b *testing.B) { - handlers := request.Handlers{} - - for i := 0; i < b.N; i++ { - h := handlers.Copy() - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - } -} - -func BenchmarkHandlersClear(b *testing.B) { - handlers := request.Handlers{} - - for i := 0; i < b.N; i++ { - h := handlers.Copy() - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - h.Validate.PushFront(func(r *request.Request) {}) - h.Clear() - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_copy_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_copy_test.go deleted file mode 100644 index 4a4f855..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_copy_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package request - -import ( - "bytes" - "io/ioutil" - "net/http" - "net/url" - "sync" - "testing" -) - -func TestRequestCopyRace(t *testing.T) { - origReq := &http.Request{URL: &url.URL{}, Header: http.Header{}} - origReq.Header.Set("Header", "OrigValue") - - var wg sync.WaitGroup - for i := 0; i < 100; i++ { - wg.Add(1) - go func() { - req := copyHTTPRequest(origReq, ioutil.NopCloser(&bytes.Buffer{})) - req.Header.Set("Header", "Value") - go func() { - req2 := copyHTTPRequest(req, ioutil.NopCloser(&bytes.Buffer{})) - req2.Header.Add("Header", "Value2") - }() - _ = req.Header.Get("Header") - wg.Done() - }() - _ = origReq.Header.Get("Header") - } - origReq.Header.Get("Header") - - wg.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go deleted file mode 100644 index 52f8957..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package request_test - -import ( - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/mock" -) - -func TestRequestCancelRetry(t *testing.T) { - c := make(chan struct{}) - reqNum := 0 - s := mock.NewMockClient(&aws.Config{ - MaxRetries: aws.Int(1), - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.Clear() - s.Handlers.UnmarshalMeta.Clear() - s.Handlers.UnmarshalError.Clear() - s.Handlers.Send.PushFront(func(r *request.Request) { - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - r.HTTPRequest.Cancel = c - close(c) - - err := r.Send() - if !strings.Contains(err.Error(), "canceled") { - t.Errorf("expect canceled in error, %v", err) - } - if e, a := 1, reqNum; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader_test.go deleted file mode 100644 index 979619f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader_test.go +++ /dev/null @@ -1,189 +0,0 @@ -package request - -import ( - "bytes" - "io" - "math/rand" - "sync" - "testing" - "time" - - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -func TestOffsetReaderRead(t *testing.T) { - buf := []byte("testData") - reader := &offsetReader{buf: bytes.NewReader(buf)} - - tempBuf := make([]byte, len(buf)) - - n, err := reader.Read(tempBuf) - - if e, a := n, len(buf); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := buf, tempBuf; !bytes.Equal(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestOffsetReaderSeek(t *testing.T) { - buf := []byte("testData") - reader, err := newOffsetReader(bytes.NewReader(buf), 0) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - orig, err := reader.Seek(0, sdkio.SeekCurrent) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(0), orig; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - n, err := reader.Seek(0, sdkio.SeekEnd) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(len(buf)), n; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - n, err = reader.Seek(orig, sdkio.SeekStart) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(0), n; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestOffsetReaderClose(t *testing.T) { - buf := []byte("testData") - reader := &offsetReader{buf: bytes.NewReader(buf)} - - err := reader.Close() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - tempBuf := make([]byte, len(buf)) - n, err := reader.Read(tempBuf) - if e, a := n, 0; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := err, io.EOF; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestOffsetReaderCloseAndCopy(t *testing.T) { - buf := []byte("testData") - tempBuf := make([]byte, len(buf)) - reader := &offsetReader{buf: bytes.NewReader(buf)} - - newReader, err := reader.CloseAndCopy(0) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - n, err := reader.Read(tempBuf) - if e, a := n, 0; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := err, io.EOF; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - n, err = newReader.Read(tempBuf) - if e, a := n, len(buf); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := buf, tempBuf; !bytes.Equal(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestOffsetReaderCloseAndCopyOffset(t *testing.T) { - buf := []byte("testData") - tempBuf := make([]byte, len(buf)) - reader := &offsetReader{buf: bytes.NewReader(buf)} - - newReader, err := reader.CloseAndCopy(4) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - n, err := newReader.Read(tempBuf) - if e, a := n, len(buf)-4; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expected := []byte{'D', 'a', 't', 'a', 0, 0, 0, 0} - if e, a := expected, tempBuf; !bytes.Equal(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestOffsetReaderRace(t *testing.T) { - wg := sync.WaitGroup{} - - f := func(reader *offsetReader) { - defer wg.Done() - var err error - buf := make([]byte, 1) - _, err = reader.Read(buf) - for err != io.EOF { - _, err = reader.Read(buf) - } - - } - - closeFn := func(reader *offsetReader) { - defer wg.Done() - time.Sleep(time.Duration(rand.Intn(20)+1) * time.Millisecond) - reader.Close() - } - for i := 0; i < 50; i++ { - reader := &offsetReader{buf: bytes.NewReader(make([]byte, 1024*1024))} - wg.Add(1) - go f(reader) - wg.Add(1) - go closeFn(reader) - } - wg.Wait() -} - -func BenchmarkOffsetReader(b *testing.B) { - bufSize := 1024 * 1024 * 100 - buf := make([]byte, bufSize) - reader := &offsetReader{buf: bytes.NewReader(buf)} - - tempBuf := make([]byte, 1024) - - for i := 0; i < b.N; i++ { - reader.Read(tempBuf) - } -} - -func BenchmarkBytesReader(b *testing.B) { - bufSize := 1024 * 1024 * 100 - buf := make([]byte, bufSize) - reader := bytes.NewReader(buf) - - tempBuf := make([]byte, 1024) - - for i := 0; i < b.N; i++ { - reader.Read(tempBuf) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_5_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_5_test.go deleted file mode 100644 index 91b4e7b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_5_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !go1.6 - -package request_test - -import ( - "errors" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -var errTimeout = awserr.New("foo", "bar", errors.New("net/http: request canceled Timeout")) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go deleted file mode 100644 index 5d0d349..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_6_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// +build go1.6 - -package request_test - -import ( - "errors" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/request" -) - -// go version 1.4 and 1.5 do not return an error. Version 1.5 will url encode -// the uri while 1.4 will not -func TestRequestInvalidEndpoint(t *testing.T) { - endpoint := "http://localhost:90 " - - r := request.New( - aws.Config{}, - metadata.ClientInfo{Endpoint: endpoint}, - defaults.Handlers(), - client.DefaultRetryer{}, - &request.Operation{}, - nil, - nil, - ) - - if r.Error == nil { - t.Errorf("expect error") - } -} - -type timeoutErr struct { - error -} - -var errTimeout = awserr.New("foo", "bar", &timeoutErr{ - errors.New("net/http: request canceled"), -}) - -func (e *timeoutErr) Timeout() bool { - return true -} - -func (e *timeoutErr) Temporary() bool { - return true -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7_test.go deleted file mode 100644 index ca6150c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7_test.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build !go1.8 - -package request - -import ( - "net/http" - "strings" - "testing" -) - -func TestResetBody_WithEmptyBody(t *testing.T) { - r := Request{ - HTTPRequest: &http.Request{}, - } - - reader := strings.NewReader("") - r.Body = reader - - r.ResetBody() - - if a, e := r.HTTPRequest.Body, (noBody{}); a != e { - t.Errorf("expected request body to be set to reader, got %#v", r.HTTPRequest.Body) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8_test.go deleted file mode 100644 index ad9ab15..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8_test.go +++ /dev/null @@ -1,86 +0,0 @@ -// +build go1.8 - -package request_test - -import ( - "bytes" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -func TestResetBody_WithEmptyBody(t *testing.T) { - r := request.Request{ - HTTPRequest: &http.Request{}, - } - - reader := strings.NewReader("") - r.Body = reader - - r.ResetBody() - - if a, e := r.HTTPRequest.Body, http.NoBody; a != e { - t.Errorf("expected request body to be set to reader, got %#v", - r.HTTPRequest.Body) - } -} - -func TestRequest_FollowPUTRedirects(t *testing.T) { - const bodySize = 1024 - - redirectHit := 0 - endpointHit := 0 - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case "/redirect-me": - u := *r.URL - u.Path = "/endpoint" - w.Header().Set("Location", u.String()) - w.WriteHeader(307) - redirectHit++ - case "/endpoint": - b := bytes.Buffer{} - io.Copy(&b, r.Body) - r.Body.Close() - if e, a := bodySize, b.Len(); e != a { - t.Fatalf("expect %d body size, got %d", e, a) - } - endpointHit++ - default: - t.Fatalf("unexpected endpoint used, %q", r.URL.String()) - } - })) - defer server.Close() - - svc := awstesting.NewClient(&aws.Config{ - Region: unit.Session.Config.Region, - DisableSSL: aws.Bool(true), - Endpoint: aws.String(server.URL), - }) - - req := svc.NewRequest(&request.Operation{ - Name: "Operation", - HTTPMethod: "PUT", - HTTPPath: "/redirect-me", - }, &struct{}{}, &struct{}{}) - req.SetReaderBody(bytes.NewReader(make([]byte, bodySize))) - - err := req.Send() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := 1, redirectHit; e != a { - t.Errorf("expect %d redirect hits, got %d", e, a) - } - if e, a := 1, endpointHit; e != a { - t.Errorf("expect %d endpoint hits, got %d", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_test.go deleted file mode 100644 index 2af2867..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_context_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package request_test - -import ( - "fmt" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestRequest_SetContext(t *testing.T) { - svc := awstesting.NewClient() - svc.Handlers.Clear() - svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler) - - r := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - r.SetContext(ctx) - - ctx.Error = fmt.Errorf("context canceled") - close(ctx.DoneCh) - - err := r.Send() - if err == nil { - t.Fatalf("expected error, got none") - } - - // Only check against canceled because go 1.6 will not use the context's - // Err(). - if e, a := "canceled", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %q to be in %q, but was not", e, a) - } -} - -func TestRequest_SetContextPanic(t *testing.T) { - defer func() { - if r := recover(); r == nil { - t.Fatalf("expect SetContext to panic, did not") - } - }() - r := &request.Request{} - - r.SetContext(nil) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_internal_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_internal_test.go deleted file mode 100644 index 966f934..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_internal_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package request - -import ( - "testing" -) - -func TestCopy(t *testing.T) { - handlers := Handlers{} - op := &Operation{} - op.HTTPMethod = "Foo" - req := &Request{} - req.Operation = op - req.Handlers = handlers - - r := req.copy() - - if r == req { - t.Fatal("expect request pointer copy to be different") - } - if r.Operation == req.Operation { - t.Errorf("expect request operation pointer to be different") - } - - if e, a := req.Operation.HTTPMethod, r.Operation.HTTPMethod; e != a { - t.Errorf("expect %q http method, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go deleted file mode 100644 index 206253a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go +++ /dev/null @@ -1,703 +0,0 @@ -package request_test - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/aws/aws-sdk-go/service/s3" -) - -// Use DynamoDB methods for simplicity -func TestPaginationQueryPage(t *testing.T) { - db := dynamodb.New(unit.Session) - tokens, pages, numPages, gotToEnd := []map[string]*dynamodb.AttributeValue{}, []map[string]*dynamodb.AttributeValue{}, 0, false - - reqNum := 0 - resps := []*dynamodb.QueryOutput{ - { - LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}}, - Count: aws.Int64(1), - Items: []map[string]*dynamodb.AttributeValue{ - { - "key": {S: aws.String("key1")}, - }, - }, - }, - { - LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}}, - Count: aws.Int64(1), - Items: []map[string]*dynamodb.AttributeValue{ - { - "key": {S: aws.String("key2")}, - }, - }, - }, - { - LastEvaluatedKey: map[string]*dynamodb.AttributeValue{}, - Count: aws.Int64(1), - Items: []map[string]*dynamodb.AttributeValue{ - { - "key": {S: aws.String("key3")}, - }, - }, - }, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *request.Request) { - in := r.Params.(*dynamodb.QueryInput) - if in == nil { - tokens = append(tokens, nil) - } else if len(in.ExclusiveStartKey) != 0 { - tokens = append(tokens, in.ExclusiveStartKey) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.QueryInput{ - Limit: aws.Int64(2), - TableName: aws.String("tablename"), - } - err := db.QueryPages(params, func(p *dynamodb.QueryOutput, last bool) bool { - numPages++ - pages = append(pages, p.Items...) - if last { - if gotToEnd { - t.Errorf("last=true happened twice") - } - gotToEnd = true - } - return true - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if e, a := - []map[string]*dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - }, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := - []map[string]*dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - {"key": {S: aws.String("key3")}}, - }, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, numPages; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !gotToEnd { - t.Errorf("expect true") - } - if params.ExclusiveStartKey != nil { - t.Errorf("expect nil, %v", err) - } -} - -// Use DynamoDB methods for simplicity -func TestPagination(t *testing.T) { - db := dynamodb.New(unit.Session) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *request.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - for _, t := range p.TableNames { - pages = append(pages, *t) - } - if last { - if gotToEnd { - t.Errorf("last=true happened twice") - } - gotToEnd = true - } - return true - }) - - if e, a := []string{"Table2", "Table4"}, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, numPages; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !gotToEnd { - t.Errorf("expect true") - } - if err != nil { - t.Errorf("expect nil, %v", err) - } - if params.ExclusiveStartTableName != nil { - t.Errorf("expect nil, %v", err) - } -} - -// Use DynamoDB methods for simplicity -func TestPaginationEachPage(t *testing.T) { - db := dynamodb.New(unit.Session) - tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *request.Request) { - in := r.Params.(*dynamodb.ListTablesInput) - if in == nil { - tokens = append(tokens, "") - } else if in.ExclusiveStartTableName != nil { - tokens = append(tokens, *in.ExclusiveStartTableName) - } - }) - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - req, _ := db.ListTablesRequest(params) - err := req.EachPage(func(p interface{}, last bool) bool { - numPages++ - for _, t := range p.(*dynamodb.ListTablesOutput).TableNames { - pages = append(pages, *t) - } - if last { - if gotToEnd { - t.Errorf("last=true happened twice") - } - gotToEnd = true - } - - return true - }) - - if e, a := []string{"Table2", "Table4"}, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, numPages; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !gotToEnd { - t.Errorf("expect true") - } - if err != nil { - t.Errorf("expect nil, %v", err) - } -} - -// Use DynamoDB methods for simplicity -func TestPaginationEarlyExit(t *testing.T) { - db := dynamodb.New(unit.Session) - numPages, gotToEnd := 0, false - - reqNum := 0 - resps := []*dynamodb.ListTablesOutput{ - {TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, - {TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, - {TableNames: []*string{aws.String("Table5")}}, - } - - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { - numPages++ - if numPages == 2 { - return false - } - if last { - if gotToEnd { - t.Errorf("last=true happened twice") - } - gotToEnd = true - } - return true - }) - - if e, a := 2, numPages; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if gotToEnd { - t.Errorf("expect false") - } - if err != nil { - t.Errorf("expect nil, %v", err) - } -} - -func TestSkipPagination(t *testing.T) { - client := s3.New(unit.Session) - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = &s3.HeadBucketOutput{} - }) - - req, _ := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")}) - - numPages, gotToEnd := 0, false - req.EachPage(func(p interface{}, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - if e, a := 1, numPages; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !gotToEnd { - t.Errorf("expect true") - } -} - -// Use S3 for simplicity -func TestPaginationTruncation(t *testing.T) { - client := s3.New(unit.Session) - - reqNum := 0 - resps := []*s3.ListObjectsOutput{ - {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key1")}}}, - {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key2")}}}, - {IsTruncated: aws.Bool(false), Contents: []*s3.Object{{Key: aws.String("Key3")}}}, - {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key4")}}}, - } - - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} - - results := []string{} - err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - if e, a := []string{"Key1", "Key2", "Key3"}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if err != nil { - t.Errorf("expect nil, %v", err) - } - - // Try again without truncation token at all - reqNum = 0 - resps[1].IsTruncated = nil - resps[2].IsTruncated = aws.Bool(true) - results = []string{} - err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { - results = append(results, *p.Contents[0].Key) - return true - }) - - if e, a := []string{"Key1", "Key2"}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if err != nil { - t.Errorf("expect nil, %v", err) - } -} - -func TestPaginationNilToken(t *testing.T) { - client := route53.New(unit.Session) - - reqNum := 0 - resps := []*route53.ListResourceRecordSetsOutput{ - { - ResourceRecordSets: []*route53.ResourceRecordSet{ - {Name: aws.String("first.example.com.")}, - }, - IsTruncated: aws.Bool(true), - NextRecordName: aws.String("second.example.com."), - NextRecordType: aws.String("MX"), - NextRecordIdentifier: aws.String("second"), - MaxItems: aws.String("1"), - }, - { - ResourceRecordSets: []*route53.ResourceRecordSet{ - {Name: aws.String("second.example.com.")}, - }, - IsTruncated: aws.Bool(true), - NextRecordName: aws.String("third.example.com."), - NextRecordType: aws.String("MX"), - MaxItems: aws.String("1"), - }, - { - ResourceRecordSets: []*route53.ResourceRecordSet{ - {Name: aws.String("third.example.com.")}, - }, - IsTruncated: aws.Bool(false), - MaxItems: aws.String("1"), - }, - } - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - - idents := []string{} - client.Handlers.Build.PushBack(func(r *request.Request) { - p := r.Params.(*route53.ListResourceRecordSetsInput) - idents = append(idents, aws.StringValue(p.StartRecordIdentifier)) - - }) - client.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = resps[reqNum] - reqNum++ - }) - - params := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String("id-zone"), - } - - results := []string{} - err := client.ListResourceRecordSetsPages(params, func(p *route53.ListResourceRecordSetsOutput, last bool) bool { - results = append(results, *p.ResourceRecordSets[0].Name) - return true - }) - - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := []string{"", "second", ""}, idents; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := []string{"first.example.com.", "second.example.com.", "third.example.com."}, results; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestPaginationNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Session) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = &s3.ListObjectsOutput{} - }) - - gotToEnd := false - numPages := 0 - err := client.ListObjectsPages(nil, func(p *s3.ListObjectsOutput, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 1, numPages; e != a { - t.Errorf("expect %d number pages but got %d", e, a) - } - if !gotToEnd { - t.Errorf("expect to of gotten to end, did not") - } -} - -func TestPaginationWithContextNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Session) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = &s3.ListObjectsOutput{} - }) - - gotToEnd := false - numPages := 0 - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - err := client.ListObjectsPagesWithContext(ctx, nil, func(p *s3.ListObjectsOutput, last bool) bool { - numPages++ - if last { - gotToEnd = true - } - return true - }) - - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 1, numPages; e != a { - t.Errorf("expect %d number pages but got %d", e, a) - } - if !gotToEnd { - t.Errorf("expect to of gotten to end, did not") - } -} - -func TestPagination_Standalone(t *testing.T) { - type testPageInput struct { - NextToken *string - } - type testPageOutput struct { - Value *string - NextToken *string - } - type testCase struct { - Value, PrevToken, NextToken *string - } - - type testCaseList struct { - StopOnSameToken bool - Cases []testCase - } - - cases := []testCaseList{ - { - Cases: []testCase{ - {aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - {aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - {aws.String("ThirdValue"), aws.String("SecondToken"), nil}, - }, - StopOnSameToken: false, - }, - { - Cases: []testCase{ - {aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - {aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - {aws.String("ThirdValue"), aws.String("SecondToken"), aws.String("")}, - }, - StopOnSameToken: false, - }, - { - Cases: []testCase{ - {aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - {aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - {nil, aws.String("SecondToken"), aws.String("SecondToken")}, - }, - StopOnSameToken: true, - }, - { - Cases: []testCase{ - {aws.String("FirstValue"), aws.String("InitalToken"), aws.String("FirstToken")}, - {aws.String("SecondValue"), aws.String("FirstToken"), aws.String("SecondToken")}, - {aws.String("SecondValue"), aws.String("SecondToken"), aws.String("SecondToken")}, - }, - StopOnSameToken: true, - }, - } - - for _, testcase := range cases { - c := testcase.Cases - input := testPageInput{ - NextToken: c[0].PrevToken, - } - - svc := awstesting.NewClient() - i := 0 - p := request.Pagination{ - EndPageOnSameToken: testcase.StopOnSameToken, - NewRequest: func() (*request.Request, error) { - r := svc.NewRequest( - &request.Operation{ - Name: "Operation", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - }, - }, - &input, &testPageOutput{}, - ) - // Setup handlers for testing - r.Handlers.Clear() - r.Handlers.Build.PushBack(func(req *request.Request) { - if e, a := len(c), i+1; a > e { - t.Fatalf("expect no more than %d requests, got %d", e, a) - } - in := req.Params.(*testPageInput) - if e, a := aws.StringValue(c[i].PrevToken), aws.StringValue(in.NextToken); e != a { - t.Errorf("%d, expect NextToken input %q, got %q", i, e, a) - } - }) - r.Handlers.Unmarshal.PushBack(func(req *request.Request) { - out := &testPageOutput{ - Value: c[i].Value, - } - if c[i].NextToken != nil { - next := *c[i].NextToken - out.NextToken = aws.String(next) - } - req.Data = out - }) - return r, nil - }, - } - - for p.Next() { - data := p.Page().(*testPageOutput) - - if e, a := aws.StringValue(c[i].Value), aws.StringValue(data.Value); e != a { - t.Errorf("%d, expect Value to be %q, got %q", i, e, a) - } - if e, a := aws.StringValue(c[i].NextToken), aws.StringValue(data.NextToken); e != a { - t.Errorf("%d, expect NextToken to be %q, got %q", i, e, a) - } - - i++ - } - if e, a := len(c), i; e != a { - t.Errorf("expected to process %d pages, did %d", e, a) - } - if err := p.Err(); err != nil { - t.Fatalf("%d, expected no error, got %v", i, err) - } - } -} - -// Benchmarks -var benchResps = []*dynamodb.ListTablesOutput{ - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, - {TableNames: []*string{aws.String("TABLE")}}, -} - -var benchDb = func() *dynamodb.DynamoDB { - db := dynamodb.New(unit.Session) - db.Handlers.Send.Clear() // mock sending - db.Handlers.Unmarshal.Clear() - db.Handlers.UnmarshalMeta.Clear() - db.Handlers.ValidateResponse.Clear() - return db -} - -func BenchmarkCodegenIterator(b *testing.B) { - reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error { - page, _ := db.ListTablesRequest(input) - for ; page != nil; page = page.NextPage() { - page.Send() - out := page.Data.(*dynamodb.ListTablesOutput) - if result := fn(out, !page.HasNextPage()); page.Error != nil || !result { - return page.Error - } - } - return nil - } - - for i := 0; i < b.N; i++ { - reqNum = 0 - iter(func(p *dynamodb.ListTablesOutput, last bool) bool { - return true - }) - } -} - -func BenchmarkEachPageIterator(b *testing.B) { - reqNum := 0 - db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *request.Request) { - r.Data = benchResps[reqNum] - reqNum++ - }) - - input := &dynamodb.ListTablesInput{Limit: aws.Int64(2)} - for i := 0; i < b.N; i++ { - reqNum = 0 - req, _ := db.ListTablesRequest(input) - req.EachPage(func(p interface{}, last bool) bool { - return true - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_resetbody_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_resetbody_test.go deleted file mode 100644 index d7845b7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_resetbody_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package request - -import ( - "bytes" - "io" - "net/http" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -func TestResetBody_WithBodyContents(t *testing.T) { - r := Request{ - HTTPRequest: &http.Request{}, - } - - reader := strings.NewReader("abc") - r.Body = reader - - r.ResetBody() - - if v, ok := r.HTTPRequest.Body.(*offsetReader); !ok || v == nil { - t.Errorf("expected request body to be set to reader, got %#v", - r.HTTPRequest.Body) - } -} - -type mockReader struct{} - -func (mockReader) Read([]byte) (int, error) { - return 0, io.EOF -} - -func TestResetBody_ExcludeEmptyUnseekableBodyByMethod(t *testing.T) { - cases := []struct { - Method string - Body io.ReadSeeker - IsNoBody bool - }{ - { - Method: "GET", - IsNoBody: true, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "HEAD", - IsNoBody: true, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "DELETE", - IsNoBody: true, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "PUT", - IsNoBody: false, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "PATCH", - IsNoBody: false, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "POST", - IsNoBody: false, - Body: aws.ReadSeekCloser(mockReader{}), - }, - { - Method: "GET", - IsNoBody: false, - Body: aws.ReadSeekCloser(bytes.NewBuffer([]byte("abc"))), - }, - { - Method: "GET", - IsNoBody: true, - Body: aws.ReadSeekCloser(bytes.NewBuffer(nil)), - }, - { - Method: "POST", - IsNoBody: false, - Body: aws.ReadSeekCloser(bytes.NewBuffer([]byte("abc"))), - }, - { - Method: "POST", - IsNoBody: true, - Body: aws.ReadSeekCloser(bytes.NewBuffer(nil)), - }, - } - - for i, c := range cases { - r := Request{ - HTTPRequest: &http.Request{}, - Operation: &Operation{ - HTTPMethod: c.Method, - }, - } - r.SetReaderBody(c.Body) - - if a, e := r.HTTPRequest.Body == NoBody, c.IsNoBody; a != e { - t.Errorf("%d, expect body to be set to noBody(%t), but was %t", i, e, a) - } - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_retry_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_retry_test.go deleted file mode 100644 index c24fc9f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_retry_test.go +++ /dev/null @@ -1,202 +0,0 @@ -package request - -import ( - "fmt" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -func newRequest(t *testing.T, url string) *http.Request { - r, err := http.NewRequest("GET", url, nil) - if err != nil { - t.Fatalf("can't forge request: %v", err) - } - return r -} - -func TestShouldRetryError_nil(t *testing.T) { - if shouldRetryError(nil) != true { - t.Error("shouldRetryError(nil) should return true") - } -} - -func TestShouldRetryError_timeout(t *testing.T) { - - tr := &http.Transport{} - defer tr.CloseIdleConnections() - client := http.Client{ - Timeout: time.Nanosecond, - Transport: tr, - } - - resp, err := client.Do(newRequest(t, "https://179.179.179.179/no/such/host")) - if resp != nil { - resp.Body.Close() - } - if err == nil { - t.Fatal("This should have failed.") - } - debugerr(t, err) - - if shouldRetryError(err) == false { - t.Errorf("this request timed out and should be retried") - } -} - -func TestShouldRetryError_cancelled(t *testing.T) { - tr := &http.Transport{} - defer tr.CloseIdleConnections() - client := http.Client{ - Transport: tr, - } - - cancelWait := make(chan bool) - srvrWait := make(chan bool) - srvr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - close(cancelWait) // Trigger the request cancel. - time.Sleep(100 * time.Millisecond) - - fmt.Fprintf(w, "Hello") - w.(http.Flusher).Flush() // send headers and some body - <-srvrWait // block forever - })) - defer srvr.Close() - defer close(srvrWait) - - r := newRequest(t, srvr.URL) - ch := make(chan struct{}) - r.Cancel = ch - - // Ensure the request has started, and client has started to receive bytes. - // This ensures the test is stable and does not run into timing with the - // request being canceled, before or after the http request is made. - go func() { - <-cancelWait - close(ch) // request is cancelled before anything - }() - - resp, err := client.Do(r) - if resp != nil { - resp.Body.Close() - } - if err == nil { - t.Fatal("This should have failed.") - } - - debugerr(t, err) - - if shouldRetryError(err) == true { - t.Errorf("this request was cancelled and should not be retried") - } -} - -func TestShouldRetry(t *testing.T) { - - syscallError := os.SyscallError{ - Err: ErrInvalidParams{}, - Syscall: "open", - } - - opError := net.OpError{ - Op: "dial", - Net: "tcp", - Source: net.Addr(nil), - Err: &syscallError, - } - - urlError := url.Error{ - Op: "Post", - URL: "https://localhost:52398", - Err: &opError, - } - origError := awserr.New("ErrorTestShouldRetry", "Test should retry when error received", &urlError).OrigErr() - if e, a := true, shouldRetryError(origError); e != a { - t.Errorf("Expected to return %v to retry when error occured, got %v instead", e, a) - } - -} - -func debugerr(t *testing.T, err error) { - t.Logf("Error, %v", err) - - switch err := err.(type) { - case temporary: - t.Logf("%s is a temporary error: %t", err, err.Temporary()) - return - case *url.Error: - t.Logf("err: %s, nested err: %#v", err, err.Err) - if operr, ok := err.Err.(*net.OpError); ok { - t.Logf("operr: %#v", operr) - } - debugerr(t, err.Err) - return - default: - return - } -} - -func TestRequest_retryCustomCodes(t *testing.T) { - cases := map[string]struct { - Code string - RetryErrorCodes []string - ThrottleErrorCodes []string - Retryable bool - Throttle bool - }{ - "retry code": { - Code: "RetryMePlease", - RetryErrorCodes: []string{ - "RetryMePlease", - "SomeOtherError", - }, - Retryable: true, - }, - "throttle code": { - Code: "AThrottleableError", - RetryErrorCodes: []string{ - "RetryMePlease", - "SomeOtherError", - }, - ThrottleErrorCodes: []string{ - "AThrottleableError", - "SomeOtherError", - }, - Throttle: true, - }, - "unknown code": { - Code: "UnknownCode", - RetryErrorCodes: []string{ - "RetryMePlease", - "SomeOtherError", - }, - Retryable: false, - }, - } - - for name, c := range cases { - req := Request{ - HTTPRequest: &http.Request{}, - HTTPResponse: &http.Response{}, - Error: awserr.New(c.Code, "some error", nil), - RetryErrorCodes: c.RetryErrorCodes, - ThrottleErrorCodes: c.ThrottleErrorCodes, - } - - retryable := req.IsErrorRetryable() - if e, a := c.Retryable, retryable; e != a { - t.Errorf("%s, expect %v retryable, got %v", name, e, a) - } - - throttle := req.IsErrorThrottle() - if e, a := c.Throttle, throttle; e != a { - t.Errorf("%s, expect %v throttle, got %v", name, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_test.go deleted file mode 100644 index 0a33575..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_test.go +++ /dev/null @@ -1,1182 +0,0 @@ -package request_test - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/httptest" - "net/url" - "reflect" - "runtime" - "strconv" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -type tempNetworkError struct { - op string - msg string - isTemp bool -} - -func (e *tempNetworkError) Temporary() bool { return e.isTemp } -func (e *tempNetworkError) Error() string { - return fmt.Sprintf("%s: %s", e.op, e.msg) -} - -var ( - // net.OpError accept, are always temporary - errAcceptConnectionResetStub = &tempNetworkError{ - isTemp: true, op: "accept", msg: "connection reset", - } - - // net.OpError read for ECONNRESET is not temporary. - errReadConnectionResetStub = &tempNetworkError{ - isTemp: false, op: "read", msg: "connection reset", - } - - // net.OpError write for ECONNRESET may not be temporary, but is treaded as - // temporary by the SDK. - errWriteConnectionResetStub = &tempNetworkError{ - isTemp: false, op: "write", msg: "connection reset", - } - - // net.OpError write for broken pipe may not be temporary, but is treaded as - // temporary by the SDK. - errWriteBrokenPipeStub = &tempNetworkError{ - isTemp: false, op: "write", msg: "broken pipe", - } - - // Generic connection reset error - errConnectionResetStub = errors.New("connection reset") -) - -type testData struct { - Data string -} - -func body(str string) io.ReadCloser { - return ioutil.NopCloser(bytes.NewReader([]byte(str))) -} - -func unmarshal(req *request.Request) { - defer req.HTTPResponse.Body.Close() - if req.Data != nil { - json.NewDecoder(req.HTTPResponse.Body).Decode(req.Data) - } -} - -func unmarshalError(req *request.Request) { - bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.New("UnmarshaleError", req.HTTPResponse.Status, err) - return - } - if len(bodyBytes) == 0 { - req.Error = awserr.NewRequestFailure( - awserr.New("UnmarshaleError", req.HTTPResponse.Status, fmt.Errorf("empty body")), - req.HTTPResponse.StatusCode, - "", - ) - return - } - var jsonErr jsonErrorResponse - if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { - req.Error = awserr.New("UnmarshaleError", "JSON unmarshal", err) - return - } - req.Error = awserr.NewRequestFailure( - awserr.New(jsonErr.Code, jsonErr.Message, nil), - req.HTTPResponse.StatusCode, - "", - ) -} - -type jsonErrorResponse struct { - Code string `json:"__type"` - Message string `json:"message"` -} - -// test that retries occur for 5xx status codes -func TestRequestRecoverRetry5xx(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 502, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := awstesting.NewClient(&aws.Config{ - MaxRetries: aws.Int(10), - SleepDelay: func(time.Duration) {}, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 2, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if e, a := "valid", out.Data; e != a { - t.Errorf("expect %q output got %q", e, a) - } -} - -// test that retries occur for 4xx status codes with a response type that can be retried - see `shouldRetry` -func TestRequestRecoverRetry4xxRetryable(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 400, Body: body(`{"__type":"Throttling","message":"Rate exceeded."}`)}, - {StatusCode: 400, Body: body(`{"__type":"ProvisionedThroughputExceededException","message":"Rate exceeded."}`)}, - {StatusCode: 429, Body: body(`{"__type":"FooException","message":"Rate exceeded."}`)}, - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := awstesting.NewClient(&aws.Config{ - MaxRetries: aws.Int(10), - SleepDelay: func(time.Duration) {}, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 3, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if e, a := "valid", out.Data; e != a { - t.Errorf("expect %q output got %q", e, a) - } -} - -// test that retries don't occur for 4xx status codes with a response type that can't be retried -func TestRequest4xxUnretryable(t *testing.T) { - s := awstesting.NewClient(&aws.Config{ - MaxRetries: aws.Int(1), - SleepDelay: func(time.Duration) {}, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: 401, - Body: body(`{"__type":"SignatureDoesNotMatch","message":"Signature does not match."}`), - } - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err == nil { - t.Fatalf("expect error, but did not get one") - } - aerr := err.(awserr.RequestFailure) - if e, a := 401, aerr.StatusCode(); e != a { - t.Errorf("expect %d status code, got %d", e, a) - } - if e, a := "SignatureDoesNotMatch", aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := "Signature does not match.", aerr.Message(); e != a { - t.Errorf("expect %q error message, got %q", e, a) - } - if e, a := 0, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } -} - -func TestRequestExhaustRetries(t *testing.T) { - delays := []time.Duration{} - sleepDelay := func(delay time.Duration) { - delays = append(delays, delay) - } - - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - } - - s := awstesting.NewClient(&aws.Config{ - SleepDelay: sleepDelay, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - err := r.Send() - if err == nil { - t.Fatalf("expect error, but did not get one") - } - aerr := err.(awserr.RequestFailure) - if e, a := 500, aerr.StatusCode(); e != a { - t.Errorf("expect %d status code, got %d", e, a) - } - if e, a := "UnknownError", aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := "An error occurred.", aerr.Message(); e != a { - t.Errorf("expect %q error message, got %q", e, a) - } - if e, a := 3, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - - expectDelays := []struct{ min, max time.Duration }{{30, 60}, {60, 120}, {120, 240}} - for i, v := range delays { - min := expectDelays[i].min * time.Millisecond - max := expectDelays[i].max * time.Millisecond - if !(min <= v && v <= max) { - t.Errorf("Expect delay to be within range, i:%d, v:%s, min:%s, max:%s", - i, v, min, max) - } - } -} - -// test that the request is retried after the credentials are expired. -func TestRequestRecoverExpiredCreds(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 400, Body: body(`{"__type":"ExpiredTokenException","message":"expired token"}`)}, - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := awstesting.NewClient(&aws.Config{ - MaxRetries: aws.Int(10), - Credentials: credentials.NewStaticCredentials("AKID", "SECRET", ""), - SleepDelay: func(time.Duration) {}, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - - credExpiredBeforeRetry := false - credExpiredAfterRetry := false - - s.Handlers.AfterRetry.PushBack(func(r *request.Request) { - credExpiredAfterRetry = r.Config.Credentials.IsExpired() - }) - - s.Handlers.Sign.Clear() - s.Handlers.Sign.PushBack(func(r *request.Request) { - r.Config.Credentials.Get() - }) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if credExpiredBeforeRetry { - t.Errorf("Expect valid creds before retry check") - } - if !credExpiredAfterRetry { - t.Errorf("Expect expired creds after retry check") - } - if s.Config.Credentials.IsExpired() { - t.Errorf("Expect valid creds after cred expired recovery") - } - - if e, a := 1, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if e, a := "valid", out.Data; e != a { - t.Errorf("expect %q output got %q", e, a) - } -} - -func TestMakeAddtoUserAgentHandler(t *testing.T) { - fn := request.MakeAddToUserAgentHandler("name", "version", "extra1", "extra2") - r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}} - r.HTTPRequest.Header.Set("User-Agent", "foo/bar") - fn(r) - - if e, a := "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"); !strings.HasPrefix(a, e) { - t.Errorf("expect %q user agent, got %q", e, a) - } -} - -func TestMakeAddtoUserAgentFreeFormHandler(t *testing.T) { - fn := request.MakeAddToUserAgentFreeFormHandler("name/version (extra1; extra2)") - r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}} - r.HTTPRequest.Header.Set("User-Agent", "foo/bar") - fn(r) - - if e, a := "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent"); !strings.HasPrefix(a, e) { - t.Errorf("expect %q user agent, got %q", e, a) - } -} - -func TestRequestUserAgent(t *testing.T) { - s := awstesting.NewClient(&aws.Config{ - Region: aws.String("us-east-1"), - }) - - req := s.NewRequest(&request.Operation{Name: "Operation"}, nil, &testData{}) - req.HTTPRequest.Header.Set("User-Agent", "foo/bar") - if err := req.Build(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expectUA := fmt.Sprintf("foo/bar %s/%s (%s; %s; %s)", - aws.SDKName, aws.SDKVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH) - if e, a := expectUA, req.HTTPRequest.Header.Get("User-Agent"); !strings.HasPrefix(a, e) { - t.Errorf("expect %q user agent, got %q", e, a) - } -} - -func TestRequestThrottleRetries(t *testing.T) { - var delays []time.Duration - sleepDelay := func(delay time.Duration) { - delays = append(delays, delay) - } - - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 500, Body: body(`{"__type":"Throttling","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"Throttling","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"Throttling","message":"An error occurred."}`)}, - {StatusCode: 500, Body: body(`{"__type":"Throttling","message":"An error occurred."}`)}, - } - - s := awstesting.NewClient(&aws.Config{ - SleepDelay: sleepDelay, - }) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - err := r.Send() - if err == nil { - t.Fatalf("expect error, but did not get one") - } - aerr := err.(awserr.RequestFailure) - if e, a := 500, aerr.StatusCode(); e != a { - t.Errorf("expect %d status code, got %d", e, a) - } - if e, a := "Throttling", aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := "An error occurred.", aerr.Message(); e != a { - t.Errorf("expect %q error message, got %q", e, a) - } - if e, a := 3, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - - expectDelays := []struct{ min, max time.Duration }{{500, 1000}, {1000, 2000}, {2000, 4000}} - for i, v := range delays { - min := expectDelays[i].min * time.Millisecond - max := expectDelays[i].max * time.Millisecond - if !(min <= v && v <= max) { - t.Errorf("Expect delay to be within range, i:%d, v:%s, min:%s, max:%s", - i, v, min, max) - } - } -} - -// test that retries occur for request timeouts when response.Body can be nil -func TestRequestRecoverTimeoutWithNilBody(t *testing.T) { - reqNum := 0 - reqs := []*http.Response{ - {StatusCode: 0, Body: nil}, // body can be nil when requests time out - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - errors := []error{ - errTimeout, nil, - } - - s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.AfterRetry.Clear() // force retry on all errors - s.Handlers.AfterRetry.PushBack(func(r *request.Request) { - if r.Error != nil { - r.Error = nil - r.Retryable = aws.Bool(true) - r.RetryCount++ - } - }) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = reqs[reqNum] - r.Error = errors[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 1, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if e, a := "valid", out.Data; e != a { - t.Errorf("expect %q output got %q", e, a) - } -} - -func TestRequestRecoverTimeoutWithNilResponse(t *testing.T) { - reqNum := 0 - reqs := []*http.Response{ - nil, - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - errors := []error{ - errTimeout, - nil, - } - - s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.AfterRetry.Clear() // force retry on all errors - s.Handlers.AfterRetry.PushBack(func(r *request.Request) { - if r.Error != nil { - r.Error = nil - r.Retryable = aws.Bool(true) - r.RetryCount++ - } - }) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = reqs[reqNum] - r.Error = errors[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } - if e, a := 1, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if e, a := "valid", out.Data; e != a { - t.Errorf("expect %q output got %q", e, a) - } -} - -func TestRequest_NoBody(t *testing.T) { - cases := []string{ - "GET", "HEAD", "DELETE", - "PUT", "POST", "PATCH", - } - - for i, c := range cases { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if v := r.TransferEncoding; len(v) > 0 { - t.Errorf("%d, expect no body sent with Transfer-Encoding, %v", i, v) - } - - outMsg := []byte(`{"Value": "abc"}`) - - if b, err := ioutil.ReadAll(r.Body); err != nil { - t.Fatalf("%d, expect no error reading request body, got %v", i, err) - } else if n := len(b); n > 0 { - t.Errorf("%d, expect no request body, got %d bytes", i, n) - } - - w.Header().Set("Content-Length", strconv.Itoa(len(outMsg))) - if _, err := w.Write(outMsg); err != nil { - t.Fatalf("%d, expect no error writing server response, got %v", i, err) - } - })) - - s := awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - MaxRetries: aws.Int(0), - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }) - s.Handlers.Build.PushBack(rest.Build) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - - in := struct { - Bucket *string `location:"uri" locationName:"bucket"` - Key *string `location:"uri" locationName:"key"` - }{ - Bucket: aws.String("mybucket"), Key: aws.String("myKey"), - } - - out := struct { - Value *string - }{} - - r := s.NewRequest(&request.Operation{ - Name: "OpName", HTTPMethod: c, HTTPPath: "/{bucket}/{key+}", - }, &in, &out) - - err := r.Send() - server.Close() - if err != nil { - t.Fatalf("%d, expect no error sending request, got %v", i, err) - } - } -} - -func TestIsSerializationErrorRetryable(t *testing.T) { - testCases := []struct { - err error - expected bool - }{ - { - err: awserr.New(request.ErrCodeSerialization, "foo error", nil), - expected: false, - }, - { - err: awserr.New("ErrFoo", "foo error", nil), - expected: false, - }, - { - err: nil, - expected: false, - }, - { - err: awserr.New(request.ErrCodeSerialization, "foo error", errAcceptConnectionResetStub), - expected: true, - }, - } - - for i, c := range testCases { - r := &request.Request{ - Error: c.err, - } - if r.IsErrorRetryable() != c.expected { - t.Errorf("Case %d: Expected %v, but received %v", i, c.expected, !c.expected) - } - } -} - -func TestWithLogLevel(t *testing.T) { - r := &request.Request{} - - opt := request.WithLogLevel(aws.LogDebugWithHTTPBody) - r.ApplyOptions(opt) - - if !r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) { - t.Errorf("expect log level to be set, but was not, %v", - r.Config.LogLevel.Value()) - } -} - -func TestWithGetResponseHeader(t *testing.T) { - r := &request.Request{} - - var val, val2 string - r.ApplyOptions( - request.WithGetResponseHeader("x-a-header", &val), - request.WithGetResponseHeader("x-second-header", &val2), - ) - - r.HTTPResponse = &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set("x-a-header", "first") - h.Set("x-second-header", "second") - return h - }(), - } - r.Handlers.Complete.Run(r) - - if e, a := "first", val; e != a { - t.Errorf("expect %q header value got %q", e, a) - } - if e, a := "second", val2; e != a { - t.Errorf("expect %q header value got %q", e, a) - } -} - -func TestWithGetResponseHeaders(t *testing.T) { - r := &request.Request{} - - var headers http.Header - opt := request.WithGetResponseHeaders(&headers) - - r.ApplyOptions(opt) - - r.HTTPResponse = &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set("x-a-header", "headerValue") - return h - }(), - } - r.Handlers.Complete.Run(r) - - if e, a := "headerValue", headers.Get("x-a-header"); e != a { - t.Errorf("expect %q header value got %q", e, a) - } -} - -type testRetryer struct { - shouldRetry bool - maxRetries int -} - -func (d *testRetryer) MaxRetries() int { - return d.maxRetries -} - -// RetryRules returns the delay duration before retrying this request again -func (d *testRetryer) RetryRules(r *request.Request) time.Duration { - return 0 -} - -func (d *testRetryer) ShouldRetry(r *request.Request) bool { - return d.shouldRetry -} - -func TestEnforceShouldRetryCheck(t *testing.T) { - - retryer := &testRetryer{ - shouldRetry: true, maxRetries: 3, - } - s := awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - MaxRetries: aws.Int(0), - Retryer: retryer, - EnforceShouldRetryCheck: aws.Bool(true), - SleepDelay: func(time.Duration) {}, - }) - - s.Handlers.Validate.Clear() - s.Handlers.Send.Swap(corehandlers.SendHandler.Name, request.NamedHandler{ - Name: "TestEnforceShouldRetryCheck", - Fn: func(r *request.Request) { - r.HTTPResponse = &http.Response{ - Header: http.Header{}, - Body: ioutil.NopCloser(bytes.NewBuffer(nil)), - } - r.Retryable = aws.Bool(false) - }, - }) - - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err == nil { - t.Fatalf("expect error, but got nil") - } - if e, a := 3, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - if !retryer.shouldRetry { - t.Errorf("expect 'true' for ShouldRetry, but got %v", retryer.shouldRetry) - } -} - -type errReader struct { - err error -} - -func (reader *errReader) Read(b []byte) (int, error) { - return 0, reader.err -} - -func (reader *errReader) Close() error { - return nil -} - -func TestIsNoBodyReader(t *testing.T) { - cases := []struct { - reader io.ReadCloser - expect bool - }{ - {ioutil.NopCloser(bytes.NewReader([]byte("abc"))), false}, - {ioutil.NopCloser(bytes.NewReader(nil)), false}, - {nil, false}, - {request.NoBody, true}, - } - - for i, c := range cases { - if e, a := c.expect, request.NoBody == c.reader; e != a { - t.Errorf("%d, expect %t match, but was %t", i, e, a) - } - } -} - -func TestRequest_TemporaryRetry(t *testing.T) { - done := make(chan struct{}) - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Length", "1024") - w.WriteHeader(http.StatusOK) - - w.Write(make([]byte, 100)) - - f := w.(http.Flusher) - f.Flush() - - <-done - })) - defer server.Close() - - client := &http.Client{ - Timeout: 100 * time.Millisecond, - } - - svc := awstesting.NewClient(&aws.Config{ - Region: unit.Session.Config.Region, - MaxRetries: aws.Int(1), - HTTPClient: client, - DisableSSL: aws.Bool(true), - Endpoint: aws.String(server.URL), - }) - - req := svc.NewRequest(&request.Operation{ - Name: "name", HTTPMethod: "GET", HTTPPath: "/path", - }, &struct{}{}, &struct{}{}) - - req.Handlers.Unmarshal.PushBack(func(r *request.Request) { - defer req.HTTPResponse.Body.Close() - _, err := io.Copy(ioutil.Discard, req.HTTPResponse.Body) - r.Error = awserr.New(request.ErrCodeSerialization, "error", err) - }) - - err := req.Send() - if err == nil { - t.Errorf("expect error, got none") - } - close(done) - - aerr := err.(awserr.Error) - if e, a := request.ErrCodeSerialization, aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - - if e, a := 1, req.RetryCount; e != a { - t.Errorf("expect %d retries, got %d", e, a) - } - - type temporary interface { - Temporary() bool - } - - terr := aerr.OrigErr().(temporary) - if !terr.Temporary() { - t.Errorf("expect temporary error, was not") - } -} - -func TestRequest_Presign(t *testing.T) { - presign := func(r *request.Request, expire time.Duration) (string, http.Header, error) { - u, err := r.Presign(expire) - return u, nil, err - } - presignRequest := func(r *request.Request, expire time.Duration) (string, http.Header, error) { - return r.PresignRequest(expire) - } - mustParseURL := func(v string) *url.URL { - u, err := url.Parse(v) - if err != nil { - panic(err) - } - return u - } - - cases := []struct { - Expire time.Duration - PresignFn func(*request.Request, time.Duration) (string, http.Header, error) - SignerFn func(*request.Request) - URL string - Header http.Header - Err string - }{ - { - PresignFn: presign, - Err: request.ErrCodeInvalidPresignExpire, - }, - { - PresignFn: presignRequest, - Err: request.ErrCodeInvalidPresignExpire, - }, - { - Expire: -1, - PresignFn: presign, - Err: request.ErrCodeInvalidPresignExpire, - }, - { - // Presign clear NotHoist - Expire: 1 * time.Minute, - PresignFn: func(r *request.Request, dur time.Duration) (string, http.Header, error) { - r.NotHoist = true - return presign(r, dur) - }, - SignerFn: func(r *request.Request) { - r.HTTPRequest.URL = mustParseURL("https://endpoint/presignedURL") - if r.NotHoist { - r.Error = fmt.Errorf("expect NotHoist to be cleared") - } - }, - URL: "https://endpoint/presignedURL", - }, - { - // PresignRequest does not clear NotHoist - Expire: 1 * time.Minute, - PresignFn: func(r *request.Request, dur time.Duration) (string, http.Header, error) { - r.NotHoist = true - return presignRequest(r, dur) - }, - SignerFn: func(r *request.Request) { - r.HTTPRequest.URL = mustParseURL("https://endpoint/presignedURL") - if !r.NotHoist { - r.Error = fmt.Errorf("expect NotHoist not to be cleared") - } - }, - URL: "https://endpoint/presignedURL", - }, - { - // PresignRequest returns signed headers - Expire: 1 * time.Minute, - PresignFn: presignRequest, - SignerFn: func(r *request.Request) { - r.HTTPRequest.URL = mustParseURL("https://endpoint/presignedURL") - r.HTTPRequest.Header.Set("UnsigndHeader", "abc") - r.SignedHeaderVals = http.Header{ - "X-Amzn-Header": []string{"abc", "123"}, - "X-Amzn-Header2": []string{"efg", "456"}, - } - }, - URL: "https://endpoint/presignedURL", - Header: http.Header{ - "X-Amzn-Header": []string{"abc", "123"}, - "X-Amzn-Header2": []string{"efg", "456"}, - }, - }, - } - - svc := awstesting.NewClient() - svc.Handlers.Clear() - for i, c := range cases { - req := svc.NewRequest(&request.Operation{ - Name: "name", HTTPMethod: "GET", HTTPPath: "/path", - }, &struct{}{}, &struct{}{}) - req.Handlers.Sign.PushBack(c.SignerFn) - - u, h, err := c.PresignFn(req, c.Expire) - if len(c.Err) != 0 { - if e, a := c.Err, err.Error(); !strings.Contains(a, e) { - t.Errorf("%d, expect %v to be in %v", i, e, a) - } - continue - } else if err != nil { - t.Errorf("%d, expect no error, got %v", i, err) - continue - } - if e, a := c.URL, u; e != a { - t.Errorf("%d, expect %v URL, got %v", i, e, a) - } - if e, a := c.Header, h; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v header got %v", i, e, a) - } - } -} - -func TestNew_EndpointWithDefaultPort(t *testing.T) { - endpoint := "https://estest.us-east-1.es.amazonaws.com:443" - expectedRequestHost := "estest.us-east-1.es.amazonaws.com" - - r := request.New( - aws.Config{}, - metadata.ClientInfo{Endpoint: endpoint}, - defaults.Handlers(), - client.DefaultRetryer{}, - &request.Operation{}, - nil, - nil, - ) - - if h := r.HTTPRequest.Host; h != expectedRequestHost { - t.Errorf("expect %v host, got %q", expectedRequestHost, h) - } -} - -func TestSanitizeHostForHeader(t *testing.T) { - cases := []struct { - url string - expectedRequestHost string - }{ - {"https://estest.us-east-1.es.amazonaws.com:443", "estest.us-east-1.es.amazonaws.com"}, - {"https://estest.us-east-1.es.amazonaws.com", "estest.us-east-1.es.amazonaws.com"}, - {"https://localhost:9200", "localhost:9200"}, - {"http://localhost:80", "localhost"}, - {"http://localhost:8080", "localhost:8080"}, - } - - for _, c := range cases { - r, _ := http.NewRequest("GET", c.url, nil) - request.SanitizeHostForHeader(r) - - if h := r.Host; h != c.expectedRequestHost { - t.Errorf("expect %v host, got %q", c.expectedRequestHost, h) - } - } -} - -func TestRequestWillRetry_ByBody(t *testing.T) { - svc := awstesting.NewClient() - - cases := []struct { - WillRetry bool - HTTPMethod string - Body io.ReadSeeker - IsReqNoBody bool - }{ - { - WillRetry: true, - HTTPMethod: "GET", - Body: bytes.NewReader([]byte{}), - IsReqNoBody: true, - }, - { - WillRetry: true, - HTTPMethod: "GET", - Body: bytes.NewReader(nil), - IsReqNoBody: true, - }, - { - WillRetry: true, - HTTPMethod: "POST", - Body: bytes.NewReader([]byte("abc123")), - }, - { - WillRetry: true, - HTTPMethod: "POST", - Body: aws.ReadSeekCloser(bytes.NewReader([]byte("abc123"))), - }, - { - WillRetry: true, - HTTPMethod: "GET", - Body: aws.ReadSeekCloser(bytes.NewBuffer(nil)), - IsReqNoBody: true, - }, - { - WillRetry: true, - HTTPMethod: "POST", - Body: aws.ReadSeekCloser(bytes.NewBuffer(nil)), - IsReqNoBody: true, - }, - { - WillRetry: false, - HTTPMethod: "POST", - Body: aws.ReadSeekCloser(bytes.NewBuffer([]byte("abc123"))), - }, - } - - for i, c := range cases { - req := svc.NewRequest(&request.Operation{ - Name: "Operation", - HTTPMethod: c.HTTPMethod, - HTTPPath: "/", - }, nil, nil) - req.SetReaderBody(c.Body) - req.Build() - - req.Error = fmt.Errorf("some error") - req.Retryable = aws.Bool(true) - req.HTTPResponse = &http.Response{ - StatusCode: 500, - } - - if e, a := c.IsReqNoBody, request.NoBody == req.HTTPRequest.Body; e != a { - t.Errorf("%d, expect request to be no body, %t, got %t, %T", i, e, a, req.HTTPRequest.Body) - } - - if e, a := c.WillRetry, req.WillRetry(); e != a { - t.Errorf("%d, expect %t willRetry, got %t", i, e, a) - } - - if req.Error == nil { - t.Fatalf("%d, expect error, got none", i) - } - if e, a := "some error", req.Error.Error(); !strings.Contains(a, e) { - t.Errorf("%d, expect %q error in %q", i, e, a) - } - if e, a := 0, req.RetryCount; e != a { - t.Errorf("%d, expect retry count to be %d, got %d", i, e, a) - } - } -} - -func Test501NotRetrying(t *testing.T) { - reqNum := 0 - reqs := []http.Response{ - {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, - {StatusCode: 501, Body: body(`{"__type":"NotImplemented","message":"An error occurred."}`)}, - {StatusCode: 200, Body: body(`{"data":"valid"}`)}, - } - - s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &reqs[reqNum] - reqNum++ - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - err := r.Send() - if err == nil { - t.Fatal("expect error, but got none") - } - - aerr := err.(awserr.Error) - if e, a := "NotImplemented", aerr.Code(); e != a { - t.Errorf("expected error code %q, but received %q", e, a) - } - if e, a := 1, r.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } -} - -func TestRequestNoConnection(t *testing.T) { - port, err := getFreePort() - if err != nil { - t.Fatalf("failed to get free port for test") - } - s := awstesting.NewClient(aws.NewConfig(). - WithMaxRetries(10). - WithEndpoint("https://localhost:" + strconv.Itoa(port)). - WithSleepDelay(func(time.Duration) {}), - ) - s.Handlers.Validate.Clear() - s.Handlers.Unmarshal.PushBack(unmarshal) - s.Handlers.UnmarshalError.PushBack(unmarshalError) - - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - - if err = r.Send(); err == nil { - t.Fatal("expect error, but got none") - } - - t.Logf("Error, %v", err) - awsError := err.(awserr.Error) - origError := awsError.OrigErr() - t.Logf("Orig Error: %#v of type %T", origError, origError) - - if e, a := 10, r.RetryCount; e != a { - t.Errorf("expect %v retry count, got %v", e, a) - } -} - -func TestRequestBodySeekFails(t *testing.T) { - s := awstesting.NewClient() - s.Handlers.Validate.Clear() - s.Handlers.Build.Clear() - - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - r.SetReaderBody(&stubSeekFail{ - Err: fmt.Errorf("failed to seek reader"), - }) - err := r.Send() - if err == nil { - t.Fatal("expect error, but got none") - } - - aerr := err.(awserr.Error) - if e, a := request.ErrCodeSerialization, aerr.Code(); e != a { - t.Errorf("expect %v error code, got %v", e, a) - } - -} - -type stubSeekFail struct { - Err error -} - -func (f *stubSeekFail) Read(b []byte) (int, error) { - return len(b), nil -} -func (f *stubSeekFail) ReadAt(b []byte, offset int64) (int, error) { - return len(b), nil -} -func (f *stubSeekFail) Seek(offset int64, mode int) (int64, error) { - return 0, f.Err -} - -func getFreePort() (int, error) { - l, err := net.Listen("tcp", ":0") - if err != nil { - return 0, err - } - defer l.Close() - - strAddr := l.Addr().String() - parts := strings.Split(strAddr, ":") - strPort := parts[len(parts)-1] - port, err := strconv.ParseInt(strPort, 10, 32) - if err != nil { - return 0, err - } - return int(port), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index 8015acc..478bae0 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -83,6 +83,7 @@ var retryableCodes = map[string]struct{}{ var throttleCodes = map[string]struct{}{ "ProvisionedThroughputExceededException": {}, + "ThrottledException": {}, // SNS, XRay, ResourceGroupsTagging API "Throttling": {}, "ThrottlingException": {}, "RequestLimitExceeded": {}, @@ -176,7 +177,7 @@ func shouldRetryError(origErr error) bool { origErr := err.OrigErr() var shouldRetry bool if origErr != nil { - shouldRetry := shouldRetryError(origErr) + shouldRetry = shouldRetryError(origErr) if err.Code() == "RequestError" && !shouldRetry { return false } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer_test.go deleted file mode 100644 index 96db17a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package request - -import ( - "errors" - "fmt" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client/metadata" -) - -func TestRequestThrottling(t *testing.T) { - req := Request{} - - req.Error = awserr.New("Throttling", "", nil) - if e, a := true, req.IsErrorThrottle(); e != a { - t.Errorf("expect %t to be throttled, was %t", e, a) - } -} - -type mockTempError bool - -func (e mockTempError) Error() string { - return fmt.Sprintf("mock temporary error: %t", e.Temporary()) -} -func (e mockTempError) Temporary() bool { - return bool(e) -} - -func TestIsErrorRetryable(t *testing.T) { - cases := []struct { - Err error - Retryable bool - }{ - { - Err: awserr.New(ErrCodeSerialization, "temporary error", mockTempError(true)), - Retryable: true, - }, - { - Err: awserr.New(ErrCodeSerialization, "temporary error", mockTempError(false)), - Retryable: false, - }, - { - Err: awserr.New(ErrCodeSerialization, "some error", errors.New("blah")), - Retryable: false, - }, - { - Err: awserr.New("SomeError", "some error", nil), - Retryable: false, - }, - { - Err: awserr.New("RequestError", "some error", nil), - Retryable: true, - }, - { - Err: nil, - Retryable: false, - }, - } - - for i, c := range cases { - retryable := IsErrorRetryable(c.Err) - if e, a := c.Retryable, retryable; e != a { - t.Errorf("%d, expect %t temporary error, got %t", i, e, a) - } - } -} - -func TestRequest_NilRetyer(t *testing.T) { - clientInfo := metadata.ClientInfo{Endpoint: "https://mock.region.amazonaws.com"} - req := New(aws.Config{}, clientInfo, Handlers{}, nil, &Operation{}, nil, nil) - - if req.Retryer == nil { - t.Fatalf("expect retryer to be set") - } - - if e, a := 0, req.MaxRetries(); e != a { - t.Errorf("expect no retries, got %v", a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_benchmark_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_benchmark_test.go deleted file mode 100644 index 33e1b2d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_benchmark_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package request_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -func BenchmarkTimeoutReadCloser(b *testing.B) { - resp := ` - { - "Bar": "qux" - } - ` - - handlers := request.Handlers{} - - handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(bytes.NewBuffer([]byte(resp))), - } - }) - handlers.Sign.PushBackNamed(v4.SignRequestHandler) - handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) - - op := &request.Operation{ - Name: "op", - HTTPMethod: "POST", - HTTPPath: "/", - } - - meta := metadata.ClientInfo{ - ServiceName: "fooService", - SigningName: "foo", - SigningRegion: "foo", - Endpoint: "localhost", - APIVersion: "2001-01-01", - JSONVersion: "1.1", - TargetPrefix: "Foo", - } - - req := request.New( - *unit.Session.Config, - meta, - handlers, - client.DefaultRetryer{NumMaxRetries: 5}, - op, - &struct { - Foo *string - }{}, - &struct { - Bar *string - }{}, - ) - - req.ApplyOptions(request.WithResponseReadTimeout(15 * time.Second)) - for i := 0; i < b.N; i++ { - err := req.Send() - if err != nil { - b.Errorf("Expected no error, but received %v", err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_test.go deleted file mode 100644 index 7851205..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package request - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -type testReader struct { - duration time.Duration - count int -} - -func (r *testReader) Read(b []byte) (int, error) { - if r.count > 0 { - r.count-- - return len(b), nil - } - time.Sleep(r.duration) - return 0, io.EOF -} - -func (r *testReader) Close() error { - return nil -} - -func TestTimeoutReadCloser(t *testing.T) { - reader := timeoutReadCloser{ - reader: &testReader{ - duration: time.Second, - count: 5, - }, - duration: time.Millisecond, - } - b := make([]byte, 100) - _, err := reader.Read(b) - if err != nil { - t.Log(err) - } -} - -func TestTimeoutReadCloserSameDuration(t *testing.T) { - reader := timeoutReadCloser{ - reader: &testReader{ - duration: time.Millisecond, - count: 5, - }, - duration: time.Millisecond, - } - b := make([]byte, 100) - _, err := reader.Read(b) - if err != nil { - t.Log(err) - } -} - -func TestWithResponseReadTimeout(t *testing.T) { - r := Request{ - HTTPRequest: &http.Request{}, - HTTPResponse: &http.Response{ - Body: ioutil.NopCloser(bytes.NewReader(nil)), - }, - } - r.ApplyOptions(WithResponseReadTimeout(time.Second)) - err := r.Send() - if err != nil { - t.Error(err) - } - v, ok := r.HTTPResponse.Body.(*timeoutReadCloser) - if !ok { - t.Error("Expected the body to be a timeoutReadCloser") - } - if v.duration != time.Second { - t.Errorf("Expected %v, but receive %v\n", time.Second, v.duration) - } -} - -func TestAdaptToResponseTimeout(t *testing.T) { - testCases := []struct { - childErr error - r Request - expectedRootCode string - }{ - { - childErr: awserr.New(ErrCodeResponseTimeout, "timeout!", nil), - r: Request{ - Error: awserr.New("ErrTest", "FooBar", awserr.New(ErrCodeResponseTimeout, "timeout!", nil)), - }, - expectedRootCode: ErrCodeResponseTimeout, - }, - { - childErr: awserr.New(ErrCodeResponseTimeout+"1", "timeout!", nil), - r: Request{ - Error: awserr.New("ErrTest", "FooBar", awserr.New(ErrCodeResponseTimeout+"1", "timeout!", nil)), - }, - expectedRootCode: "ErrTest", - }, - { - r: Request{ - Error: awserr.New("ErrTest", "FooBar", nil), - }, - expectedRootCode: "ErrTest", - }, - } - - for i, c := range testCases { - adaptToResponseTimeoutError(&c.r) - if aerr, ok := c.r.Error.(awserr.Error); !ok { - t.Errorf("Case %d: Expected 'awserr', but received %v", i+1, c.r.Error) - } else if aerr.Code() != c.expectedRootCode { - t.Errorf("Case %d: Expected %q, but received %s", i+1, c.expectedRootCode, aerr.Code()) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter_test.go deleted file mode 100644 index 7a9f29d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter_test.go +++ /dev/null @@ -1,678 +0,0 @@ -package request_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -type mockClient struct { - *client.Client -} -type MockInput struct{} -type MockOutput struct { - States []*MockState -} -type MockState struct { - State *string -} - -func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutput) { - op := &request.Operation{ - Name: "Mock", - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MockInput{} - } - - output := &MockOutput{} - req := c.NewRequest(op, input, output) - req.Data = output - return req, output -} - -func BuildNewMockRequest(c *mockClient, in *MockInput) func([]request.Option) (*request.Request, error) { - return func(opts []request.Option) (*request.Request, error) { - req, _ := c.MockRequest(in) - req.ApplyOptions(opts...) - return req, nil - } -} - -func TestWaiterPathAll(t *testing.T) { - svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - })} - svc.Handlers.Send.Clear() // mock sending - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.ValidateResponse.Clear() - - reqNum := 0 - resps := []*MockOutput{ - { // Request 1 - States: []*MockState{ - {State: aws.String("pending")}, - {State: aws.String("pending")}, - }, - }, - { // Request 2 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("pending")}, - }, - }, - { // Request 3 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("running")}, - }, - }, - } - - numBuiltReq := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - numBuiltReq++ - }) - svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { - if reqNum >= len(resps) { - t.Errorf("too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := 3, numBuiltReq; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, reqNum; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestWaiterPath(t *testing.T) { - svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - })} - svc.Handlers.Send.Clear() // mock sending - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.ValidateResponse.Clear() - - reqNum := 0 - resps := []*MockOutput{ - { // Request 1 - States: []*MockState{ - {State: aws.String("pending")}, - {State: aws.String("pending")}, - }, - }, - { // Request 2 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("pending")}, - }, - }, - { // Request 3 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("running")}, - }, - }, - } - - numBuiltReq := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - numBuiltReq++ - }) - svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { - if reqNum >= len(resps) { - t.Errorf("too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := 3, numBuiltReq; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, reqNum; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestWaiterFailure(t *testing.T) { - svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - })} - svc.Handlers.Send.Clear() // mock sending - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.ValidateResponse.Clear() - - reqNum := 0 - resps := []*MockOutput{ - { // Request 1 - States: []*MockState{ - {State: aws.String("pending")}, - {State: aws.String("pending")}, - }, - }, - { // Request 2 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("pending")}, - }, - }, - { // Request 3 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("stopping")}, - }, - }, - } - - numBuiltReq := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - numBuiltReq++ - }) - svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { - if reqNum >= len(resps) { - t.Errorf("too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, - Argument: "States[].State", - Expected: "stopping", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()).(awserr.Error) - if err == nil { - t.Errorf("expect error") - } - if e, a := request.WaiterResourceNotReadyErrorCode, err.Code(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "failed waiting for successful resource state", err.Message(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, numBuiltReq; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 3, reqNum; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestWaiterError(t *testing.T) { - svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - })} - svc.Handlers.Send.Clear() // mock sending - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.UnmarshalError.Clear() - svc.Handlers.ValidateResponse.Clear() - - reqNum := 0 - resps := []*MockOutput{ - { // Request 1 - States: []*MockState{ - {State: aws.String("pending")}, - {State: aws.String("pending")}, - }, - }, - { // Request 1, error case retry - }, - { // Request 2, error case failure - }, - { // Request 3 - States: []*MockState{ - {State: aws.String("running")}, - {State: aws.String("running")}, - }, - }, - } - reqErrs := make([]error, len(resps)) - reqErrs[1] = awserr.New("MockException", "mock exception message", nil) - reqErrs[2] = awserr.New("FailureException", "mock failure exception message", nil) - - numBuiltReq := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - numBuiltReq++ - }) - svc.Handlers.Send.PushBack(func(r *request.Request) { - code := 200 - if reqNum == 1 { - code = 400 - } - r.HTTPResponse = &http.Response{ - StatusCode: code, - Status: http.StatusText(code), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - }) - svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { - if reqNum >= len(resps) { - t.Errorf("too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - svc.Handlers.UnmarshalMeta.PushBack(func(r *request.Request) { - // If there was an error unmarshal error will be called instead of unmarshal - // need to increment count here also - if err := reqErrs[reqNum]; err != nil { - r.Error = err - reqNum++ - } - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Argument: "", - Expected: "MockException", - }, - { - State: request.FailureWaiterState, - Matcher: request.ErrorWaiterMatch, - Argument: "", - Expected: "FailureException", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - if err == nil { - t.Fatalf("expected error, but did not get one") - } - aerr := err.(awserr.Error) - if e, a := request.WaiterResourceNotReadyErrorCode, aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := 3, numBuiltReq; e != a { - t.Errorf("expect %d built requests got %d", e, a) - } - if e, a := 3, reqNum; e != a { - t.Errorf("expect %d reqNum got %d", e, a) - } -} - -func TestWaiterStatus(t *testing.T) { - svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ - Region: aws.String("mock-region"), - })} - svc.Handlers.Send.Clear() // mock sending - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.ValidateResponse.Clear() - - reqNum := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - reqNum++ - }) - svc.Handlers.Send.PushBack(func(r *request.Request) { - code := 200 - if reqNum == 3 { - code = 404 - r.Error = awserr.New("NotFound", "Not Found", nil) - } - r.HTTPResponse = &http.Response{ - StatusCode: code, - Status: http.StatusText(code), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Argument: "", - Expected: 404, - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := 3, reqNum; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestWaiter_ApplyOptions(t *testing.T) { - w := request.Waiter{} - - logger := aws.NewDefaultLogger() - - w.ApplyOptions( - request.WithWaiterLogger(logger), - request.WithWaiterRequestOptions(request.WithLogLevel(aws.LogDebug)), - request.WithWaiterMaxAttempts(2), - request.WithWaiterDelay(request.ConstantWaiterDelay(5*time.Second)), - ) - - if e, a := logger, w.Logger; e != a { - t.Errorf("expect logger to be set, and match, was not, %v, %v", e, a) - } - - if len(w.RequestOptions) != 1 { - t.Fatalf("expect request options to be set to only a single option, %v", w.RequestOptions) - } - r := request.Request{} - r.ApplyOptions(w.RequestOptions...) - if e, a := aws.LogDebug, r.Config.LogLevel.Value(); e != a { - t.Errorf("expect %v loglevel got %v", e, a) - } - - if e, a := 2, w.MaxAttempts; e != a { - t.Errorf("expect %d retryer max attempts, got %d", e, a) - } - if e, a := 5*time.Second, w.Delay(0); e != a { - t.Errorf("expect %d retryer delay, got %d", e, a) - } -} - -func TestWaiter_WithContextCanceled(t *testing.T) { - c := awstesting.NewClient() - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - reqCount := 0 - - w := request.Waiter{ - Name: "TestWaiter", - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(1 * time.Millisecond), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - }, - Logger: aws.NewDefaultLogger(), - NewRequest: func(opts []request.Option) (*request.Request, error) { - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - req.HTTPResponse = &http.Response{StatusCode: http.StatusNotFound} - req.Handlers.Clear() - req.Data = struct{}{} - req.Handlers.Send.PushBack(func(r *request.Request) { - if reqCount == 1 { - ctx.Error = fmt.Errorf("context canceled") - close(ctx.DoneCh) - } - reqCount++ - }) - - return req, nil - }, - } - - w.SleepWithContext = func(c aws.Context, delay time.Duration) error { - context := c.(*awstesting.FakeContext) - select { - case <-context.DoneCh: - return context.Err() - default: - return nil - } - } - - err := w.WaitWithContext(ctx) - - if err == nil { - t.Fatalf("expect waiter to be canceled.") - } - aerr := err.(awserr.Error) - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := 2, reqCount; e != a { - t.Errorf("expect %d requests, got %d", e, a) - } -} - -func TestWaiter_WithContext(t *testing.T) { - c := awstesting.NewClient() - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - reqCount := 0 - - statuses := []int{http.StatusNotFound, http.StatusOK} - - w := request.Waiter{ - Name: "TestWaiter", - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(1 * time.Millisecond), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - }, - Logger: aws.NewDefaultLogger(), - NewRequest: func(opts []request.Option) (*request.Request, error) { - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - req.HTTPResponse = &http.Response{StatusCode: statuses[reqCount]} - req.Handlers.Clear() - req.Data = struct{}{} - req.Handlers.Send.PushBack(func(r *request.Request) { - if reqCount == 1 { - ctx.Error = fmt.Errorf("context canceled") - close(ctx.DoneCh) - } - reqCount++ - }) - - return req, nil - }, - } - - err := w.WaitWithContext(ctx) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := 2, reqCount; e != a { - t.Errorf("expect %d requests, got %d", e, a) - } -} - -func TestWaiter_AttemptsExpires(t *testing.T) { - c := awstesting.NewClient() - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - reqCount := 0 - - w := request.Waiter{ - Name: "TestWaiter", - MaxAttempts: 2, - Delay: request.ConstantWaiterDelay(1 * time.Millisecond), - SleepWithContext: aws.SleepWithContext, - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - }, - Logger: aws.NewDefaultLogger(), - NewRequest: func(opts []request.Option) (*request.Request, error) { - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - req.HTTPResponse = &http.Response{StatusCode: http.StatusNotFound} - req.Handlers.Clear() - req.Data = struct{}{} - req.Handlers.Send.PushBack(func(r *request.Request) { - reqCount++ - }) - - return req, nil - }, - } - - err := w.WaitWithContext(ctx) - - if err == nil { - t.Fatalf("expect error did not get one") - } - aerr := err.(awserr.Error) - if e, a := request.WaiterResourceNotReadyErrorCode, aerr.Code(); e != a { - t.Errorf("expect %q error code, got %q", e, a) - } - if e, a := 2, reqCount; e != a { - t.Errorf("expect %d requests, got %d", e, a) - } -} - -func TestWaiterNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Session) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusOK, - } - }) - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - client.Config.SleepDelay = func(dur time.Duration) {} - - // Ensure waiters do not panic on nil input. It doesn't make sense to - // call a waiter without an input, Validation will - err := client.WaitUntilBucketExists(nil) - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } -} - -func TestWaiterWithContextNilInput(t *testing.T) { - // Code generation doesn't have a great way to verify the code is correct - // other than being run via unit tests in the SDK. This should be fixed - // So code generation can be validated independently. - - client := s3.New(unit.Session) - client.Handlers.Validate.Clear() - client.Handlers.Send.Clear() // mock sending - client.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusOK, - } - }) - client.Handlers.Unmarshal.Clear() - client.Handlers.UnmarshalMeta.Clear() - client.Handlers.ValidateResponse.Clear() - - // Ensure waiters do not panic on nil input - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - err := client.WaitUntilBucketExistsWithContext(ctx, nil, - request.WithWaiterDelay(request.ConstantWaiterDelay(0)), - request.WithWaiterMaxAttempts(1), - ) - if err != nil { - t.Fatalf("expect no error, but got %v", err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials_test.go deleted file mode 100644 index f0a636d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials_test.go +++ /dev/null @@ -1,592 +0,0 @@ -// +build go1.7 - -package session - -import ( - "fmt" - "net/http" - "net/http/httptest" - "os" - "reflect" - "runtime" - "strconv" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" - "github.com/aws/aws-sdk-go/service/sts" -) - -func setupCredentialsEndpoints(t *testing.T) (endpoints.Resolver, func()) { - origECSEndpoint := shareddefaults.ECSContainerCredentialsURI - - ecsMetadataServer := httptest.NewServer(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/ECS" { - w.Write([]byte(ecsResponse)) - } else { - w.Write([]byte("")) - } - })) - shareddefaults.ECSContainerCredentialsURI = ecsMetadataServer.URL - - ec2MetadataServer := httptest.NewServer(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/meta-data/iam/security-credentials/RoleName" { - w.Write([]byte(ec2MetadataResponse)) - } else if r.URL.Path == "/meta-data/iam/security-credentials/" { - w.Write([]byte("RoleName")) - } else { - w.Write([]byte("")) - } - })) - - stsServer := httptest.NewServer(http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf( - assumeRoleRespMsg, - time.Now(). - Add(15*time.Minute). - Format("2006-01-02T15:04:05Z")))) - })) - - resolver := endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - switch service { - case "ec2metadata": - return endpoints.ResolvedEndpoint{ - URL: ec2MetadataServer.URL, - }, nil - case "sts": - return endpoints.ResolvedEndpoint{ - URL: stsServer.URL, - }, nil - default: - return endpoints.ResolvedEndpoint{}, - fmt.Errorf("unknown service endpoint, %s", service) - } - }) - - return resolver, func() { - shareddefaults.ECSContainerCredentialsURI = origECSEndpoint - ecsMetadataServer.Close() - ec2MetadataServer.Close() - stsServer.Close() - } -} - -func TestSharedConfigCredentialSource(t *testing.T) { - const configFileForWindows = "testdata/credential_source_config_for_windows" - const configFile = "testdata/credential_source_config" - - cases := []struct { - name string - profile string - sessOptProfile string - expectedError error - expectedAccessKey string - expectedSecretKey string - expectedChain []string - init func() - dependentOnOS bool - }{ - { - name: "credential source and source profile", - profile: "invalid_source_and_credential_source", - expectedError: ErrSharedConfigSourceCollision, - init: func() { - os.Setenv("AWS_ACCESS_KEY", "access_key") - os.Setenv("AWS_SECRET_KEY", "secret_key") - }, - }, - { - name: "env var credential source", - sessOptProfile: "env_var_credential_source", - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - expectedChain: []string{ - "assume_role_w_creds_role_arn_env", - }, - init: func() { - os.Setenv("AWS_ACCESS_KEY", "access_key") - os.Setenv("AWS_SECRET_KEY", "secret_key") - }, - }, - { - name: "ec2metadata credential source", - profile: "ec2metadata", - expectedChain: []string{ - "assume_role_w_creds_role_arn_ec2", - }, - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - }, - { - name: "ecs container credential source", - profile: "ecscontainer", - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - expectedChain: []string{ - "assume_role_w_creds_role_arn_ecs", - }, - init: func() { - os.Setenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", "/ECS") - }, - }, - { - name: "chained assume role with env creds", - profile: "chained_assume_role", - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - expectedChain: []string{ - "assume_role_w_creds_role_arn_chain", - "assume_role_w_creds_role_arn_ec2", - }, - }, - { - name: "credential process with no ARN set", - profile: "cred_proc_no_arn_set", - dependentOnOS: true, - expectedAccessKey: "cred_proc_akid", - expectedSecretKey: "cred_proc_secret", - }, - { - name: "credential process with ARN set", - profile: "cred_proc_arn_set", - dependentOnOS: true, - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - expectedChain: []string{ - "assume_role_w_creds_proc_role_arn", - }, - }, - { - name: "chained assume role with credential process", - profile: "chained_cred_proc", - dependentOnOS: true, - expectedAccessKey: "AKID", - expectedSecretKey: "SECRET", - expectedChain: []string{ - "assume_role_w_creds_proc_source_prof", - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i)+"_"+c.name, func(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - if c.dependentOnOS && runtime.GOOS == "windows" { - os.Setenv("AWS_CONFIG_FILE", configFileForWindows) - } else { - os.Setenv("AWS_CONFIG_FILE", configFile) - } - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - if len(c.profile) != 0 { - os.Setenv("AWS_PROFILE", c.profile) - } - - endpointResolver, cleanupFn := setupCredentialsEndpoints(t) - defer cleanupFn() - - if c.init != nil { - c.init() - } - - var credChain []string - handlers := defaults.Handlers() - handlers.Sign.PushBack(func(r *request.Request) { - if r.Config.Credentials == credentials.AnonymousCredentials { - return - } - params := r.Params.(*sts.AssumeRoleInput) - credChain = append(credChain, *params.RoleArn) - }) - - sess, err := NewSessionWithOptions(Options{ - Profile: c.sessOptProfile, - Config: aws.Config{ - Logger: t, - EndpointResolver: endpointResolver, - }, - Handlers: handlers, - }) - if e, a := c.expectedError, err; e != a { - t.Fatalf("expected %v, but received %v", e, a) - } - - if c.expectedError != nil { - return - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Fatalf("expected no error, but received %v", err) - } - - if e, a := c.expectedChain, credChain; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := c.expectedAccessKey, creds.AccessKeyID; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := c.expectedSecretKey, creds.SecretAccessKey; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - }) - } -} - -const ecsResponse = `{ - "Code": "Success", - "Type": "AWS-HMAC", - "AccessKeyId" : "ecs-access-key", - "SecretAccessKey" : "ecs-secret-key", - "Token" : "token", - "Expiration" : "2100-01-01T00:00:00Z", - "LastUpdated" : "2009-11-23T0:00:00Z" - }` - -const ec2MetadataResponse = `{ - "Code": "Success", - "Type": "AWS-HMAC", - "AccessKeyId" : "ec2-access-key", - "SecretAccessKey" : "ec2-secret-key", - "Token" : "token", - "Expiration" : "2100-01-01T00:00:00Z", - "LastUpdated" : "2009-11-23T0:00:00Z" - }` - -const assumeRoleRespMsg = ` - - - - arn:aws:sts::account_id:assumed-role/role/session_name - AKID:session_name - - - AKID - SECRET - SESSION_TOKEN - %s - - - - request-id - - -` - -func TestSessionAssumeRole(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf( - assumeRoleRespMsg, - time.Now().Add(15*time.Minute).Format("2006-01-02T15:04:05Z")))) - })) - defer server.Close() - - s, err := NewSession(&aws.Config{ - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SESSION_TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "AssumeRoleProvider", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestSessionAssumeRole_WithMFA(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := r.FormValue("SerialNumber"), "0123456789"; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := r.FormValue("TokenCode"), "tokencode"; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "900", r.FormValue("DurationSeconds"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - w.Write([]byte(fmt.Sprintf( - assumeRoleRespMsg, - time.Now().Add(15*time.Minute).Format("2006-01-02T15:04:05Z")))) - })) - defer server.Close() - - customProviderCalled := false - sess, err := NewSessionWithOptions(Options{ - Profile: "assume_role_w_mfa", - Config: aws.Config{ - Region: aws.String("us-east-1"), - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }, - SharedConfigState: SharedConfigEnable, - AssumeRoleTokenProvider: func() (string, error) { - customProviderCalled = true - - return "tokencode", nil - }, - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if !customProviderCalled { - t.Errorf("expect true") - } - - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SESSION_TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "AssumeRoleProvider", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestSessionAssumeRole_WithMFA_NoTokenProvider(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - _, err := NewSessionWithOptions(Options{ - Profile: "assume_role_w_mfa", - SharedConfigState: SharedConfigEnable, - }) - if e, a := (AssumeRoleTokenProviderNotSetError{}), err; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSessionAssumeRole_DisableSharedConfig(t *testing.T) { - // Backwards compatibility with Shared config disabled - // assume role should not be built into the config. - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "0") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - s, err := NewSession(&aws.Config{ - CredentialsChainVerboseErrors: aws.Bool(true), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "assume_role_w_creds_akid", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "assume_role_w_creds_secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SharedConfigCredentials", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestSessionAssumeRole_InvalidSourceProfile(t *testing.T) { - // Backwards compatibility with Shared config disabled - // assume role should not be built into the config. - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_invalid_source_profile") - - s, err := NewSession() - if err == nil { - t.Fatalf("expect error, got none") - } - - expectMsg := "SharedConfigAssumeRoleError: failed to load assume role" - if e, a := expectMsg, err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - if s != nil { - t.Errorf("expect nil, %v", err) - } -} - -func TestSessionAssumeRole_ExtendedDuration(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := "1800", r.FormValue("DurationSeconds"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - w.Write([]byte(fmt.Sprintf( - assumeRoleRespMsg, - time.Now().Add(15*time.Minute).Format("2006-01-02T15:04:05Z")))) - })) - defer server.Close() - - s, err := NewSessionWithOptions(Options{ - Profile: "assume_role_w_creds", - Config: aws.Config{ - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }, - SharedConfigState: SharedConfigEnable, - AssumeRoleDuration: 30 * time.Minute, - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SESSION_TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "AssumeRoleProvider", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestSessionAssumeRole_WithMFA_ExtendedDuration(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "us-east-1") - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_w_creds") - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := "0123456789", r.FormValue("SerialNumber"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "tokencode", r.FormValue("TokenCode"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "1800", r.FormValue("DurationSeconds"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - w.Write([]byte(fmt.Sprintf( - assumeRoleRespMsg, - time.Now().Add(30*time.Minute).Format("2006-01-02T15:04:05Z")))) - })) - defer server.Close() - - customProviderCalled := false - sess, err := NewSessionWithOptions(Options{ - Profile: "assume_role_w_mfa", - Config: aws.Config{ - Region: aws.String("us-east-1"), - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }, - SharedConfigState: SharedConfigEnable, - AssumeRoleDuration: 30 * time.Minute, - AssumeRoleTokenProvider: func() (string, error) { - customProviderCalled = true - - return "tokencode", nil - }, - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := sess.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if !customProviderCalled { - t.Errorf("expect true") - } - - if e, a := "AKID", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SECRET", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "SESSION_TOKEN", creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "AssumeRoleProvider", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/csm_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/csm_test.go deleted file mode 100644 index 90da22b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/csm_test.go +++ /dev/null @@ -1,124 +0,0 @@ -// +build go1.7 - -package session - -import ( - "os" - "path/filepath" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func TestSession_loadCSMConfig(t *testing.T) { - defConfigFiles := []string{ - filepath.Join("testdata", "csm_shared_config"), - } - cases := map[string]struct { - Envs map[string]string - ConfigFiles []string - CSMProfile string - - Expect csmConfig - Err string - }{ - "no config": { - Envs: map[string]string{}, - Expect: csmConfig{}, - ConfigFiles: defConfigFiles, - CSMProfile: "aws_csm_empty", - }, - "env enabled": { - Envs: map[string]string{ - "AWS_CSM_ENABLED": "true", - "AWS_CSM_PORT": "4321", - "AWS_CSM_HOST": "ahost", - "AWS_CSM_CLIENT_ID": "client id", - }, - Expect: csmConfig{ - Enabled: true, - Port: "4321", - Host: "ahost", - ClientID: "client id", - }, - }, - "shared cfg enabled": { - ConfigFiles: defConfigFiles, - Expect: csmConfig{ - Enabled: true, - Port: "1234", - Host: "bar", - ClientID: "foo", - }, - }, - "mixed cfg, use env": { - Envs: map[string]string{ - "AWS_CSM_ENABLED": "true", - }, - ConfigFiles: defConfigFiles, - Expect: csmConfig{ - Enabled: true, - }, - }, - "mixed cfg, use env disabled": { - Envs: map[string]string{ - "AWS_CSM_ENABLED": "false", - }, - ConfigFiles: defConfigFiles, - Expect: csmConfig{ - Enabled: false, - }, - }, - "mixed cfg, use shared config": { - Envs: map[string]string{ - "AWS_CSM_PORT": "4321", - }, - ConfigFiles: defConfigFiles, - Expect: csmConfig{ - Enabled: true, - Port: "1234", - Host: "bar", - ClientID: "foo", - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - restoreFn := sdktesting.StashEnv() - defer restoreFn() - - if len(c.CSMProfile) != 0 { - csmProfile := csmProfileName - defer func() { - csmProfileName = csmProfile - }() - csmProfileName = c.CSMProfile - } - - for name, v := range c.Envs { - os.Setenv(name, v) - } - - envCfg, err := loadEnvConfig() - if err != nil { - t.Fatalf("failed to load the envcfg, %v", err) - } - csmCfg, err := loadCSMConfig(envCfg, c.ConfigFiles) - if len(c.Err) != 0 { - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := c.Err, err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v in error %v", e, a) - } - return - } - - if e, a := c.Expect, csmCfg; e != a { - t.Errorf("expect %v CSM config got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/custom_ca_bundle_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/custom_ca_bundle_test.go deleted file mode 100644 index 7dd5b91..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/custom_ca_bundle_test.go +++ /dev/null @@ -1,271 +0,0 @@ -package session - -import ( - "bytes" - "fmt" - "net" - "net/http" - "os" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/awstesting" -) - -var TLSBundleCertFile string -var TLSBundleKeyFile string -var TLSBundleCAFile string - -func TestMain(m *testing.M) { - var err error - - TLSBundleCertFile, TLSBundleKeyFile, TLSBundleCAFile, err = awstesting.CreateTLSBundleFiles() - if err != nil { - panic(err) - } - - fmt.Println("TestMain", TLSBundleCertFile, TLSBundleKeyFile) - - code := m.Run() - - err = awstesting.CleanupTLSBundleFiles(TLSBundleCertFile, TLSBundleKeyFile, TLSBundleCAFile) - if err != nil { - panic(err) - } - - os.Exit(code) -} - -func TestNewSession_WithCustomCABundle_Env(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - endpoint, err := awstesting.CreateTLSServer(TLSBundleCertFile, TLSBundleKeyFile, nil) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - os.Setenv("AWS_CA_BUNDLE", TLSBundleCAFile) - - s, err := NewSession(&aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(endpoint), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if s == nil { - t.Fatalf("expect session to be created, got none") - } - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} - -func TestNewSession_WithCustomCABundle_EnvNotExists(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_CA_BUNDLE", "file-not-exists") - - s, err := NewSession() - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "LoadCustomCABundleError", err.(awserr.Error).Code(); e != a { - t.Errorf("expect %s error code, got %s", e, a) - } - if s != nil { - t.Errorf("expect nil session, got %v", s) - } -} - -func TestNewSession_WithCustomCABundle_Option(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - endpoint, err := awstesting.CreateTLSServer(TLSBundleCertFile, TLSBundleKeyFile, nil) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(endpoint), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }, - CustomCABundle: bytes.NewReader(awstesting.TLSBundleCA), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if s == nil { - t.Fatalf("expect session to be created, got none") - } - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} - -func TestNewSession_WithCustomCABundle_HTTPProxyAvailable(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{}, - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }, - CustomCABundle: bytes.NewReader(awstesting.TLSBundleCA), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if s == nil { - t.Fatalf("expect session to be created, got none") - } - - tr := s.Config.HTTPClient.Transport.(*http.Transport) - if tr.Proxy == nil { - t.Fatalf("expect transport proxy, was nil") - } - if tr.TLSClientConfig.RootCAs == nil { - t.Fatalf("expect TLS config to have root CAs") - } -} - -func TestNewSession_WithCustomCABundle_OptionPriority(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - endpoint, err := awstesting.CreateTLSServer(TLSBundleCertFile, TLSBundleKeyFile, nil) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - os.Setenv("AWS_CA_BUNDLE", "file-not-exists") - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(endpoint), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }, - CustomCABundle: bytes.NewReader(awstesting.TLSBundleCA), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if s == nil { - t.Fatalf("expect session to be created, got none") - } - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} - -type mockRoundTripper struct{} - -func (m *mockRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - return nil, nil -} - -func TestNewSession_WithCustomCABundle_UnsupportedTransport(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{ - Transport: &mockRoundTripper{}, - }, - }, - CustomCABundle: bytes.NewReader(awstesting.TLSBundleCA), - }) - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "LoadCustomCABundleError", err.(awserr.Error).Code(); e != a { - t.Errorf("expect %s error code, got %s", e, a) - } - if s != nil { - t.Errorf("expect nil session, got %v", s) - } - aerrMsg := err.(awserr.Error).Message() - if e, a := "transport unsupported type", aerrMsg; !strings.Contains(a, e) { - t.Errorf("expect %s to be in %s", e, a) - } -} - -func TestNewSession_WithCustomCABundle_TransportSet(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - endpoint, err := awstesting.CreateTLSServer(TLSBundleCertFile, TLSBundleKeyFile, nil) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - Endpoint: aws.String(endpoint), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - HTTPClient: &http.Client{ - Transport: &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).Dial, - TLSHandshakeTimeout: 2 * time.Second, - }, - }, - }, - CustomCABundle: bytes.NewReader(awstesting.TLSBundleCA), - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if s == nil { - t.Fatalf("expect session to be created, got none") - } - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %d status code, got %d", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go deleted file mode 100644 index e106dbf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go +++ /dev/null @@ -1,353 +0,0 @@ -// +build go1.7 - -package session - -import ( - "os" - "reflect" - "strconv" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func TestLoadEnvConfig_Creds(t *testing.T) { - cases := []struct { - Env map[string]string - Val credentials.Value - }{ - { - Env: map[string]string{ - "AWS_ACCESS_KEY": "AKID", - }, - Val: credentials.Value{}, - }, - { - Env: map[string]string{ - "AWS_ACCESS_KEY_ID": "AKID", - }, - Val: credentials.Value{}, - }, - { - Env: map[string]string{ - "AWS_SECRET_KEY": "SECRET", - }, - Val: credentials.Value{}, - }, - { - Env: map[string]string{ - "AWS_SECRET_ACCESS_KEY": "SECRET", - }, - Val: credentials.Value{}, - }, - { - Env: map[string]string{ - "AWS_ACCESS_KEY_ID": "AKID", - "AWS_SECRET_ACCESS_KEY": "SECRET", - }, - Val: credentials.Value{ - AccessKeyID: "AKID", SecretAccessKey: "SECRET", - ProviderName: "EnvConfigCredentials", - }, - }, - { - Env: map[string]string{ - "AWS_ACCESS_KEY": "AKID", - "AWS_SECRET_KEY": "SECRET", - }, - Val: credentials.Value{ - AccessKeyID: "AKID", SecretAccessKey: "SECRET", - ProviderName: "EnvConfigCredentials", - }, - }, - { - Env: map[string]string{ - "AWS_ACCESS_KEY": "AKID", - "AWS_SECRET_KEY": "SECRET", - "AWS_SESSION_TOKEN": "TOKEN", - }, - Val: credentials.Value{ - AccessKeyID: "AKID", SecretAccessKey: "SECRET", SessionToken: "TOKEN", - ProviderName: "EnvConfigCredentials", - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i), func(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - for k, v := range c.Env { - os.Setenv(k, v) - } - - cfg, err := loadEnvConfig() - if err != nil { - t.Fatalf("failed to load env config, %v", err) - } - if !reflect.DeepEqual(c.Val, cfg.Creds) { - t.Errorf("expect credentials to match.\n%s", - awstesting.SprintExpectActual(c.Val, cfg.Creds)) - } - }) - - } -} - -func TestLoadEnvConfig(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - cases := []struct { - Env map[string]string - UseSharedConfigCall bool - Config envConfig - }{ - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_PROFILE": "profile", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Config: envConfig{ - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Config: envConfig{ - Region: "default_region", Profile: "default_profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_PROFILE": "profile", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Config: envConfig{ - Region: "region", Profile: "profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Config: envConfig{ - Region: "default_region", Profile: "default_profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Config: envConfig{ - Region: "default_region", Profile: "default_profile", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_CA_BUNDLE": "custom_ca_bundle", - }, - Config: envConfig{ - CustomCABundle: "custom_ca_bundle", - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_CA_BUNDLE": "custom_ca_bundle", - }, - Config: envConfig{ - CustomCABundle: "custom_ca_bundle", - EnableSharedConfig: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_SHARED_CREDENTIALS_FILE": "/path/to/credentials/file", - "AWS_CONFIG_FILE": "/path/to/config/file", - }, - Config: envConfig{ - SharedCredentialsFile: "/path/to/credentials/file", - SharedConfigFile: "/path/to/config/file", - }, - }, - { - Env: map[string]string{ - "AWS_STS_REGIONAL_ENDPOINTS": "regional", - }, - Config: envConfig{ - STSRegionalEndpoint: endpoints.RegionalSTSEndpoint, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT": "regional", - }, - Config: envConfig{ - S3UsEast1RegionalEndpoint: endpoints.RegionalS3UsEast1Endpoint, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - { - Env: map[string]string{ - "AWS_S3_USE_ARN_REGION": "true", - }, - Config: envConfig{ - S3UseARNRegion: true, - SharedCredentialsFile: shareddefaults.SharedCredentialsFilename(), - SharedConfigFile: shareddefaults.SharedConfigFilename(), - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i), func(t *testing.T) { - restoreEnvFn = sdktesting.StashEnv() - defer restoreEnvFn() - for k, v := range c.Env { - os.Setenv(k, v) - } - - var cfg envConfig - var err error - if c.UseSharedConfigCall { - cfg, err = loadSharedEnvConfig() - if err != nil { - t.Errorf("failed to load shared env config, %v", err) - } - } else { - cfg, err = loadEnvConfig() - if err != nil { - t.Errorf("failed to load env config, %v", err) - } - } - - if !reflect.DeepEqual(c.Config, cfg) { - t.Errorf("expect config to match.\n%s", - awstesting.SprintExpectActual(c.Config, cfg)) - } - }) - } -} - -func TestSetEnvValue(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("empty_key", "") - os.Setenv("second_key", "2") - os.Setenv("third_key", "3") - - var dst string - setFromEnvVal(&dst, []string{ - "empty_key", "first_key", "second_key", "third_key", - }) - - if e, a := "2", dst; e != a { - t.Errorf("expect %s value from environment, got %s", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go deleted file mode 100644 index 3001739..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go +++ /dev/null @@ -1,662 +0,0 @@ -// +build go1.7 - -package session - -import ( - "bytes" - "fmt" - "net/http" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/defaults" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestNewDefaultSession(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - s := New(&aws.Config{Region: aws.String("region")}) - - if e, a := "region", *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := http.DefaultClient, s.Config.HTTPClient; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if s.Config.Logger == nil { - t.Errorf("expect not nil") - } - if e, a := aws.LogOff, *s.Config.LogLevel; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestNew_WithCustomCreds(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - customCreds := credentials.NewStaticCredentials("AKID", "SECRET", "TOKEN") - s := New(&aws.Config{Credentials: customCreds}) - - if e, a := customCreds, s.Config.Credentials; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -type mockLogger struct { - *bytes.Buffer -} - -func (w mockLogger) Log(args ...interface{}) { - fmt.Fprintln(w, args...) -} - -func TestNew_WithSessionLoadError(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_CONFIG_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "assume_role_invalid_source_profile") - - logger := bytes.Buffer{} - s := New(&aws.Config{Logger: &mockLogger{&logger}}) - - if s == nil { - t.Errorf("expect not nil") - } - - svc := s3.New(s) - _, err := svc.ListBuckets(&s3.ListBucketsInput{}) - - if err == nil { - t.Errorf("expect not nil") - } - if e, a := "ERROR: failed to create session with AWS_SDK_LOAD_CONFIG enabled", logger.String(); !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - - expectErr := SharedConfigAssumeRoleError{ - RoleARN: "assume_role_invalid_source_profile_role_arn", - SourceProfile: "profile_not_exists", - } - if e, a := expectErr.Error(), err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestSessionCopy(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_REGION", "orig_region") - - s := Session{ - Config: defaults.Config(), - Handlers: defaults.Handlers(), - } - - newSess := s.Copy(&aws.Config{Region: aws.String("new_region")}) - - if e, a := "orig_region", *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "new_region", *newSess.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSessionClientConfig(t *testing.T) { - s, err := NewSession(&aws.Config{ - Credentials: credentials.AnonymousCredentials, - Region: aws.String("orig_region"), - EndpointResolver: endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - if e, a := "mock-service", service; e != a { - t.Errorf("expect %q service, got %q", e, a) - } - if e, a := "other-region", region; e != a { - t.Errorf("expect %q region, got %q", e, a) - } - return endpoints.ResolvedEndpoint{ - URL: "https://" + service + "." + region + ".amazonaws.com", - SigningRegion: region, - }, nil - }, - ), - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - cfg := s.ClientConfig("mock-service", &aws.Config{Region: aws.String("other-region")}) - - if e, a := "https://mock-service.other-region.amazonaws.com", cfg.Endpoint; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "other-region", cfg.SigningRegion; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "other-region", *cfg.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestNewSession_ResolveEndpointError(t *testing.T) { - logger := mockLogger{Buffer: bytes.NewBuffer(nil)} - sess, err := NewSession(defaults.Config(), &aws.Config{ - Region: aws.String(""), - Logger: logger, - EndpointResolver: endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - return endpoints.ResolvedEndpoint{}, fmt.Errorf("mock error") - }, - ), - }) - if err != nil { - t.Fatalf("expect no error got %v", err) - } - - cfg := sess.ClientConfig("mock service") - - var r request.Request - cfg.Handlers.Validate.Run(&r) - - if r.Error == nil { - t.Fatalf("expect validation error, got none") - } - - if e, a := aws.ErrMissingRegion.Error(), r.Error.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v validation error, got %v", e, a) - } - - if e, a := "unable to resolve", logger.Buffer.String(); !strings.Contains(a, e) { - t.Errorf("expect %v logged, got %v", e, a) - } -} - -func TestNewSession_NoCredentials(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - s, err := NewSession() - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if s.Config.Credentials == nil { - t.Errorf("expect not nil") - } - if e, a := credentials.AnonymousCredentials, s.Config.Credentials; e == a { - t.Errorf("expect different credentials, %v", e) - } -} - -func TestNewSessionWithOptions_OverrideProfile(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "other_profile") - - s, err := NewSessionWithOptions(Options{ - Profile: "full_profile", - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if e, a := "full_profile_region", *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := "full_profile_akid", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "full_profile_secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if e, a := "SharedConfigCredentials", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestNewSessionWithOptions_OverrideSharedConfigEnable(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "0") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "full_profile") - - s, err := NewSessionWithOptions(Options{ - SharedConfigState: SharedConfigEnable, - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if e, a := "full_profile_region", *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := "full_profile_akid", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "full_profile_secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if e, a := "SharedConfigCredentials", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestNewSessionWithOptions_OverrideSharedConfigDisable(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "full_profile") - - s, err := NewSessionWithOptions(Options{ - SharedConfigState: SharedConfigDisable, - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if v := *s.Config.Region; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := "full_profile_akid", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "full_profile_secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if e, a := "SharedConfigCredentials", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestNewSessionWithOptions_OverrideSharedConfigFiles(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - os.Setenv("AWS_SDK_LOAD_CONFIG", "1") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", testConfigFilename) - os.Setenv("AWS_PROFILE", "config_file_load_order") - - s, err := NewSessionWithOptions(Options{ - SharedConfigFiles: []string{testConfigOtherFilename}, - }) - if err != nil { - t.Errorf("expect nil, %v", err) - } - - if e, a := "shared_config_other_region", *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := "shared_config_other_akid", creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "shared_config_other_secret", creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if v := creds.SessionToken; len(v) != 0 { - t.Errorf("expect empty, got %v", v) - } - if e, a := "SharedConfigCredentials", creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } -} - -func TestNewSessionWithOptions_Overrides(t *testing.T) { - cases := map[string]struct { - InEnvs map[string]string - InProfile string - OutRegion string - OutCreds credentials.Value - }{ - "env profile with opt profile": { - InEnvs: map[string]string{ - "AWS_SDK_LOAD_CONFIG": "0", - "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, - "AWS_PROFILE": "other_profile", - }, - InProfile: "full_profile", - OutRegion: "full_profile_region", - OutCreds: credentials.Value{ - AccessKeyID: "full_profile_akid", - SecretAccessKey: "full_profile_secret", - ProviderName: "SharedConfigCredentials", - }, - }, - "env creds with env profile": { - InEnvs: map[string]string{ - "AWS_SDK_LOAD_CONFIG": "0", - "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, - "AWS_REGION": "env_region", - "AWS_ACCESS_KEY": "env_akid", - "AWS_SECRET_ACCESS_KEY": "env_secret", - "AWS_PROFILE": "other_profile", - }, - OutRegion: "env_region", - OutCreds: credentials.Value{ - AccessKeyID: "env_akid", - SecretAccessKey: "env_secret", - ProviderName: "EnvConfigCredentials", - }, - }, - "env creds with opt profile": { - InEnvs: map[string]string{ - "AWS_SDK_LOAD_CONFIG": "0", - "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, - "AWS_REGION": "env_region", - "AWS_ACCESS_KEY": "env_akid", - "AWS_SECRET_ACCESS_KEY": "env_secret", - "AWS_PROFILE": "other_profile", - }, - InProfile: "full_profile", - OutRegion: "env_region", - OutCreds: credentials.Value{ - AccessKeyID: "full_profile_akid", - SecretAccessKey: "full_profile_secret", - ProviderName: "SharedConfigCredentials", - }, - }, - "cfg and cred file with opt profile": { - InEnvs: map[string]string{ - "AWS_SDK_LOAD_CONFIG": "0", - "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, - "AWS_CONFIG_FILE": testConfigOtherFilename, - "AWS_PROFILE": "other_profile", - }, - InProfile: "config_file_load_order", - OutRegion: "shared_config_region", - OutCreds: credentials.Value{ - AccessKeyID: "shared_config_akid", - SecretAccessKey: "shared_config_secret", - ProviderName: "SharedConfigCredentials", - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - for k, v := range c.InEnvs { - os.Setenv(k, v) - } - - s, err := NewSessionWithOptions(Options{ - Profile: c.InProfile, - SharedConfigState: SharedConfigEnable, - }) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := c.OutRegion, *s.Config.Region; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.OutCreds.AccessKeyID, creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.OutCreds.SecretAccessKey, creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.OutCreds.SessionToken, creds.SessionToken; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.OutCreds.ProviderName, creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - }) - } -} - -func TestNewSession_EnvCredsWithInvalidConfigFile(t *testing.T) { - cases := map[string]struct { - AccessKey, SecretKey string - Profile string - Options Options - ExpectCreds credentials.Value - Err string - }{ - "no options": { - Err: "SharedConfigLoadError", - }, - "env only": { - AccessKey: "env_akid", - SecretKey: "env_secret", - ExpectCreds: credentials.Value{ - AccessKeyID: "env_akid", - SecretAccessKey: "env_secret", - ProviderName: "EnvConfigCredentials", - }, - }, - "static credentials only": { - Options: Options{ - Config: aws.Config{ - Credentials: credentials.NewStaticCredentials( - "AKID", "SECRET", ""), - }, - }, - ExpectCreds: credentials.Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - ProviderName: "StaticProvider", - }, - }, - "env profile and env": { - AccessKey: "env_akid", - SecretKey: "env_secret", - Profile: "env_profile", - Err: "SharedConfigLoadError", - }, - "opt profile and env": { - AccessKey: "env_akid", - SecretKey: "env_secret", - Options: Options{ - Profile: "someProfile", - }, - Err: "SharedConfigLoadError", - }, - "cfg enabled": { - AccessKey: "env_akid", - SecretKey: "env_secret", - Options: Options{ - SharedConfigState: SharedConfigEnable, - }, - Err: "SharedConfigLoadError", - }, - } - - var cfgFile = filepath.Join("testdata", "shared_config_invalid_ini") - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - if v := c.AccessKey; len(v) != 0 { - os.Setenv("AWS_ACCESS_KEY", v) - } - if v := c.SecretKey; len(v) != 0 { - os.Setenv("AWS_SECRET_ACCESS_KEY", v) - } - if v := c.Profile; len(v) != 0 { - os.Setenv("AWS_PROFILE", v) - } - - opts := c.Options - opts.SharedConfigFiles = []string{cfgFile} - s, err := NewSessionWithOptions(opts) - if len(c.Err) != 0 { - if err == nil { - t.Fatalf("expect session error, got none") - } - if e, a := c.Err, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect session error to contain %q, got %v", e, a) - } - return - } - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - creds, err := s.Config.Credentials.Get() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := c.ExpectCreds.AccessKeyID, creds.AccessKeyID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.ExpectCreds.SecretAccessKey, creds.SecretAccessKey; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := c.ExpectCreds.ProviderName, creds.ProviderName; !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - }) - } -} - -func TestSession_RegionalEndpoints(t *testing.T) { - cases := map[string]struct { - Env map[string]string - Config aws.Config - - ExpectErr string - ExpectSTS endpoints.STSRegionalEndpoint - ExpectS3UsEast1 endpoints.S3UsEast1RegionalEndpoint - }{ - "default": { - ExpectSTS: endpoints.LegacySTSEndpoint, - ExpectS3UsEast1: endpoints.LegacyS3UsEast1Endpoint, - }, - "enable regional": { - Config: aws.Config{ - STSRegionalEndpoint: endpoints.RegionalSTSEndpoint, - S3UsEast1RegionalEndpoint: endpoints.RegionalS3UsEast1Endpoint, - }, - ExpectSTS: endpoints.RegionalSTSEndpoint, - ExpectS3UsEast1: endpoints.RegionalS3UsEast1Endpoint, - }, - "sts env enable": { - Env: map[string]string{ - "AWS_STS_REGIONAL_ENDPOINTS": "regional", - }, - ExpectSTS: endpoints.RegionalSTSEndpoint, - ExpectS3UsEast1: endpoints.LegacyS3UsEast1Endpoint, - }, - "sts us-east-1 env merge enable": { - Env: map[string]string{ - "AWS_STS_REGIONAL_ENDPOINTS": "legacy", - }, - Config: aws.Config{ - STSRegionalEndpoint: endpoints.RegionalSTSEndpoint, - }, - ExpectSTS: endpoints.RegionalSTSEndpoint, - ExpectS3UsEast1: endpoints.LegacyS3UsEast1Endpoint, - }, - "s3 us-east-1 env enable": { - Env: map[string]string{ - "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT": "regional", - }, - ExpectSTS: endpoints.LegacySTSEndpoint, - ExpectS3UsEast1: endpoints.RegionalS3UsEast1Endpoint, - }, - "s3 us-east-1 env merge enable": { - Env: map[string]string{ - "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT": "legacy", - }, - Config: aws.Config{ - S3UsEast1RegionalEndpoint: endpoints.RegionalS3UsEast1Endpoint, - }, - ExpectSTS: endpoints.LegacySTSEndpoint, - ExpectS3UsEast1: endpoints.RegionalS3UsEast1Endpoint, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - restoreEnvFn := initSessionTestEnv() - defer restoreEnvFn() - - for k, v := range c.Env { - os.Setenv(k, v) - } - - s, err := NewSession(&c.Config) - if len(c.ExpectErr) != 0 { - if err == nil { - t.Fatalf("expect session error, got none") - } - if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect session error to contain %q, got %v", e, a) - } - return - } - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := c.ExpectSTS, s.Config.STSRegionalEndpoint; e != a { - t.Errorf("expect %v STSRegionalEndpoint, got %v", e, a) - } - - if e, a := c.ExpectS3UsEast1, s.Config.S3UsEast1RegionalEndpoint; e != a { - t.Errorf("expect %v S3UsEast1RegionalEndpoint, got %v", e, a) - } - - // Asserts - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go deleted file mode 100644 index cfe530f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go +++ /dev/null @@ -1,376 +0,0 @@ -// +build go1.7 - -package session - -import ( - "fmt" - "path/filepath" - "reflect" - "strconv" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/internal/ini" -) - -var ( - testConfigFilename = filepath.Join("testdata", "shared_config") - testConfigOtherFilename = filepath.Join("testdata", "shared_config_other") -) - -func TestLoadSharedConfig(t *testing.T) { - cases := []struct { - Filenames []string - Profile string - Expected sharedConfig - Err error - }{ - { - Filenames: []string{"file_not_exists"}, - Profile: "default", - Expected: sharedConfig{}, - }, - { - Filenames: []string{testConfigFilename}, - Expected: sharedConfig{ - Region: "default_region", - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "config_file_load_order", - Expected: sharedConfig{ - Region: "shared_config_region", - Creds: credentials.Value{ - AccessKeyID: "shared_config_akid", - SecretAccessKey: "shared_config_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - { - Filenames: []string{testConfigFilename, testConfigOtherFilename}, - Profile: "config_file_load_order", - Expected: sharedConfig{ - Region: "shared_config_other_region", - Creds: credentials.Value{ - AccessKeyID: "shared_config_other_akid", - SecretAccessKey: "shared_config_other_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigOtherFilename), - }, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role", - Expected: sharedConfig{ - RoleARN: "assume_role_role_arn", - SourceProfileName: "complete_creds", - SourceProfile: &sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "complete_creds_akid", - SecretAccessKey: "complete_creds_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role_invalid_source_profile", - Expected: sharedConfig{ - RoleARN: "assume_role_invalid_source_profile_role_arn", - SourceProfileName: "profile_not_exists", - }, - Err: SharedConfigAssumeRoleError{ - RoleARN: "assume_role_invalid_source_profile_role_arn", - SourceProfile: "profile_not_exists", - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role_w_creds", - Expected: sharedConfig{ - RoleARN: "assume_role_w_creds_role_arn", - ExternalID: "1234", - RoleSessionName: "assume_role_w_creds_session_name", - SourceProfileName: "assume_role_w_creds", - SourceProfile: &sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "assume_role_w_creds_akid", - SecretAccessKey: "assume_role_w_creds_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role_wo_creds", - Expected: sharedConfig{ - RoleARN: "assume_role_wo_creds_role_arn", - SourceProfileName: "assume_role_wo_creds", - }, - Err: SharedConfigAssumeRoleError{ - RoleARN: "assume_role_wo_creds_role_arn", - SourceProfile: "assume_role_wo_creds", - }, - }, - { - Filenames: []string{filepath.Join("testdata", "shared_config_invalid_ini")}, - Profile: "profile_name", - Err: SharedConfigLoadError{Filename: filepath.Join("testdata", "shared_config_invalid_ini")}, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role_with_credential_source", - Expected: sharedConfig{ - RoleARN: "assume_role_with_credential_source_role_arn", - CredentialSource: credSourceEc2Metadata, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "multiple_assume_role", - Expected: sharedConfig{ - RoleARN: "multiple_assume_role_role_arn", - SourceProfileName: "assume_role", - SourceProfile: &sharedConfig{ - RoleARN: "assume_role_role_arn", - SourceProfileName: "complete_creds", - SourceProfile: &sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "complete_creds_akid", - SecretAccessKey: "complete_creds_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "multiple_assume_role_with_credential_source", - Expected: sharedConfig{ - RoleARN: "multiple_assume_role_with_credential_source_role_arn", - SourceProfileName: "assume_role_with_credential_source", - SourceProfile: &sharedConfig{ - RoleARN: "assume_role_with_credential_source_role_arn", - CredentialSource: credSourceEc2Metadata, - }, - }, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "multiple_assume_role_with_credential_source2", - Expected: sharedConfig{ - RoleARN: "multiple_assume_role_with_credential_source2_role_arn", - SourceProfileName: "multiple_assume_role_with_credential_source", - SourceProfile: &sharedConfig{ - RoleARN: "multiple_assume_role_with_credential_source_role_arn", - SourceProfileName: "assume_role_with_credential_source", - SourceProfile: &sharedConfig{ - RoleARN: "assume_role_with_credential_source_role_arn", - CredentialSource: credSourceEc2Metadata, - }, - }, - }, - }, - { - Filenames: []string{testConfigFilename}, - Profile: "with_sts_regional", - Expected: sharedConfig{ - STSRegionalEndpoint: endpoints.RegionalSTSEndpoint, - }, - }, - { - Filenames: []string{testConfigFilename}, - Profile: "with_s3_us_east_1_regional", - Expected: sharedConfig{ - S3UsEast1RegionalEndpoint: endpoints.RegionalS3UsEast1Endpoint, - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i)+"_"+c.Profile, func(t *testing.T) { - cfg, err := loadSharedConfig(c.Profile, c.Filenames, true) - if c.Err != nil { - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := c.Err.Error(), err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - return - } - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := c.Expected, cfg; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - }) - } -} - -func TestLoadSharedConfigFromFile(t *testing.T) { - filename := testConfigFilename - f, err := ini.OpenFile(filename) - if err != nil { - t.Fatalf("failed to load test config file, %s, %v", filename, err) - } - iniFile := sharedConfigFile{IniData: f, Filename: filename} - - cases := []struct { - Profile string - Expected sharedConfig - Err error - }{ - { - Profile: "default", - Expected: sharedConfig{Region: "default_region"}, - }, - { - Profile: "alt_profile_name", - Expected: sharedConfig{Region: "alt_profile_name_region"}, - }, - { - Profile: "short_profile_name_first", - Expected: sharedConfig{Region: "short_profile_name_first_short"}, - }, - { - Profile: "partial_creds", - Expected: sharedConfig{}, - }, - { - Profile: "complete_creds", - Expected: sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "complete_creds_akid", - SecretAccessKey: "complete_creds_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - { - Profile: "complete_creds_with_token", - Expected: sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "complete_creds_with_token_akid", - SecretAccessKey: "complete_creds_with_token_secret", - SessionToken: "complete_creds_with_token_token", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - }, - }, - { - Profile: "full_profile", - Expected: sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "full_profile_akid", - SecretAccessKey: "full_profile_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - Region: "full_profile_region", - }, - }, - { - Profile: "partial_assume_role", - Expected: sharedConfig{ - RoleARN: "partial_assume_role_role_arn", - }, - }, - { - Profile: "assume_role", - Expected: sharedConfig{ - RoleARN: "assume_role_role_arn", - SourceProfileName: "complete_creds", - }, - }, - { - Profile: "assume_role_w_mfa", - Expected: sharedConfig{ - RoleARN: "assume_role_role_arn", - SourceProfileName: "complete_creds", - MFASerial: "0123456789", - }, - }, - { - Profile: "does_not_exists", - Err: SharedConfigProfileNotExistsError{Profile: "does_not_exists"}, - }, - { - Profile: "valid_arn_region", - Expected: sharedConfig{ - S3UseARNRegion: true, - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i)+"_"+c.Profile, func(t *testing.T) { - cfg := sharedConfig{} - - err := cfg.setFromIniFile(c.Profile, iniFile, true) - if c.Err != nil { - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := c.Err.Error(), err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v, to be in %v", e, a) - } - return - } - - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := c.Expected, cfg; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - }) - } -} - -func TestLoadSharedConfigIniFiles(t *testing.T) { - cases := []struct { - Filenames []string - Expected []sharedConfigFile - }{ - { - Filenames: []string{"not_exists", testConfigFilename}, - Expected: []sharedConfigFile{ - {Filename: testConfigFilename}, - }, - }, - { - Filenames: []string{testConfigFilename, testConfigOtherFilename}, - Expected: []sharedConfigFile{ - {Filename: testConfigFilename}, - {Filename: testConfigOtherFilename}, - }, - }, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i), func(t *testing.T) { - files, err := loadSharedConfigIniFiles(c.Filenames) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := len(c.Expected), len(files); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - for i, expectedFile := range c.Expected { - if e, a := expectedFile.Filename, files[i].Filename; e != a { - t.Errorf("expect %v, got %v", e, a) - } - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_test.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_test.go deleted file mode 100644 index 16e4dc6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package session - -import ( - "os" - - "github.com/aws/aws-sdk-go/internal/sdktesting" -) - -func initSessionTestEnv() (oldEnv func()) { - oldEnv = sdktesting.StashEnv() - os.Setenv("AWS_CONFIG_FILE", "file_not_exists") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "file_not_exists") - - return oldEnv -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_1_5_test.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_1_5_test.go deleted file mode 100644 index f5bb66f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_1_5_test.go +++ /dev/null @@ -1,86 +0,0 @@ -// +build go1.5 - -package v4_test - -import ( - "fmt" - "net/http" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -func TestStandaloneSign(t *testing.T) { - creds := unit.Session.Config.Credentials - signer := v4.NewSigner(creds) - - for _, c := range standaloneSignCases { - host := fmt.Sprintf("https://%s.%s.%s.amazonaws.com", - c.SubDomain, c.Region, c.Service) - - req, err := http.NewRequest("GET", host, nil) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - // URL.EscapedPath() will be used by the signer to get the - // escaped form of the request's URI path. - req.URL.Path = c.OrigURI - req.URL.RawQuery = c.OrigQuery - - _, err = signer.Sign(req, nil, c.Service, c.Region, time.Unix(0, 0)) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - actual := req.Header.Get("Authorization") - if e, a := c.ExpSig, actual; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := c.OrigURI, req.URL.Path; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := c.EscapedURI, req.URL.EscapedPath(); e != a { - t.Errorf("expected %v, but received %v", e, a) - } - } -} - -func TestStandaloneSign_RawPath(t *testing.T) { - creds := unit.Session.Config.Credentials - signer := v4.NewSigner(creds) - - for _, c := range standaloneSignCases { - host := fmt.Sprintf("https://%s.%s.%s.amazonaws.com", - c.SubDomain, c.Region, c.Service) - - req, err := http.NewRequest("GET", host, nil) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - // URL.EscapedPath() will be used by the signer to get the - // escaped form of the request's URI path. - req.URL.Path = c.OrigURI - req.URL.RawPath = c.EscapedURI - req.URL.RawQuery = c.OrigQuery - - _, err = signer.Sign(req, nil, c.Service, c.Region, time.Unix(0, 0)) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - actual := req.Header.Get("Authorization") - if e, a := c.ExpSig, actual; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := c.OrigURI, req.URL.Path; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - if e, a := c.EscapedURI, req.URL.EscapedPath(); e != a { - t.Errorf("expected %v, but received %v", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_test.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_test.go deleted file mode 100644 index e58c783..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_test.go +++ /dev/null @@ -1,271 +0,0 @@ -package v4_test - -import ( - "net/http" - "net/url" - "reflect" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -var standaloneSignCases = []struct { - OrigURI string - OrigQuery string - Region, Service, SubDomain string - ExpSig string - EscapedURI string -}{ - { - OrigURI: `/logs-*/_search`, - OrigQuery: `pretty=true`, - Region: "us-west-2", Service: "es", SubDomain: "hostname-clusterkey", - EscapedURI: `/logs-%2A/_search`, - ExpSig: `AWS4-HMAC-SHA256 Credential=AKID/19700101/us-west-2/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=79d0760751907af16f64a537c1242416dacf51204a7dd5284492d15577973b91`, - }, -} - -func epochTime() time.Time { return time.Unix(0, 0) } - -func TestPresignHandler(t *testing.T) { - svc := s3.New(unit.Session) - svc.Handlers.Sign.SwapNamed(request.NamedHandler{ - Name: v4.SignRequestHandler.Name, - Fn: func(r *request.Request) { - v4.SignSDKRequestWithCurrentTime(r, epochTime) - }, - }) - - req, _ := svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - ContentDisposition: aws.String("a+b c$d"), - ACL: aws.String("public-read"), - }) - req.Time = epochTime() - urlstr, err := req.Presign(5 * time.Minute) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expectedHost := "bucket.s3.mock-region.amazonaws.com" - expectedDate := "19700101T000000Z" - expectedHeaders := "content-disposition;host;x-amz-acl" - expectedSig := "2d76a414208c0eac2a23ef9c834db9635ecd5a0fbb447a00ad191f82d854f55b" - expectedCred := "AKID/19700101/mock-region/s3/aws4_request" - - u, _ := url.Parse(urlstr) - urlQ := u.Query() - if e, a := expectedHost, u.Host; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedSig, urlQ.Get("X-Amz-Signature"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedCred, urlQ.Get("X-Amz-Credential"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedHeaders, urlQ.Get("X-Amz-SignedHeaders"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedDate, urlQ.Get("X-Amz-Date"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "300", urlQ.Get("X-Amz-Expires"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if a := urlQ.Get("X-Amz-Content-Sha256"); len(a) != 0 { - t.Errorf("expect no content sha256 got %v", a) - } - - if e, a := "+", urlstr; strings.Contains(a, e) { // + encoded as %20 - t.Errorf("expect %v not to be in %v", e, a) - } -} - -func TestPresignRequest(t *testing.T) { - svc := s3.New(unit.Session) - svc.Handlers.Sign.SwapNamed(request.NamedHandler{ - Name: v4.SignRequestHandler.Name, - Fn: func(r *request.Request) { - v4.SignSDKRequestWithCurrentTime(r, epochTime) - }, - }) - - req, _ := svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - ContentDisposition: aws.String("a+b c$d"), - ACL: aws.String("public-read"), - }) - req.Time = epochTime() - urlstr, headers, err := req.PresignRequest(5 * time.Minute) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expectedHost := "bucket.s3.mock-region.amazonaws.com" - expectedDate := "19700101T000000Z" - expectedHeaders := "content-disposition;host;x-amz-acl" - expectedSig := "2d76a414208c0eac2a23ef9c834db9635ecd5a0fbb447a00ad191f82d854f55b" - expectedCred := "AKID/19700101/mock-region/s3/aws4_request" - expectedHeaderMap := http.Header{ - "x-amz-acl": []string{"public-read"}, - "content-disposition": []string{"a+b c$d"}, - } - - u, _ := url.Parse(urlstr) - urlQ := u.Query() - if e, a := expectedHost, u.Host; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedSig, urlQ.Get("X-Amz-Signature"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedCred, urlQ.Get("X-Amz-Credential"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedHeaders, urlQ.Get("X-Amz-SignedHeaders"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedDate, urlQ.Get("X-Amz-Date"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedHeaderMap, headers; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "300", urlQ.Get("X-Amz-Expires"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if a := urlQ.Get("X-Amz-Content-Sha256"); len(a) != 0 { - t.Errorf("expect no content sha256 got %v", a) - } - - if e, a := "+", urlstr; strings.Contains(a, e) { // + encoded as %20 - t.Errorf("expect %v not to be in %v", e, a) - } -} - -func TestStandaloneSign_CustomURIEscape(t *testing.T) { - var expectSig = `AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=6601e883cc6d23871fd6c2a394c5677ea2b8c82b04a6446786d64cd74f520967` - - creds := unit.Session.Config.Credentials - signer := v4.NewSigner(creds, func(s *v4.Signer) { - s.DisableURIPathEscaping = true - }) - - host := "https://subdomain.us-east-1.es.amazonaws.com" - req, err := http.NewRequest("GET", host, nil) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - req.URL.Path = `/log-*/_search` - req.URL.Opaque = "//subdomain.us-east-1.es.amazonaws.com/log-%2A/_search" - - _, err = signer.Sign(req, nil, "es", "us-east-1", epochTime()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - actual := req.Header.Get("Authorization") - if e, a := expectSig, actual; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestStandaloneSign_WithPort(t *testing.T) { - - cases := []struct { - description string - url string - expectedSig string - }{ - { - "default HTTPS port", - "https://estest.us-east-1.es.amazonaws.com:443/_search", - "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=e573fc9aa3a156b720976419319be98fb2824a3abc2ddd895ecb1d1611c6a82d", - }, - { - "default HTTP port", - "http://example.com:80/_search", - "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=54ebe60c4ae03a40948b849e13c333523235f38002e2807059c64a9a8c7cb951", - }, - { - "non-standard HTTP port", - "http://example.com:9200/_search", - "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=cd9d926a460f8d3b58b57beadbd87666dc667e014c0afaa4cea37b2867f51b4f", - }, - { - "non-standard HTTPS port", - "https://example.com:9200/_search", - "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/es/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=cd9d926a460f8d3b58b57beadbd87666dc667e014c0afaa4cea37b2867f51b4f", - }, - } - - for _, c := range cases { - signer := v4.NewSigner(unit.Session.Config.Credentials) - req, _ := http.NewRequest("GET", c.url, nil) - _, err := signer.Sign(req, nil, "es", "us-east-1", epochTime()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - actual := req.Header.Get("Authorization") - if e, a := c.expectedSig, actual; e != a { - t.Errorf("%s, expect %v, got %v", c.description, e, a) - } - } -} - -func TestStandalonePresign_WithPort(t *testing.T) { - - cases := []struct { - description string - url string - expectedSig string - }{ - { - "default HTTPS port", - "https://estest.us-east-1.es.amazonaws.com:443/_search", - "0abcf61a351063441296febf4b485734d780634fba8cf1e7d9769315c35255d6", - }, - { - "default HTTP port", - "http://example.com:80/_search", - "fce9976dd6c849c21adfa6d3f3e9eefc651d0e4a2ccd740d43efddcccfdc8179", - }, - { - "non-standard HTTP port", - "http://example.com:9200/_search", - "f33c25a81c735e42bef35ed5e9f720c43940562e3e616ff0777bf6dde75249b0", - }, - { - "non-standard HTTPS port", - "https://example.com:9200/_search", - "f33c25a81c735e42bef35ed5e9f720c43940562e3e616ff0777bf6dde75249b0", - }, - } - - for _, c := range cases { - signer := v4.NewSigner(unit.Session.Config.Credentials) - req, _ := http.NewRequest("GET", c.url, nil) - _, err := signer.Presign(req, nil, "es", "us-east-1", 5*time.Minute, epochTime()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - actual := req.URL.Query().Get("X-Amz-Signature") - if e, a := c.expectedSig, actual; e != a { - t.Errorf("%s, expect %v, got %v", c.description, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules_test.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules_test.go deleted file mode 100644 index f4be951..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package v4 - -import ( - "testing" -) - -func TestRuleCheckWhitelist(t *testing.T) { - w := whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - } - - if !w.IsValid("Cache-Control") { - t.Error("expected true value") - } - if w.IsValid("Cache-") { - t.Error("expected false value") - } -} - -func TestRuleCheckBlacklist(t *testing.T) { - b := blacklist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - } - - if b.IsValid("Cache-Control") { - t.Error("expected false value") - } - if !b.IsValid("Cache-") { - t.Error("expected true value") - } -} - -func TestRuleCheckPattern(t *testing.T) { - p := patterns{"X-Amz-Meta-"} - - if !p.IsValid("X-Amz-Meta-") { - t.Error("expected true value") - } - if !p.IsValid("X-Amz-Meta-Star") { - t.Error("expected true value") - } - if p.IsValid("Cache-") { - t.Error("expected false value") - } -} - -func TestRuleComplexWhitelist(t *testing.T) { - w := rules{ - whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - }, - patterns{"X-Amz-Meta-"}, - } - - r := rules{ - inclusiveRules{patterns{"X-Amz-"}, blacklist{w}}, - } - - if !r.IsValid("X-Amz-Blah") { - t.Error("expected true value") - } - if r.IsValid("X-Amz-Meta-") { - t.Error("expected false value") - } - if r.IsValid("X-Amz-Meta-Star") { - t.Error("expected false value") - } - if r.IsValid("Cache-Control") { - t.Error("expected false value") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go deleted file mode 100644 index a6983d8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go +++ /dev/null @@ -1,769 +0,0 @@ -package v4 - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "reflect" - "strconv" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" -) - -func epochTime() time.Time { return time.Unix(0, 0) } - -func TestStripExcessHeaders(t *testing.T) { - vals := []string{ - "", - "123", - "1 2 3", - "1 2 3 ", - " 1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2 ", - " 1 2 ", - "12 3", - "12 3 1", - "12 3 1", - "12 3 1abc123", - } - - expected := []string{ - "", - "123", - "1 2 3", - "1 2 3", - "1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2", - "1 2", - "12 3", - "12 3 1", - "12 3 1", - "12 3 1abc123", - } - - stripExcessSpaces(vals) - for i := 0; i < len(vals); i++ { - if e, a := expected[i], vals[i]; e != a { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } -} - -func buildRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker) { - reader := strings.NewReader(body) - return buildRequestWithBodyReader(serviceName, region, reader) -} - -func buildRequestReaderSeeker(serviceName, region, body string) (*http.Request, io.ReadSeeker) { - reader := &readerSeekerWrapper{strings.NewReader(body)} - return buildRequestWithBodyReader(serviceName, region, reader) -} - -func buildRequestWithBodyReader(serviceName, region string, body io.Reader) (*http.Request, io.ReadSeeker) { - var bodyLen int - - type lenner interface { - Len() int - } - if lr, ok := body.(lenner); ok { - bodyLen = lr.Len() - } - - endpoint := "https://" + serviceName + "." + region + ".amazonaws.com" - req, _ := http.NewRequest("POST", endpoint, body) - req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()" - req.Header.Set("X-Amz-Target", "prefix.Operation") - req.Header.Set("Content-Type", "application/x-amz-json-1.0") - - if bodyLen > 0 { - req.Header.Set("Content-Length", strconv.Itoa(bodyLen)) - } - - req.Header.Set("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)") - req.Header.Add("X-Amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)") - req.Header.Add("X-amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)") - - var seeker io.ReadSeeker - if sr, ok := body.(io.ReadSeeker); ok { - seeker = sr - } else { - seeker = aws.ReadSeekCloser(body) - } - - return req, seeker -} - -func buildSigner() Signer { - return Signer{ - Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), - } -} - -func removeWS(text string) string { - text = strings.Replace(text, " ", "", -1) - text = strings.Replace(text, "\n", "", -1) - text = strings.Replace(text, "\t", "", -1) - return text -} - -func assertEqual(t *testing.T, expected, given string) { - if removeWS(expected) != removeWS(given) { - t.Errorf("\nExpected: %s\nGiven: %s", expected, given) - } -} - -func TestPresignRequest(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - - signer := buildSigner() - signer.Presign(req, body, "dynamodb", "us-east-1", 300*time.Second, epochTime()) - - expectedDate := "19700101T000000Z" - expectedHeaders := "content-length;content-type;host;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore" - expectedSig := "122f0b9e091e4ba84286097e2b3404a1f1f4c4aad479adda95b7dff0ccbe5581" - expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" - expectedTarget := "prefix.Operation" - - q := req.URL.Query() - if e, a := expectedSig, q.Get("X-Amz-Signature"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedCred, q.Get("X-Amz-Credential"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedHeaders, q.Get("X-Amz-SignedHeaders"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedDate, q.Get("X-Amz-Date"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if a := q.Get("X-Amz-Meta-Other-Header"); len(a) != 0 { - t.Errorf("expect %v to be empty", a) - } - if e, a := expectedTarget, q.Get("X-Amz-Target"); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestPresignBodyWithArrayRequest(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - req.URL.RawQuery = "Foo=z&Foo=o&Foo=m&Foo=a" - - signer := buildSigner() - signer.Presign(req, body, "dynamodb", "us-east-1", 300*time.Second, epochTime()) - - expectedDate := "19700101T000000Z" - expectedHeaders := "content-length;content-type;host;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore" - expectedSig := "e3ac55addee8711b76c6d608d762cff285fe8b627a057f8b5ec9268cf82c08b1" - expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" - expectedTarget := "prefix.Operation" - - q := req.URL.Query() - if e, a := expectedSig, q.Get("X-Amz-Signature"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedCred, q.Get("X-Amz-Credential"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedHeaders, q.Get("X-Amz-SignedHeaders"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := expectedDate, q.Get("X-Amz-Date"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if a := q.Get("X-Amz-Meta-Other-Header"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - if e, a := expectedTarget, q.Get("X-Amz-Target"); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignRequest(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - signer := buildSigner() - signer.Sign(req, body, "dynamodb", "us-east-1", epochTime()) - - expectedDate := "19700101T000000Z" - expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore;x-amz-security-token;x-amz-target, Signature=a518299330494908a70222cec6899f6f32f297f8595f6df1776d998936652ad9" - - q := req.Header - if e, a := expectedSig, q.Get("Authorization"); e != a { - t.Errorf("expect\n%v\nactual\n%v\n", e, a) - } - if e, a := expectedDate, q.Get("X-Amz-Date"); e != a { - t.Errorf("expect\n%v\nactual\n%v\n", e, a) - } -} - -func TestSignBodyS3(t *testing.T) { - req, body := buildRequest("s3", "us-east-1", "hello") - signer := buildSigner() - signer.Sign(req, body, "s3", "us-east-1", time.Now()) - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignBodyGlacier(t *testing.T) { - req, body := buildRequest("glacier", "us-east-1", "hello") - signer := buildSigner() - signer.Sign(req, body, "glacier", "us-east-1", time.Now()) - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestPresign_SignedPayload(t *testing.T) { - req, body := buildRequest("glacier", "us-east-1", "hello") - signer := buildSigner() - signer.Presign(req, body, "glacier", "us-east-1", 5*time.Minute, time.Now()) - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestPresign_UnsignedPayload(t *testing.T) { - req, body := buildRequest("service-name", "us-east-1", "hello") - signer := buildSigner() - signer.UnsignedPayload = true - signer.Presign(req, body, "service-name", "us-east-1", 5*time.Minute, time.Now()) - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "UNSIGNED-PAYLOAD", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestPresign_UnsignedPayload_S3(t *testing.T) { - req, body := buildRequest("s3", "us-east-1", "hello") - signer := buildSigner() - signer.Presign(req, body, "s3", "us-east-1", 5*time.Minute, time.Now()) - if a := req.Header.Get("X-Amz-Content-Sha256"); len(a) != 0 { - t.Errorf("expect no content sha256 got %v", a) - } -} - -func TestSignUnseekableBody(t *testing.T) { - req, body := buildRequestWithBodyReader("mock-service", "mock-region", bytes.NewBuffer([]byte("hello"))) - signer := buildSigner() - _, err := signer.Sign(req, body, "mock-service", "mock-region", time.Now()) - if err == nil { - t.Fatalf("expect error signing request") - } - - if e, a := "unseekable request body", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %q to be in %q", e, a) - } -} - -func TestSignUnsignedPayloadUnseekableBody(t *testing.T) { - req, body := buildRequestWithBodyReader("mock-service", "mock-region", bytes.NewBuffer([]byte("hello"))) - - signer := buildSigner() - signer.UnsignedPayload = true - - _, err := signer.Sign(req, body, "mock-service", "mock-region", time.Now()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "UNSIGNED-PAYLOAD", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignPreComputedHashUnseekableBody(t *testing.T) { - req, body := buildRequestWithBodyReader("mock-service", "mock-region", bytes.NewBuffer([]byte("hello"))) - - signer := buildSigner() - - req.Header.Set("X-Amz-Content-Sha256", "some-content-sha256") - _, err := signer.Sign(req, body, "mock-service", "mock-region", time.Now()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "some-content-sha256", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignPrecomputedBodyChecksum(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "hello") - req.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED") - signer := buildSigner() - signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) - hash := req.Header.Get("X-Amz-Content-Sha256") - if e, a := "PRECOMPUTED", hash; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestAnonymousCredentials(t *testing.T) { - svc := awstesting.NewClient(&aws.Config{Credentials: credentials.AnonymousCredentials}) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - SignSDKRequest(r) - - urlQ := r.HTTPRequest.URL.Query() - if a := urlQ.Get("X-Amz-Signature"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - if a := urlQ.Get("X-Amz-Credential"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - if a := urlQ.Get("X-Amz-SignedHeaders"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - if a := urlQ.Get("X-Amz-Date"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - - hQ := r.HTTPRequest.Header - if a := hQ.Get("Authorization"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } - if a := hQ.Get("X-Amz-Date"); len(a) != 0 { - t.Errorf("expect %v to be empty, was not", a) - } -} - -func TestIgnoreResignRequestWithValidCreds(t *testing.T) { - svc := awstesting.NewClient(&aws.Config{ - Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), - Region: aws.String("us-west-2"), - }) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - - SignSDKRequest(r) - sig := r.HTTPRequest.Header.Get("Authorization") - - SignSDKRequestWithCurrentTime(r, func() time.Time { - // Simulate one second has passed so that signature's date changes - // when it is resigned. - return time.Now().Add(1 * time.Second) - }) - if e, a := sig, r.HTTPRequest.Header.Get("Authorization"); e == a { - t.Errorf("expect %v to be %v, but was not", e, a) - } -} - -func TestIgnorePreResignRequestWithValidCreds(t *testing.T) { - svc := awstesting.NewClient(&aws.Config{ - Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), - Region: aws.String("us-west-2"), - }) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - r.ExpireTime = time.Minute * 10 - - SignSDKRequest(r) - sig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature") - - SignSDKRequestWithCurrentTime(r, func() time.Time { - // Simulate one second has passed so that signature's date changes - // when it is resigned. - return time.Now().Add(1 * time.Second) - }) - if e, a := sig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature"); e == a { - t.Errorf("expect %v to be %v, but was not", e, a) - } -} - -func TestResignRequestExpiredCreds(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - svc := awstesting.NewClient(&aws.Config{Credentials: creds}) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - SignSDKRequest(r) - querySig := r.HTTPRequest.Header.Get("Authorization") - var origSignedHeaders string - for _, p := range strings.Split(querySig, ", ") { - if strings.HasPrefix(p, "SignedHeaders=") { - origSignedHeaders = p[len("SignedHeaders="):] - break - } - } - if a := origSignedHeaders; len(a) == 0 { - t.Errorf("expect not to be empty, but was") - } - if e, a := origSignedHeaders, "authorization"; strings.Contains(a, e) { - t.Errorf("expect %v to not be in %v, but was", e, a) - } - origSignedAt := r.LastSignedAt - - creds.Expire() - - SignSDKRequestWithCurrentTime(r, func() time.Time { - // Simulate one second has passed so that signature's date changes - // when it is resigned. - return time.Now().Add(1 * time.Second) - }) - updatedQuerySig := r.HTTPRequest.Header.Get("Authorization") - if e, a := querySig, updatedQuerySig; e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } - - var updatedSignedHeaders string - for _, p := range strings.Split(updatedQuerySig, ", ") { - if strings.HasPrefix(p, "SignedHeaders=") { - updatedSignedHeaders = p[len("SignedHeaders="):] - break - } - } - if a := updatedSignedHeaders; len(a) == 0 { - t.Errorf("expect not to be empty, but was") - } - if e, a := updatedQuerySig, "authorization"; strings.Contains(a, e) { - t.Errorf("expect %v to not be in %v, but was", e, a) - } - if e, a := origSignedAt, r.LastSignedAt; e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } -} - -func TestPreResignRequestExpiredCreds(t *testing.T) { - provider := &credentials.StaticProvider{Value: credentials.Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "SESSION", - }} - creds := credentials.NewCredentials(provider) - svc := awstesting.NewClient(&aws.Config{Credentials: creds}) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - r.ExpireTime = time.Minute * 10 - - SignSDKRequest(r) - querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature") - signedHeaders := r.HTTPRequest.URL.Query().Get("X-Amz-SignedHeaders") - if a := signedHeaders; len(a) == 0 { - t.Errorf("expect not to be empty, but was") - } - origSignedAt := r.LastSignedAt - - creds.Expire() - - SignSDKRequestWithCurrentTime(r, func() time.Time { - // Simulate the request occurred 15 minutes in the past - return time.Now().Add(-48 * time.Hour) - }) - if e, a := querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature"); e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } - resignedHeaders := r.HTTPRequest.URL.Query().Get("X-Amz-SignedHeaders") - if e, a := signedHeaders, resignedHeaders; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := signedHeaders, "x-amz-signedHeaders"; strings.Contains(a, e) { - t.Errorf("expect %v to not be in %v, but was", e, a) - } - if e, a := origSignedAt, r.LastSignedAt; e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } -} - -func TestResignRequestExpiredRequest(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - svc := awstesting.NewClient(&aws.Config{Credentials: creds}) - r := svc.NewRequest( - &request.Operation{ - Name: "BatchGetItem", - HTTPMethod: "POST", - HTTPPath: "/", - }, - nil, - nil, - ) - - SignSDKRequest(r) - querySig := r.HTTPRequest.Header.Get("Authorization") - origSignedAt := r.LastSignedAt - - SignSDKRequestWithCurrentTime(r, func() time.Time { - // Simulate the request occurred 15 minutes in the past - return time.Now().Add(15 * time.Minute) - }) - if e, a := querySig, r.HTTPRequest.Header.Get("Authorization"); e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } - if e, a := origSignedAt, r.LastSignedAt; e == a { - t.Errorf("expect %v to be %v, was not", e, a) - } -} - -func TestSignWithRequestBody(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - signer := NewSigner(creds) - - expectBody := []byte("abc123") - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - b, err := ioutil.ReadAll(r.Body) - r.Body.Close() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := expectBody, b; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - w.WriteHeader(http.StatusOK) - })) - defer server.Close() - - req, err := http.NewRequest("POST", server.URL, nil) - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - - _, err = signer.Sign(req, bytes.NewReader(expectBody), "service", "region", time.Now()) - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - - resp, err := http.DefaultClient.Do(req) - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignWithRequestBody_Overwrite(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - signer := NewSigner(creds) - - var expectBody []byte - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - b, err := ioutil.ReadAll(r.Body) - r.Body.Close() - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - if e, a := len(expectBody), len(b); e != a { - t.Errorf("expect %v, got %v", e, a) - } - w.WriteHeader(http.StatusOK) - })) - defer server.Close() - - req, err := http.NewRequest("GET", server.URL, strings.NewReader("invalid body")) - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - - _, err = signer.Sign(req, nil, "service", "region", time.Now()) - req.ContentLength = 0 - - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - - resp, err := http.DefaultClient.Do(req) - if err != nil { - t.Errorf("expect not no error, got %v", err) - } - if e, a := http.StatusOK, resp.StatusCode; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestBuildCanonicalRequest(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - req.URL.RawQuery = "Foo=z&Foo=o&Foo=m&Foo=a" - ctx := &signingCtx{ - ServiceName: "dynamodb", - Region: "us-east-1", - Request: req, - Body: body, - Query: req.URL.Query(), - Time: time.Now(), - ExpireTime: 5 * time.Second, - } - - ctx.buildCanonicalString() - expected := "https://example.org/bucket/key-._~,!@#$%^&*()?Foo=z&Foo=o&Foo=m&Foo=a" - if e, a := expected, ctx.Request.URL.String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSignWithBody_ReplaceRequestBody(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - req, seekerBody := buildRequest("dynamodb", "us-east-1", "{}") - req.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) - - s := NewSigner(creds) - origBody := req.Body - - _, err := s.Sign(req, seekerBody, "dynamodb", "us-east-1", time.Now()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if req.Body == origBody { - t.Errorf("expeect request body to not be origBody") - } - - if req.Body == nil { - t.Errorf("expect request body to be changed but was nil") - } -} - -func TestSignWithBody_NoReplaceRequestBody(t *testing.T) { - creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") - req, seekerBody := buildRequest("dynamodb", "us-east-1", "{}") - req.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) - - s := NewSigner(creds, func(signer *Signer) { - signer.DisableRequestBodyOverwrite = true - }) - - origBody := req.Body - - _, err := s.Sign(req, seekerBody, "dynamodb", "us-east-1", time.Now()) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if req.Body != origBody { - t.Errorf("expect request body to not be chagned") - } -} - -func TestRequestHost(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - req.URL.RawQuery = "Foo=z&Foo=o&Foo=m&Foo=a" - req.Host = "myhost" - ctx := &signingCtx{ - ServiceName: "dynamodb", - Region: "us-east-1", - Request: req, - Body: body, - Query: req.URL.Query(), - Time: time.Now(), - ExpireTime: 5 * time.Second, - } - - ctx.buildCanonicalHeaders(ignoredHeaders, ctx.Request.Header) - if !strings.Contains(ctx.canonicalHeaders, "host:"+req.Host) { - t.Errorf("canonical host header invalid") - } -} - -func BenchmarkPresignRequest(b *testing.B) { - signer := buildSigner() - req, body := buildRequestReaderSeeker("dynamodb", "us-east-1", "{}") - for i := 0; i < b.N; i++ { - signer.Presign(req, body, "dynamodb", "us-east-1", 300*time.Second, time.Now()) - } -} - -func BenchmarkSignRequest(b *testing.B) { - signer := buildSigner() - req, body := buildRequestReaderSeeker("dynamodb", "us-east-1", "{}") - for i := 0; i < b.N; i++ { - signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) - } -} - -var stripExcessSpaceCases = []string{ - `AWS4-HMAC-SHA256 Credential=AKIDFAKEIDFAKEID/20160628/us-west-2/s3/aws4_request, SignedHeaders=host;x-amz-date, Signature=1234567890abcdef1234567890abcdef1234567890abcdef`, - `123 321 123 321`, - ` 123 321 123 321 `, - ` 123 321 123 321 `, - "123", - "1 2 3", - " 1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2 ", - " 1 2 ", - "12 3", - "12 3 1", - "12 3 1", - "12 3 1abc123", -} - -func BenchmarkStripExcessSpaces(b *testing.B) { - for i := 0; i < b.N; i++ { - // Make sure to start with a copy of the cases - cases := append([]string{}, stripExcessSpaceCases...) - stripExcessSpaces(cases) - } -} - -// readerSeekerWrapper mimics the interface provided by request.offsetReader -type readerSeekerWrapper struct { - r *strings.Reader -} - -func (r *readerSeekerWrapper) Read(p []byte) (n int, err error) { - return r.r.Read(p) -} - -func (r *readerSeekerWrapper) Seek(offset int64, whence int) (int64, error) { - return r.r.Seek(offset, whence) -} - -func (r *readerSeekerWrapper) Len() int { - return r.r.Len() -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types_test.go b/vendor/github.com/aws/aws-sdk-go/aws/types_test.go deleted file mode 100644 index 39ca12f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/types_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package aws - -import ( - "bytes" - "math/rand" - "testing" -) - -func TestWriteAtBuffer(t *testing.T) { - b := &WriteAtBuffer{} - - n, err := b.WriteAt([]byte{1}, 0) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := 1, n; e != a { - t.Errorf("expected %d, but received %d", e, a) - } - - n, err = b.WriteAt([]byte{1, 1, 1}, 5) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := 3, n; e != a { - t.Errorf("expected %d, but received %d", e, a) - } - - n, err = b.WriteAt([]byte{2}, 1) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := 1, n; e != a { - t.Errorf("expected %d, but received %d", e, a) - } - - n, err = b.WriteAt([]byte{3}, 2) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := 1, n; e != a { - t.Errorf("expected %d, but received %d", e, a) - } - - if !bytes.Equal([]byte{1, 2, 3, 0, 0, 1, 1, 1}, b.Bytes()) { - t.Errorf("expected %v, but received %v", []byte{1, 2, 3, 0, 0, 1, 1, 1}, b.Bytes()) - } -} - -func BenchmarkWriteAtBuffer(b *testing.B) { - buf := &WriteAtBuffer{} - r := rand.New(rand.NewSource(1)) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - to := r.Intn(10) * 4096 - bs := make([]byte, to) - buf.WriteAt(bs, r.Int63n(10)*4096) - } -} - -func BenchmarkWriteAtBufferOrderedWrites(b *testing.B) { - // test the performance of a WriteAtBuffer when written in an - // ordered fashion. This is similar to the behavior of the - // s3.Downloader, since downloads the first chunk of the file, then - // the second, and so on. - // - // This test simulates a 150MB file being written in 30 ordered 5MB chunks. - chunk := int64(5e6) - max := chunk * 30 - // we'll write the same 5MB chunk every time - tmp := make([]byte, chunk) - for i := 0; i < b.N; i++ { - buf := &WriteAtBuffer{} - for i := int64(0); i < max; i += chunk { - buf.WriteAt(tmp, i) - } - } -} - -func BenchmarkWriteAtBufferParallel(b *testing.B) { - buf := &WriteAtBuffer{} - r := rand.New(rand.NewSource(1)) - - b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - to := r.Intn(10) * 4096 - bs := make([]byte, to) - buf.WriteAt(bs, r.Int63n(10)*4096) - } - }) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index 437bc27..0e840ed 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.25.48" +const SDKVersion = "1.26.8" diff --git a/vendor/github.com/aws/aws-sdk-go/buildspec.yml b/vendor/github.com/aws/aws-sdk-go/buildspec.yml deleted file mode 100644 index 9887f2e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/buildspec.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 0.2 - -phases: - build: - commands: - - echo Build started on `date` - - export GOPATH=/go - - export SDK_CB_ROOT=`pwd` - - export SDK_GO_ROOT=/go/src/github.com/aws/aws-sdk-go - - mkdir -p /go/src/github.com/aws - - ln -s $SDK_CB_ROOT $SDK_GO_ROOT - - cd $SDK_GO_ROOT - - make get-deps - - make ci-test - - cd $SDK_CB_ROOT - - #echo Compiling the Go code... - post_build: - commands: - - echo Build completed on `date` -#artifacts: -# files: -# - hello diff --git a/vendor/github.com/aws/aws-sdk-go/doc.go b/vendor/github.com/aws/aws-sdk-go/doc.go deleted file mode 100644 index 32b806a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/doc.go +++ /dev/null @@ -1,405 +0,0 @@ -// Package sdk is the official AWS SDK for the Go programming language. -// -// The AWS SDK for Go provides APIs and utilities that developers can use to -// build Go applications that use AWS services, such as Amazon Elastic Compute -// Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3). -// -// The SDK removes the complexity of coding directly against a web service -// interface. It hides a lot of the lower-level plumbing, such as authentication, -// request retries, and error handling. -// -// The SDK also includes helpful utilities on top of the AWS APIs that add additional -// capabilities and functionality. For example, the Amazon S3 Download and Upload -// Manager will automatically split up large objects into multiple parts and -// transfer them concurrently. -// -// See the s3manager package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/ -// -// Getting More Information -// -// Checkout the Getting Started Guide and API Reference Docs detailed the SDK's -// components and details on each AWS client the SDK supports. -// -// The Getting Started Guide provides examples and detailed description of how -// to get setup with the SDK. -// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/welcome.html -// -// The API Reference Docs include a detailed breakdown of the SDK's components -// such as utilities and AWS clients. Use this as a reference of the Go types -// included with the SDK, such as AWS clients, API operations, and API parameters. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// Overview of SDK's Packages -// -// The SDK is composed of two main components, SDK core, and service clients. -// The SDK core packages are all available under the aws package at the root of -// the SDK. Each client for a supported AWS service is available within its own -// package under the service folder at the root of the SDK. -// -// * aws - SDK core, provides common shared types such as Config, Logger, -// and utilities to make working with API parameters easier. -// -// * awserr - Provides the error interface that the SDK will use for all -// errors that occur in the SDK's processing. This includes service API -// response errors as well. The Error type is made up of a code and message. -// Cast the SDK's returned error type to awserr.Error and call the Code -// method to compare returned error to specific error codes. See the package's -// documentation for additional values that can be extracted such as RequestId. -// -// * credentials - Provides the types and built in credentials providers -// the SDK will use to retrieve AWS credentials to make API requests with. -// Nested under this folder are also additional credentials providers such as -// stscreds for assuming IAM roles, and ec2rolecreds for EC2 Instance roles. -// -// * endpoints - Provides the AWS Regions and Endpoints metadata for the SDK. -// Use this to lookup AWS service endpoint information such as which services -// are in a region, and what regions a service is in. Constants are also provided -// for all region identifiers, e.g UsWest2RegionID for "us-west-2". -// -// * session - Provides initial default configuration, and load -// configuration from external sources such as environment and shared -// credentials file. -// -// * request - Provides the API request sending, and retry logic for the SDK. -// This package also includes utilities for defining your own request -// retryer, and configuring how the SDK processes the request. -// -// * service - Clients for AWS services. All services supported by the SDK are -// available under this folder. -// -// How to Use the SDK's AWS Service Clients -// -// The SDK includes the Go types and utilities you can use to make requests to -// AWS service APIs. Within the service folder at the root of the SDK you'll find -// a package for each AWS service the SDK supports. All service clients follows -// a common pattern of creation and usage. -// -// When creating a client for an AWS service you'll first need to have a Session -// value constructed. The Session provides shared configuration that can be shared -// between your service clients. When service clients are created you can pass -// in additional configuration via the aws.Config type to override configuration -// provided by in the Session to create service client instances with custom -// configuration. -// -// Once the service's client is created you can use it to make API requests the -// AWS service. These clients are safe to use concurrently. -// -// Configuring the SDK -// -// In the AWS SDK for Go, you can configure settings for service clients, such -// as the log level and maximum number of retries. Most settings are optional; -// however, for each service client, you must specify a region and your credentials. -// The SDK uses these values to send requests to the correct AWS region and sign -// requests with the correct credentials. You can specify these values as part -// of a session or as environment variables. -// -// See the SDK's configuration guide for more information. -// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html -// -// See the session package documentation for more information on how to use Session -// with the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ -// -// See the Config type in the aws package for more information on configuration -// options. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// Configuring Credentials -// -// When using the SDK you'll generally need your AWS credentials to authenticate -// with AWS services. The SDK supports multiple methods of supporting these -// credentials. By default the SDK will source credentials automatically from -// its default credential chain. See the session package for more information -// on this chain, and how to configure it. The common items in the credential -// chain are the following: -// -// * Environment Credentials - Set of environment variables that are useful -// when sub processes are created for specific roles. -// -// * Shared Credentials file (~/.aws/credentials) - This file stores your -// credentials based on a profile name and is useful for local development. -// -// * EC2 Instance Role Credentials - Use EC2 Instance Role to assign credentials -// to application running on an EC2 instance. This removes the need to manage -// credential files in production. -// -// Credentials can be configured in code as well by setting the Config's Credentials -// value to a custom provider or using one of the providers included with the -// SDK to bypass the default credential chain and use a custom one. This is -// helpful when you want to instruct the SDK to only use a specific set of -// credentials or providers. -// -// This example creates a credential provider for assuming an IAM role, "myRoleARN" -// and configures the S3 service client to use that role for API requests. -// -// // Initial credentials loaded from SDK's default credential chain. Such as -// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance -// // Role. These credentials will be used to to make the STS Assume Role API. -// sess := session.Must(session.NewSession()) -// -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN. -// creds := stscreds.NewCredentials(sess, "myRoleArn") -// -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.New(sess, &aws.Config{Credentials: creds})/ -// -// See the credentials package documentation for more information on credential -// providers included with the SDK, and how to customize the SDK's usage of -// credentials. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials -// -// The SDK has support for the shared configuration file (~/.aws/config). This -// support can be enabled by setting the environment variable, "AWS_SDK_LOAD_CONFIG=1", -// or enabling the feature in code when creating a Session via the -// Option's SharedConfigState parameter. -// -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// SharedConfigState: session.SharedConfigEnable, -// })) -// -// Configuring AWS Region -// -// In addition to the credentials you'll need to specify the region the SDK -// will use to make AWS API requests to. In the SDK you can specify the region -// either with an environment variable, or directly in code when a Session or -// service client is created. The last value specified in code wins if the region -// is specified multiple ways. -// -// To set the region via the environment variable set the "AWS_REGION" to the -// region you want to the SDK to use. Using this method to set the region will -// allow you to run your application in multiple regions without needing additional -// code in the application to select the region. -// -// AWS_REGION=us-west-2 -// -// The endpoints package includes constants for all regions the SDK knows. The -// values are all suffixed with RegionID. These values are helpful, because they -// reduce the need to type the region string manually. -// -// To set the region on a Session use the aws package's Config struct parameter -// Region to the AWS region you want the service clients created from the session to -// use. This is helpful when you want to create multiple service clients, and -// all of the clients make API requests to the same region. -// -// sess := session.Must(session.NewSession(&aws.Config{ -// Region: aws.String(endpoints.UsWest2RegionID), -// })) -// -// See the endpoints package for the AWS Regions and Endpoints metadata. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/endpoints/ -// -// In addition to setting the region when creating a Session you can also set -// the region on a per service client bases. This overrides the region of a -// Session. This is helpful when you want to create service clients in specific -// regions different from the Session's region. -// -// svc := s3.New(sess, &aws.Config{ -// Region: aws.String(endpoints.UsWest2RegionID), -// }) -// -// See the Config type in the aws package for more information and additional -// options such as setting the Endpoint, and other service client configuration options. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// Making API Requests -// -// Once the client is created you can make an API request to the service. -// Each API method takes a input parameter, and returns the service response -// and an error. The SDK provides methods for making the API call in multiple ways. -// -// In this list we'll use the S3 ListObjects API as an example for the different -// ways of making API requests. -// -// * ListObjects - Base API operation that will make the API request to the service. -// -// * ListObjectsRequest - API methods suffixed with Request will construct the -// API request, but not send it. This is also helpful when you want to get a -// presigned URL for a request, and share the presigned URL instead of your -// application making the request directly. -// -// * ListObjectsPages - Same as the base API operation, but uses a callback to -// automatically handle pagination of the API's response. -// -// * ListObjectsWithContext - Same as base API operation, but adds support for -// the Context pattern. This is helpful for controlling the canceling of in -// flight requests. See the Go standard library context package for more -// information. This method also takes request package's Option functional -// options as the variadic argument for modifying how the request will be -// made, or extracting information from the raw HTTP response. -// -// * ListObjectsPagesWithContext - same as ListObjectsPages, but adds support for -// the Context pattern. Similar to ListObjectsWithContext this method also -// takes the request package's Option function option types as the variadic -// argument. -// -// In addition to the API operations the SDK also includes several higher level -// methods that abstract checking for and waiting for an AWS resource to be in -// a desired state. In this list we'll use WaitUntilBucketExists to demonstrate -// the different forms of waiters. -// -// * WaitUntilBucketExists. - Method to make API request to query an AWS service for -// a resource's state. Will return successfully when that state is accomplished. -// -// * WaitUntilBucketExistsWithContext - Same as WaitUntilBucketExists, but adds -// support for the Context pattern. In addition these methods take request -// package's WaiterOptions to configure the waiter, and how underlying request -// will be made by the SDK. -// -// The API method will document which error codes the service might return for -// the operation. These errors will also be available as const strings prefixed -// with "ErrCode" in the service client's package. If there are no errors listed -// in the API's SDK documentation you'll need to consult the AWS service's API -// documentation for the errors that could be returned. -// -// ctx := context.Background() -// -// result, err := svc.GetObjectWithContext(ctx, &s3.GetObjectInput{ -// Bucket: aws.String("my-bucket"), -// Key: aws.String("my-key"), -// }) -// if err != nil { -// // Cast err to awserr.Error to handle specific error codes. -// aerr, ok := err.(awserr.Error) -// if ok && aerr.Code() == s3.ErrCodeNoSuchKey { -// // Specific error code handling -// } -// return err -// } -// -// // Make sure to close the body when done with it for S3 GetObject APIs or -// // will leak connections. -// defer result.Body.Close() -// -// fmt.Println("Object Size:", aws.StringValue(result.ContentLength)) -// -// API Request Pagination and Resource Waiters -// -// Pagination helper methods are suffixed with "Pages", and provide the -// functionality needed to round trip API page requests. Pagination methods -// take a callback function that will be called for each page of the API's response. -// -// objects := []string{} -// err := svc.ListObjectsPagesWithContext(ctx, &s3.ListObjectsInput{ -// Bucket: aws.String(myBucket), -// }, func(p *s3.ListObjectsOutput, lastPage bool) bool { -// for _, o := range p.Contents { -// objects = append(objects, aws.StringValue(o.Key)) -// } -// return true // continue paging -// }) -// if err != nil { -// panic(fmt.Sprintf("failed to list objects for bucket, %s, %v", myBucket, err)) -// } -// -// fmt.Println("Objects in bucket:", objects) -// -// Waiter helper methods provide the functionality to wait for an AWS resource -// state. These methods abstract the logic needed to to check the state of an -// AWS resource, and wait until that resource is in a desired state. The waiter -// will block until the resource is in the state that is desired, an error occurs, -// or the waiter times out. If a resource times out the error code returned will -// be request.WaiterResourceNotReadyErrorCode. -// -// err := svc.WaitUntilBucketExistsWithContext(ctx, &s3.HeadBucketInput{ -// Bucket: aws.String(myBucket), -// }) -// if err != nil { -// aerr, ok := err.(awserr.Error) -// if ok && aerr.Code() == request.WaiterResourceNotReadyErrorCode { -// fmt.Fprintf(os.Stderr, "timed out while waiting for bucket to exist") -// } -// panic(fmt.Errorf("failed to wait for bucket to exist, %v", err)) -// } -// fmt.Println("Bucket", myBucket, "exists") -// -// Complete SDK Example -// -// This example shows a complete working Go file which will upload a file to S3 -// and use the Context pattern to implement timeout logic that will cancel the -// request if it takes too long. This example highlights how to use sessions, -// create a service client, make a request, handle the error, and process the -// response. -// -// package main -// -// import ( -// "context" -// "flag" -// "fmt" -// "os" -// "time" -// -// "github.com/aws/aws-sdk-go/aws" -// "github.com/aws/aws-sdk-go/aws/awserr" -// "github.com/aws/aws-sdk-go/aws/request" -// "github.com/aws/aws-sdk-go/aws/session" -// "github.com/aws/aws-sdk-go/service/s3" -// ) -// -// // Uploads a file to S3 given a bucket and object key. Also takes a duration -// // value to terminate the update if it doesn't complete within that time. -// // -// // The AWS Region needs to be provided in the AWS shared config or on the -// // environment variable as `AWS_REGION`. Credentials also must be provided -// // Will default to shared config file, but can load from environment if provided. -// // -// // Usage: -// // # Upload myfile.txt to myBucket/myKey. Must complete within 10 minutes or will fail -// // go run withContext.go -b mybucket -k myKey -d 10m < myfile.txt -// func main() { -// var bucket, key string -// var timeout time.Duration -// -// flag.StringVar(&bucket, "b", "", "Bucket name.") -// flag.StringVar(&key, "k", "", "Object key name.") -// flag.DurationVar(&timeout, "d", 0, "Upload timeout.") -// flag.Parse() -// -// // All clients require a Session. The Session provides the client with -// // shared configuration such as region, endpoint, and credentials. A -// // Session should be shared where possible to take advantage of -// // configuration and credential caching. See the session package for -// // more information. -// sess := session.Must(session.NewSession()) -// -// // Create a new instance of the service's client with a Session. -// // Optional aws.Config values can also be provided as variadic arguments -// // to the New function. This option allows you to provide service -// // specific configuration. -// svc := s3.New(sess) -// -// // Create a context with a timeout that will abort the upload if it takes -// // more than the passed in timeout. -// ctx := context.Background() -// var cancelFn func() -// if timeout > 0 { -// ctx, cancelFn = context.WithTimeout(ctx, timeout) -// } -// // Ensure the context is canceled to prevent leaking. -// // See context package for more information, https://golang.org/pkg/context/ -// defer cancelFn() -// -// // Uploads the object to S3. The Context will interrupt the request if the -// // timeout expires. -// _, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{ -// Bucket: aws.String(bucket), -// Key: aws.String(key), -// Body: os.Stdin, -// }) -// if err != nil { -// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode { -// // If the SDK can determine the request or retry delay was canceled -// // by a context the CanceledErrorCode error code will be returned. -// fmt.Fprintf(os.Stderr, "upload canceled due to timeout, %v\n", err) -// } else { -// fmt.Fprintf(os.Stderr, "failed to upload object, %v\n", err) -// } -// os.Exit(1) -// } -// -// fmt.Printf("successfully uploaded file to %s/%s\n", bucket, key) -// } -package sdk diff --git a/vendor/github.com/aws/aws-sdk-go/go.mod b/vendor/github.com/aws/aws-sdk-go/go.mod deleted file mode 100644 index 329c3ea..0000000 --- a/vendor/github.com/aws/aws-sdk-go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/aws/aws-sdk-go - -require github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af diff --git a/vendor/github.com/aws/aws-sdk-go/go.sum b/vendor/github.com/aws/aws-sdk-go/go.sum deleted file mode 100644 index d07bf6d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/bench_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/bench_test.go deleted file mode 100644 index e4ebec2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/bench_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package ini - -import ( - "testing" -) - -const ( - section = `[default] -region = us-west-2 -credential_source = Ec2InstanceMetadata -s3 = - foo=bar - bar=baz -output = json - -[assumerole] -output = json -region = us-west-2 -` -) - -func BenchmarkINIParser(b *testing.B) { - for i := 0; i < b.N; i++ { - ParseBytes([]byte(section)) - } -} - -func BenchmarkTokenize(b *testing.B) { - lexer := iniLexer{} - for i := 0; i < b.N; i++ { - lexer.tokenize([]byte(section)) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz_test.go deleted file mode 100644 index 77ec205..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build fuzz - -// fuzz test data is stored in Amazon S3. -package ini_test - -import ( - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/internal/ini" -) - -// TestFuzz is used to test for crashes and not validity of the input -func TestFuzz(t *testing.T) { - paths, err := filepath.Glob("testdata/fuzz/*") - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - if paths == nil { - t.Errorf("expected fuzz files, but received none") - } - - for _, path := range paths { - t.Run(path, func(t *testing.T) { - ini.OpenFile(path) - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer_test.go deleted file mode 100644 index f1fb609..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer_test.go +++ /dev/null @@ -1,54 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "bytes" - "io" - "reflect" - "testing" -) - -func TestTokenize(t *testing.T) { - numberToken := newToken(TokenLit, []rune("123"), IntegerType) - numberToken.base = 10 - cases := []struct { - r io.Reader - expectedTokens []Token - expectedError bool - }{ - { - r: bytes.NewBuffer([]byte(`x = 123`)), - expectedTokens: []Token{ - newToken(TokenLit, []rune("x"), StringType), - newToken(TokenWS, []rune(" "), NoneType), - newToken(TokenOp, []rune("="), NoneType), - newToken(TokenWS, []rune(" "), NoneType), - numberToken, - }, - }, - { - r: bytes.NewBuffer([]byte(`[ foo ]`)), - expectedTokens: []Token{ - newToken(TokenSep, []rune("["), NoneType), - newToken(TokenWS, []rune(" "), NoneType), - newToken(TokenLit, []rune("foo"), StringType), - newToken(TokenWS, []rune(" "), NoneType), - newToken(TokenSep, []rune("]"), NoneType), - }, - }, - } - - for _, c := range cases { - lex := iniLexer{} - tokens, err := lex.Tokenize(c.r) - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("expected %t, but received %t", e, a) - } - - if e, a := c.expectedTokens, tokens; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser_test.go deleted file mode 100644 index 55a4236..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser_test.go +++ /dev/null @@ -1,322 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "bytes" - "fmt" - "io" - "reflect" - "testing" -) - -func TestParser(t *testing.T) { - xID, _, _ := newLitToken([]rune("x = 1234")) - s3ID, _, _ := newLitToken([]rune("s3 = 1234")) - fooSlashes, _, _ := newLitToken([]rune("//foo")) - - regionID, _, _ := newLitToken([]rune("region")) - regionLit, _, _ := newLitToken([]rune(`"us-west-2"`)) - regionNoQuotesLit, _, _ := newLitToken([]rune("us-west-2")) - - credentialID, _, _ := newLitToken([]rune("credential_source")) - ec2MetadataLit, _, _ := newLitToken([]rune("Ec2InstanceMetadata")) - - outputID, _, _ := newLitToken([]rune("output")) - outputLit, _, _ := newLitToken([]rune("json")) - - equalOp, _, _ := newOpToken([]rune("= 1234")) - equalColonOp, _, _ := newOpToken([]rune(": 1234")) - numLit, _, _ := newLitToken([]rune("1234")) - defaultID, _, _ := newLitToken([]rune("default")) - assumeID, _, _ := newLitToken([]rune("assumerole")) - - defaultProfileStmt := newSectionStatement(defaultID) - assumeProfileStmt := newSectionStatement(assumeID) - - fooSlashesExpr := newExpression(fooSlashes) - - xEQ1234 := newEqualExpr(newExpression(xID), equalOp) - xEQ1234.AppendChild(newExpression(numLit)) - xEQColon1234 := newEqualExpr(newExpression(xID), equalColonOp) - xEQColon1234.AppendChild(newExpression(numLit)) - - regionEQRegion := newEqualExpr(newExpression(regionID), equalOp) - regionEQRegion.AppendChild(newExpression(regionLit)) - - noQuotesRegionEQRegion := newEqualExpr(newExpression(regionID), equalOp) - noQuotesRegionEQRegion.AppendChild(newExpression(regionNoQuotesLit)) - - credEQExpr := newEqualExpr(newExpression(credentialID), equalOp) - credEQExpr.AppendChild(newExpression(ec2MetadataLit)) - - outputEQExpr := newEqualExpr(newExpression(outputID), equalOp) - outputEQExpr.AppendChild(newExpression(outputLit)) - - cases := []struct { - name string - r io.Reader - expectedStack []AST - expectedError bool - }{ - { - name: "semicolon comment", - r: bytes.NewBuffer([]byte(`;foo`)), - expectedStack: []AST{ - newCommentStatement(newToken(TokenComment, []rune(";foo"), NoneType)), - }, - }, - { - name: "0==0", - r: bytes.NewBuffer([]byte(`0==0`)), - expectedError: true, - }, - { - name: "0=:0", - r: bytes.NewBuffer([]byte(`0=:0`)), - expectedError: true, - }, - { - name: "0:=0", - r: bytes.NewBuffer([]byte(`0:=0`)), - expectedError: true, - }, - { - name: "0::0", - r: bytes.NewBuffer([]byte(`0::0`)), - expectedError: true, - }, - { - name: "section with variable", - r: bytes.NewBuffer([]byte(`[ default ]x`)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newExpression(xID), - }, - }, - { - name: "# comment", - r: bytes.NewBuffer([]byte(`# foo`)), - expectedStack: []AST{ - newCommentStatement(newToken(TokenComment, []rune("# foo"), NoneType)), - }, - }, - { - name: "// not a comment", - r: bytes.NewBuffer([]byte(`//foo`)), - expectedStack: []AST{ - fooSlashesExpr, - }, - }, - { - name: "multiple comments", - r: bytes.NewBuffer([]byte(`;foo - # baz - `)), - expectedStack: []AST{ - newCommentStatement(newToken(TokenComment, []rune(";foo"), NoneType)), - newCommentStatement(newToken(TokenComment, []rune("# baz"), NoneType)), - }, - }, - { - name: "comment followed by skip state", - r: bytes.NewBuffer([]byte(`;foo - //foo - # baz - `)), - expectedStack: []AST{ - newCommentStatement(newToken(TokenComment, []rune(";foo"), NoneType)), - }, - }, - { - name: "assignment", - r: bytes.NewBuffer([]byte(`x = 1234`)), - expectedStack: []AST{ - newExprStatement(xEQ1234), - }, - }, - { - name: "assignment spaceless", - r: bytes.NewBuffer([]byte(`x=1234`)), - expectedStack: []AST{ - newExprStatement(xEQ1234), - }, - }, - { - name: "assignment :", - r: bytes.NewBuffer([]byte(`x : 1234`)), - expectedStack: []AST{ - newExprStatement(xEQColon1234), - }, - }, - { - name: "assignment : no spaces", - r: bytes.NewBuffer([]byte(`x:1234`)), - expectedStack: []AST{ - newExprStatement(xEQColon1234), - }, - }, - { - name: "section expression", - r: bytes.NewBuffer([]byte(`[ default ]`)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - }, - }, - { - name: "section expression no spaces", - r: bytes.NewBuffer([]byte(`[default]`)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - }, - }, - { - name: "section statement", - r: bytes.NewBuffer([]byte(`[default] - region="us-west-2"`)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newExprStatement(regionEQRegion), - }, - }, - { - name: "complex section statement", - r: bytes.NewBuffer([]byte(`[default] - region = us-west-2 - credential_source = Ec2InstanceMetadata - output = json - - [assumerole] - output = json - region = us-west-2 - `)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newExprStatement(noQuotesRegionEQRegion), - newExprStatement(credEQExpr), - newExprStatement(outputEQExpr), - newCompletedSectionStatement( - assumeProfileStmt, - ), - newExprStatement(outputEQExpr), - newExprStatement(noQuotesRegionEQRegion), - }, - }, - { - name: "complex section statement with nested params", - r: bytes.NewBuffer([]byte(`[default] -s3 = - foo=bar - bar=baz -region = us-west-2 -credential_source = Ec2InstanceMetadata -output = json - -[assumerole] -output = json -region = us-west-2 - `)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newSkipStatement(newEqualExpr(newExpression(s3ID), equalOp)), - newExprStatement(noQuotesRegionEQRegion), - newExprStatement(credEQExpr), - newExprStatement(outputEQExpr), - newCompletedSectionStatement( - assumeProfileStmt, - ), - newExprStatement(outputEQExpr), - newExprStatement(noQuotesRegionEQRegion), - }, - }, - { - name: "complex section statement", - r: bytes.NewBuffer([]byte(`[default] -region = us-west-2 -credential_source = Ec2InstanceMetadata -s3 = - foo=bar - bar=baz -output = json - -[assumerole] -output = json -region = us-west-2 - `)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newExprStatement(noQuotesRegionEQRegion), - newExprStatement(credEQExpr), - newSkipStatement(newEqualExpr(newExpression(s3ID), equalOp)), - newExprStatement(outputEQExpr), - newCompletedSectionStatement( - assumeProfileStmt, - ), - newExprStatement(outputEQExpr), - newExprStatement(noQuotesRegionEQRegion), - }, - }, - { - name: "missing section statement", - r: bytes.NewBuffer([]byte( - `[default] -s3 = -[assumerole] -output = json - `)), - expectedStack: []AST{ - newCompletedSectionStatement( - defaultProfileStmt, - ), - newSkipStatement(newEqualExpr(newExpression(s3ID), equalOp)), - newCompletedSectionStatement( - assumeProfileStmt, - ), - newExprStatement(outputEQExpr), - }, - }, - } - - for i, c := range cases { - t.Run(c.name, func(t *testing.T) { - stack, err := ParseAST(c.r) - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %t, but received %t with error %v", i, e, a, err) - } - - if e, a := len(c.expectedStack), len(stack); e != a { - t.Errorf("expected same length %d, but received %d", e, a) - } - - if e, a := c.expectedStack, stack; !reflect.DeepEqual(e, a) { - buf := bytes.Buffer{} - buf.WriteString("expected:\n") - for j := 0; j < len(e); j++ { - buf.WriteString(fmt.Sprintf("\t%d: %v\n", j, e[j])) - } - - buf.WriteString("\nreceived:\n") - for j := 0; j < len(a); j++ { - buf.WriteString(fmt.Sprintf("\t%d: %v\n", j, a[j])) - } - - t.Errorf("%s", buf.String()) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens_test.go deleted file mode 100644 index ff4837f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens_test.go +++ /dev/null @@ -1,200 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "reflect" - "testing" -) - -func TestIsNumberValue(t *testing.T) { - cases := []struct { - name string - b []rune - expected bool - }{ - { - "integer", - []rune("123"), - true, - }, - { - "negative integer", - []rune("-123"), - true, - }, - { - "decimal", - []rune("123.456"), - true, - }, - { - "small e exponent", - []rune("1e234"), - true, - }, - { - "big E exponent", - []rune("1E234"), - true, - }, - { - "error case exponent base 16", - []rune("1ea4"), - false, - }, - { - "error case negative", - []rune("1-23"), - false, - }, - { - "error case multiple negative", - []rune("-1-23"), - false, - }, - { - "error case end negative", - []rune("123-"), - false, - }, - { - "error case non-number", - []rune("a"), - false, - }, - { - "utf8 whitespace", - []rune("0 0"), - true, - }, - } - - for i, c := range cases { - t.Run(c.name, func(t *testing.T) { - if e, a := c.expected, isNumberValue(c.b); e != a { - t.Errorf("%d: expected %t, but received %t", i+1, e, a) - } - }) - } -} - -// TODO: test errors -func TestNewLiteralToken(t *testing.T) { - cases := []struct { - name string - b []rune - expectedRead int - expectedToken Token - expectedError bool - }{ - { - name: "numbers", - b: []rune("123"), - expectedRead: 3, - expectedToken: newToken(TokenLit, - []rune("123"), - IntegerType, - ), - }, - { - name: "decimal", - b: []rune("123.456"), - expectedRead: 7, - expectedToken: newToken(TokenLit, - []rune("123.456"), - DecimalType, - ), - }, - { - name: "two numbers", - b: []rune("123 456"), - expectedRead: 3, - expectedToken: newToken(TokenLit, - []rune("123"), - IntegerType, - ), - }, - { - name: "number followed by alpha", - b: []rune("123 abc"), - expectedRead: 3, - expectedToken: newToken(TokenLit, - []rune("123"), - IntegerType, - ), - }, - { - name: "quoted string followed by number", - b: []rune(`"Hello" 123`), - expectedRead: 7, - expectedToken: newToken(TokenLit, - []rune("Hello"), - QuotedStringType, - ), - }, - { - name: "quoted string", - b: []rune(`"Hello World"`), - expectedRead: 13, - expectedToken: newToken(TokenLit, - []rune("Hello World"), - QuotedStringType, - ), - }, - { - name: "boolean true", - b: []rune("true"), - expectedRead: 4, - expectedToken: newToken(TokenLit, - []rune("true"), - BoolType, - ), - }, - { - name: "boolean false", - b: []rune("false"), - expectedRead: 5, - expectedToken: newToken(TokenLit, - []rune("false"), - BoolType, - ), - }, - { - name: "utf8 whitespace", - b: []rune("0 0"), - expectedRead: 1, - expectedToken: newToken(TokenLit, - []rune("0"), - IntegerType, - ), - }, - { - name: "utf8 whitespace expr", - b: []rune("0=0 0"), - expectedRead: 1, - expectedToken: newToken(TokenLit, - []rune("0"), - StringType, - ), - }, - } - - for i, c := range cases { - t.Run(c.name, func(t *testing.T) { - tok, n, err := newLitToken(c.b) - - if e, a := c.expectedToken.ValueType, tok.ValueType; !reflect.DeepEqual(e, a) { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper_test.go deleted file mode 100644 index da1c757..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper_test.go +++ /dev/null @@ -1,196 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "testing" -) - -func TestNumberHelper(t *testing.T) { - cases := []struct { - b []rune - determineIndex int - - expectedExists []bool - expectedErrors []bool - expectedCorrects []bool - expectedNegative bool - expectedBase int - }{ - { - b: []rune("-10"), - determineIndex: 0, - expectedExists: []bool{ - false, - false, - false, - }, - expectedErrors: []bool{ - false, - false, - false, - }, - expectedCorrects: []bool{ - true, - true, - true, - }, - expectedNegative: true, - expectedBase: 10, - }, - { - b: []rune("0x10"), - determineIndex: 1, - expectedExists: []bool{ - false, - false, - true, - true, - }, - expectedErrors: []bool{ - false, - false, - false, - false, - }, - expectedCorrects: []bool{ - true, - true, - true, - true, - }, - expectedNegative: false, - expectedBase: 16, - }, - { - b: []rune("0b101"), - determineIndex: 1, - expectedExists: []bool{ - false, - false, - true, - true, - true, - }, - expectedErrors: []bool{ - false, - false, - false, - false, - false, - }, - expectedCorrects: []bool{ - true, - true, - true, - true, - true, - }, - expectedNegative: false, - expectedBase: 2, - }, - { - b: []rune("0o271"), - determineIndex: 1, - expectedExists: []bool{ - false, - false, - true, - true, - true, - }, - expectedErrors: []bool{ - false, - false, - false, - false, - false, - }, - expectedCorrects: []bool{ - true, - true, - true, - true, - true, - }, - expectedNegative: false, - expectedBase: 8, - }, - { - b: []rune("99"), - determineIndex: -1, - expectedExists: []bool{ - false, - false, - }, - expectedErrors: []bool{ - false, - false, - }, - expectedCorrects: []bool{ - true, - true, - }, - expectedNegative: false, - expectedBase: 10, - }, - { - b: []rune("0o2o71"), - determineIndex: 1, - expectedExists: []bool{ - false, - false, - true, - true, - true, - true, - }, - expectedErrors: []bool{ - false, - false, - false, - false, - false, - true, - }, - expectedCorrects: []bool{ - true, - true, - true, - false, - true, - true, - }, - expectedNegative: false, - expectedBase: 8, - }, - } - - for _, c := range cases { - helper := numberHelper{} - - for i := 0; i < len(c.b); i++ { - if e, a := c.expectedExists[i], helper.Exists(); e != a { - t.Errorf("expected %t, but received %t", e, a) - } - - if i == c.determineIndex { - if e, a := c.expectedErrors[i], helper.Determine(c.b[i]) != nil; e != a { - t.Errorf("expected %t, but received %t", e, a) - } - } else { - if e, a := c.expectedCorrects[i], helper.CorrectByte(c.b[i]); e != a { - t.Errorf("expected %t, but received %t", e, a) - } - } - } - - if e, a := c.expectedNegative, helper.IsNegative(); e != a { - t.Errorf("expected %t, but received %t", e, a) - } - - if e, a := c.expectedBase, helper.Base(); e != a { - t.Errorf("expected %d, but received %d", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens_test.go deleted file mode 100644 index 9dfcda0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "reflect" - "testing" -) - -func TestIsOp(t *testing.T) { - cases := []struct { - b []rune - expected bool - }{ - { - b: []rune(``), - }, - { - b: []rune("123"), - }, - { - b: []rune(`"wee"`), - }, - { - b: []rune("="), - expected: true, - }, - { - b: []rune(":"), - expected: true, - }, - } - - for i, c := range cases { - if e, a := c.expected, isOp(c.b); e != a { - t.Errorf("%d: expected %t, but received %t", i+0, e, a) - } - } -} - -func TestNewOp(t *testing.T) { - cases := []struct { - b []rune - expectedRead int - expectedError bool - expectedToken Token - }{ - { - b: []rune("="), - expectedRead: 1, - expectedToken: newToken(TokenOp, []rune("="), NoneType), - }, - { - b: []rune(":"), - expectedRead: 1, - expectedToken: newToken(TokenOp, []rune(":"), NoneType), - }, - } - - for i, c := range cases { - tok, n, err := newOpToken(c.b) - - if e, a := c.expectedToken, tok; !reflect.DeepEqual(e, a) { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack_test.go deleted file mode 100644 index f22c124..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "reflect" - "testing" -) - -func newMockAST(v []rune) AST { - return newASTWithRootToken(ASTKindNone, Token{raw: v}) -} - -func TestStack(t *testing.T) { - cases := []struct { - asts []AST - expected []AST - }{ - { - asts: []AST{ - newMockAST([]rune("0")), - newMockAST([]rune("1")), - newMockAST([]rune("2")), - newMockAST([]rune("3")), - newMockAST([]rune("4")), - }, - expected: []AST{ - newMockAST([]rune("0")), - newMockAST([]rune("1")), - newMockAST([]rune("2")), - newMockAST([]rune("3")), - newMockAST([]rune("4")), - }, - }, - } - - for _, c := range cases { - p := newParseStack(10, 10) - for _, ast := range c.asts { - p.Push(ast) - p.MarkComplete(ast) - } - - if e, a := len(c.expected), p.Len(); e != a { - t.Errorf("expected the same legnth with %d, but received %d", e, a) - } - for i := len(c.expected) - 1; i >= 0; i-- { - if e, a := c.expected[i], p.Pop(); !reflect.DeepEqual(e, a) { - t.Errorf("stack element %d invalid: expected %v, but received %v", i, e, a) - } - } - - if e, a := len(c.expected), p.index; e != a { - t.Errorf("expected %d, but received %d", e, a) - } - - if e, a := c.asts, p.list[:p.index]; !reflect.DeepEqual(e, a) { - t.Errorf("expected %v, but received %v", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens_test.go deleted file mode 100644 index 2b5d68a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "reflect" - "testing" -) - -func TestIsSep(t *testing.T) { - cases := []struct { - b []rune - expected bool - }{ - { - b: []rune(``), - }, - { - b: []rune(`"wee"`), - }, - { - b: []rune("["), - expected: true, - }, - { - b: []rune("]"), - expected: true, - }, - } - - for i, c := range cases { - if e, a := c.expected, isSep(c.b); e != a { - t.Errorf("%d: expected %t, but received %t", i+0, e, a) - } - } -} - -func TestNewSep(t *testing.T) { - cases := []struct { - b []rune - expectedRead int - expectedError bool - expectedToken Token - }{ - { - b: []rune("["), - expectedRead: 1, - expectedToken: newToken(TokenSep, []rune("["), NoneType), - }, - { - b: []rune("]"), - expectedRead: 1, - expectedToken: newToken(TokenSep, []rune("]"), NoneType), - }, - } - - for i, c := range cases { - tok, n, err := newSepToken(c.b) - - if e, a := c.expectedToken, tok; !reflect.DeepEqual(e, a) { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper_test.go deleted file mode 100644 index d070edb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper_test.go +++ /dev/null @@ -1,87 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "reflect" - "testing" -) - -func TestSkipper(t *testing.T) { - idTok, _, _ := newLitToken([]rune("id")) - nlTok := newToken(TokenNL, []rune("\n"), NoneType) - - cases := []struct { - name string - Fn func(s *skipper) - param Token - expected bool - expectedShouldSkip bool - expectedPrevTok Token - }{ - { - name: "empty case", - Fn: func(s *skipper) { - }, - param: emptyToken, - expectedPrevTok: emptyToken, - }, - { - name: "skip case", - Fn: func(s *skipper) { - s.Skip() - }, - param: idTok, - expectedShouldSkip: true, - expected: true, - expectedPrevTok: emptyToken, - }, - { - name: "continue case", - Fn: func(s *skipper) { - s.Continue() - }, - param: emptyToken, - expectedPrevTok: emptyToken, - }, - { - name: "skip then continue case", - Fn: func(s *skipper) { - s.Skip() - s.Continue() - }, - param: emptyToken, - expectedPrevTok: emptyToken, - }, - { - name: "do not skip case", - Fn: func(s *skipper) { - s.Skip() - s.prevTok = nlTok - }, - param: idTok, - expectedShouldSkip: true, - expectedPrevTok: nlTok, - }, - } - - for _, c := range cases { - - t.Run(c.name, func(t *testing.T) { - s := newSkipper() - c.Fn(&s) - - if e, a := c.expectedShouldSkip, s.shouldSkip; e != a { - t.Errorf("%s: expected %t, but received %t", c.name, e, a) - } - - if e, a := c.expectedPrevTok, s.prevTok; !reflect.DeepEqual(e, a) { - t.Errorf("%s: expected %v, but received %v", c.name, e, a) - } - - if e, a := c.expected, s.ShouldSkip(c.param); e != a { - t.Errorf("%s: expected %t, but received %t", c.name, e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/trim_spaces_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/trim_spaces_test.go deleted file mode 100644 index 2b8005a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/trim_spaces_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package ini - -import ( - "reflect" - "testing" -) - -func TestTrimSpaces(t *testing.T) { - cases := []struct { - name string - node AST - expectedNode AST - }{ - { - name: "simple case", - node: AST{ - Root: Token{ - raw: []rune("foo"), - }, - }, - expectedNode: AST{ - Root: Token{ - raw: []rune("foo"), - }, - }, - }, - { - name: "LHS case", - node: AST{ - Root: Token{ - raw: []rune(" foo"), - }, - }, - expectedNode: AST{ - Root: Token{ - raw: []rune("foo"), - }, - }, - }, - { - name: "RHS case", - node: AST{ - Root: Token{ - raw: []rune("foo "), - }, - }, - expectedNode: AST{ - Root: Token{ - raw: []rune("foo"), - }, - }, - }, - { - name: "both sides case", - node: AST{ - Root: Token{ - raw: []rune(" foo "), - }, - }, - expectedNode: AST{ - Root: Token{ - raw: []rune("foo"), - }, - }, - }, - } - - for _, c := range cases { - node := trimSpaces(c.node) - - if e, a := c.expectedNode, node; !reflect.DeepEqual(e, a) { - t.Errorf("%s: expected %v, but received %v", c.name, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util_test.go deleted file mode 100644 index b4c8d15..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util_test.go +++ /dev/null @@ -1,164 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "testing" -) - -func TestStringValue(t *testing.T) { - cases := []struct { - b []rune - expectedRead int - expectedError bool - expectedValue string - }{ - { - b: []rune(`"foo"`), - expectedRead: 5, - expectedValue: `"foo"`, - }, - { - b: []rune(`"123 !$_ 456 abc"`), - expectedRead: 17, - expectedValue: `"123 !$_ 456 abc"`, - }, - { - b: []rune("foo"), - expectedError: true, - }, - { - b: []rune(` "foo"`), - expectedError: true, - }, - } - - for i, c := range cases { - n, err := getStringValue(c.b) - - if e, a := c.expectedValue, string(c.b[:n]); e != a { - t.Errorf("%d: expected %v, but received %v", i, e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("%d: expected %v, but received %v", i, e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %v, but received %v", i, e, a) - } - } -} - -func TestBoolValue(t *testing.T) { - cases := []struct { - b []rune - expectedRead int - expectedError bool - expectedValue string - }{ - { - b: []rune("true"), - expectedRead: 4, - expectedValue: "true", - }, - { - b: []rune("false"), - expectedRead: 5, - expectedValue: "false", - }, - { - b: []rune(`"false"`), - expectedError: true, - }, - } - - for _, c := range cases { - n, err := getBoolValue(c.b) - - if e, a := c.expectedValue, string(c.b[:n]); e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("expected %v, but received %v", e, a) - } - } -} - -func TestNumericalValue(t *testing.T) { - cases := []struct { - b []rune - expectedRead int - expectedError bool - expectedValue string - expectedBase int - }{ - { - b: []rune("1.2"), - expectedRead: 3, - expectedValue: "1.2", - expectedBase: 10, - }, - { - b: []rune("123"), - expectedRead: 3, - expectedValue: "123", - expectedBase: 10, - }, - { - b: []rune("0x123A"), - expectedRead: 6, - expectedValue: "0x123A", - expectedBase: 16, - }, - { - b: []rune("0b101"), - expectedRead: 5, - expectedValue: "0b101", - expectedBase: 2, - }, - { - b: []rune("0o7"), - expectedRead: 3, - expectedValue: "0o7", - expectedBase: 8, - }, - { - b: []rune(`"123"`), - expectedError: true, - }, - { - b: []rune("0xo123"), - expectedError: true, - }, - { - b: []rune("123A"), - expectedError: true, - }, - } - - for i, c := range cases { - base, n, err := getNumericalValue(c.b) - - if e, a := c.expectedValue, string(c.b[:n]); e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedRead, n; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedError, err != nil; e != a { - t.Errorf("%d: expected %v, but received %v", i+1, e, a) - } - - if e, a := c.expectedBase, base; e != a { - t.Errorf("%d: expected %d, but received %d", i+1, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/walker_test.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/walker_test.go deleted file mode 100644 index 6c43fd8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/walker_test.go +++ /dev/null @@ -1,144 +0,0 @@ -// +build go1.7 - -package ini - -import ( - "encoding/json" - "io/ioutil" - "os" - "path/filepath" - "strings" - "testing" -) - -func TestValidDataFiles(t *testing.T) { - const expectedFileSuffix = "_expected" - filepath.Walk("./testdata/valid", func(path string, info os.FileInfo, err error) error { - if strings.HasSuffix(path, expectedFileSuffix) { - return nil - } - - if info.IsDir() { - return nil - } - - f, err := os.Open(path) - if err != nil { - t.Errorf("%s: unexpected error, %v", path, err) - } - defer f.Close() - - tree, err := ParseAST(f) - if err != nil { - t.Errorf("%s: unexpected parse error, %v", path, err) - } - - v := NewDefaultVisitor() - err = Walk(tree, v) - if err != nil { - t.Errorf("%s: unexpected walk error, %v", path, err) - } - - expectedPath := path + "_expected" - e := map[string]interface{}{} - - b, err := ioutil.ReadFile(expectedPath) - if err != nil { - // ignore files that do not have an expected file - return nil - } - - err = json.Unmarshal(b, &e) - if err != nil { - t.Errorf("unexpected error during deserialization, %v", err) - } - - for profile, tableIface := range e { - p, ok := v.Sections.GetSection(profile) - if !ok { - t.Fatal("could not find profile " + profile) - } - - table := tableIface.(map[string]interface{}) - for k, v := range table { - switch e := v.(type) { - case string: - a := p.String(k) - if e != a { - t.Errorf("%s: expected %v, but received %v for profile %v", path, e, a, profile) - } - case int: - a := p.Int(k) - if int64(e) != a { - t.Errorf("%s: expected %v, but received %v", path, e, a) - } - case float64: - v := p.values[k] - if v.Type == IntegerType { - a := p.Int(k) - if int64(e) != a { - t.Errorf("%s: expected %v, but received %v", path, e, a) - } - } else { - a := p.Float64(k) - if e != a { - t.Errorf("%s: expected %v, but received %v", path, e, a) - } - } - default: - t.Errorf("unexpected type: %T", e) - } - } - } - - return nil - }) -} - -func TestInvalidDataFiles(t *testing.T) { - cases := []struct { - path string - expectedParseError bool - expectedWalkError bool - }{ - { - path: "./testdata/invalid/bad_syntax_1", - expectedParseError: true, - }, - { - path: "./testdata/invalid/incomplete_section_profile", - expectedParseError: true, - }, - { - path: "./testdata/invalid/syntax_error_comment", - expectedParseError: true, - }, - } - - for i, c := range cases { - t.Run(c.path, func(t *testing.T) { - f, err := os.Open(c.path) - if err != nil { - t.Errorf("unexpected error, %v", err) - } - defer f.Close() - - tree, err := ParseAST(f) - if err != nil && !c.expectedParseError { - t.Errorf("%d: unexpected error, %v", i+1, err) - } else if err == nil && c.expectedParseError { - t.Errorf("%d: expected error, but received none", i+1) - } - - if c.expectedParseError { - return - } - - v := NewDefaultVisitor() - err = Walk(tree, v) - if err == nil && c.expectedWalkError { - t.Errorf("%d: expected error, but received none", i+1) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path_test.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path_test.go deleted file mode 100644 index 1ad18e6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package sdkuri - -import "testing" - -func TestPathJoin(t *testing.T) { - cases := []struct { - Elems []string - Expect string - }{ - {Elems: []string{"/"}, Expect: "/"}, - {Elems: []string{}, Expect: ""}, - {Elems: []string{"blah", "el", "blah/"}, Expect: "blah/el/blah/"}, - {Elems: []string{"/asd", "asdfa", "asdfasd/"}, Expect: "/asd/asdfa/asdfasd/"}, - {Elems: []string{"asdfa", "asdfa", "asdfads"}, Expect: "asdfa/asdfa/asdfads"}, - } - for _, c := range cases { - if e, a := c.Expect, PathJoin(c.Elems...); e != a { - t.Errorf("expect %v, got %v", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_other_test.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_other_test.go deleted file mode 100644 index e17d44d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_other_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build !windows - -package shareddefaults_test - -import ( - "os" - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func TestSharedCredsFilename(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("HOME", "home_dir") - os.Setenv("USERPROFILE", "profile_dir") - - expect := filepath.Join("home_dir", ".aws", "credentials") - - name := shareddefaults.SharedCredentialsFilename() - if e, a := expect, name; e != a { - t.Errorf("expect %q shared creds filename, got %q", e, a) - } -} - -func TestSharedConfigFilename(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("HOME", "home_dir") - os.Setenv("USERPROFILE", "profile_dir") - - expect := filepath.Join("home_dir", ".aws", "config") - - name := shareddefaults.SharedConfigFilename() - if e, a := expect, name; e != a { - t.Errorf("expect %q shared config filename, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_windows_test.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_windows_test.go deleted file mode 100644 index 4a38998..0000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_windows_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build windows - -package shareddefaults_test - -import ( - "os" - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdktesting" - "github.com/aws/aws-sdk-go/internal/shareddefaults" -) - -func TestSharedCredsFilename(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("HOME", "home_dir") - os.Setenv("USERPROFILE", "profile_dir") - - expect := filepath.Join("profile_dir", ".aws", "credentials") - - name := shareddefaults.SharedCredentialsFilename() - if e, a := expect, name; e != a { - t.Errorf("expect %q shared creds filename, got %q", e, a) - } -} - -func TestSharedConfigFilename(t *testing.T) { - restoreEnvFn := sdktesting.StashEnv() - defer restoreEnvFn() - - os.Setenv("HOME", "home_dir") - os.Setenv("USERPROFILE", "profile_dir") - - expect := filepath.Join("profile_dir", ".aws", "config") - - name := shareddefaults.SharedConfigFilename() - if e, a := expect, name; e != a { - t.Errorf("expect %q shared config filename, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/README.md b/vendor/github.com/aws/aws-sdk-go/private/README.md deleted file mode 100644 index 5bdb4c5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## AWS SDK for Go Private packages ## -`private` is a collection of packages used internally by the SDK, and is subject to have breaking changes. This package is not `internal` so that if you really need to use its functionality, and understand breaking changes will be made, you are able to. - -These packages will be refactored in the future so that the API generator and model parsers are exposed cleanly on their own. Making it easier for you to generate your own code based on the API models. diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode_test.go deleted file mode 100644 index 92f8e87..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode_test.go +++ /dev/null @@ -1,174 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/hex" - "io/ioutil" - "os" - "reflect" - "testing" -) - -func TestWriteEncodedFromDecoded(t *testing.T) { - cases, err := readPositiveTests("testdata") - if err != nil { - t.Fatalf("failed to load positive tests, %v", err) - } - - for _, c := range cases { - f, err := ioutil.TempFile(os.TempDir(), "encoded_positive_"+c.Name) - if err != nil { - t.Fatalf("failed to open %q, %v", c.Name, err) - } - - encoder := NewEncoder(f) - - msg := c.Decoded.Message() - if err := encoder.Encode(msg); err != nil { - t.Errorf("failed to encode %q, %v", c.Name, err) - } - - if err = f.Close(); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - if err = os.Remove(f.Name()); err != nil { - t.Errorf("expected %v, got %v", "no error", err) - } - } -} - -func TestDecoder_Decode(t *testing.T) { - cases, err := readPositiveTests("testdata") - if err != nil { - t.Fatalf("failed to load positive tests, %v", err) - } - - for _, c := range cases { - decoder := NewDecoder(bytes.NewBuffer(c.Encoded)) - - msg, err := decoder.Decode(nil) - if err != nil { - t.Fatalf("%s, expect no decode error, got %v", c.Name, err) - } - - raw, err := msg.rawMessage() // rawMessage will fail if payload read CRC fails - if err != nil { - t.Fatalf("%s, failed to get raw decoded message %v", c.Name, err) - } - - if e, a := c.Decoded.Length, raw.Length; e != a { - t.Errorf("%s, expect %v length, got %v", c.Name, e, a) - } - if e, a := c.Decoded.HeadersLen, raw.HeadersLen; e != a { - t.Errorf("%s, expect %v HeadersLen, got %v", c.Name, e, a) - } - if e, a := c.Decoded.PreludeCRC, raw.PreludeCRC; e != a { - t.Errorf("%s, expect %v PreludeCRC, got %v", c.Name, e, a) - } - if e, a := Headers(c.Decoded.Headers), msg.Headers; !reflect.DeepEqual(e, a) { - t.Errorf("%s, expect %v headers, got %v", c.Name, e, a) - } - if e, a := c.Decoded.Payload, raw.Payload; !bytes.Equal(e, a) { - t.Errorf("%s, expect %v payload, got %v", c.Name, e, a) - } - if e, a := c.Decoded.CRC, raw.CRC; e != a { - t.Errorf("%s, expect %v CRC, got %v", c.Name, e, a) - } - } -} - -func TestDecoder_Decode_Negative(t *testing.T) { - cases, err := readNegativeTests("testdata") - if err != nil { - t.Fatalf("failed to load negative tests, %v", err) - } - - for _, c := range cases { - decoder := NewDecoder(bytes.NewBuffer(c.Encoded)) - - msg, err := decoder.Decode(nil) - if err == nil { - rawMsg, rawMsgErr := msg.rawMessage() - t.Fatalf("%s, expect error, got none, %s,\n%s\n%#v, %v\n", c.Name, - c.Err, hex.Dump(c.Encoded), rawMsg, rawMsgErr) - } - } -} - -var testEncodedMsg = []byte{0, 0, 0, 61, 0, 0, 0, 32, 7, 253, 131, 150, 12, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 7, 0, 16, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 106, 115, 111, 110, 123, 39, 102, 111, 111, 39, 58, 39, 98, 97, 114, 39, 125, 141, 156, 8, 177} - -func TestDecoder_DecodeMultipleMessages(t *testing.T) { - const ( - expectMsgCount = 10 - expectPayloadLen = 13 - ) - - r := bytes.NewBuffer(nil) - for i := 0; i < expectMsgCount; i++ { - r.Write(testEncodedMsg) - } - - decoder := NewDecoder(r) - - var err error - var msg Message - var count int - for { - msg, err = decoder.Decode(nil) - if err != nil { - break - } - count++ - - if e, a := expectPayloadLen, len(msg.Payload); e != a { - t.Errorf("expect %v payload len, got %v", e, a) - } - - if e, a := []byte(`{'foo':'bar'}`), msg.Payload; !bytes.Equal(e, a) { - t.Errorf("expect %v payload, got %v", e, a) - } - } - - type causer interface { - Cause() error - } - if err != nil && count != expectMsgCount { - t.Fatalf("expect, no error, got %v", err) - } - - if e, a := expectMsgCount, count; e != a { - t.Errorf("expect %v messages read, got %v", e, a) - } -} - -func BenchmarkDecode(b *testing.B) { - r := bytes.NewReader(testEncodedMsg) - decoder := NewDecoder(r) - payloadBuf := make([]byte, 0, 5*1024) - b.ResetTimer() - - for i := 0; i < b.N; i++ { - msg, err := decoder.Decode(payloadBuf) - if err != nil { - b.Fatal(err) - } - - // Release the payload buffer - payloadBuf = msg.Payload[0:0] - r.Seek(0, 0) - } -} - -func BenchmarkDecode_NoPayloadBuf(b *testing.B) { - r := bytes.NewReader(testEncodedMsg) - decoder := NewDecoder(r) - b.ResetTimer() - - for i := 0; i < b.N; i++ { - _, err := decoder.Decode(nil) - if err != nil { - b.Fatal(err) - } - r.Seek(0, 0) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode_test.go deleted file mode 100644 index 0cbfe4a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/hex" - "reflect" - "testing" -) - -func TestEncoder_Encode(t *testing.T) { - cases, err := readPositiveTests("testdata") - if err != nil { - t.Fatalf("failed to load positive tests, %v", err) - } - - for _, c := range cases { - var w bytes.Buffer - encoder := NewEncoder(&w) - - err = encoder.Encode(c.Decoded.Message()) - if err != nil { - t.Fatalf("%s, failed to encode message, %v", c.Name, err) - } - - if e, a := c.Encoded, w.Bytes(); !reflect.DeepEqual(e, a) { - t.Errorf("%s, expect:\n%v\nactual:\n%v\n", c.Name, - hex.Dump(e), hex.Dump(a)) - } - } -} - -func BenchmarkEncode(b *testing.B) { - var w bytes.Buffer - encoder := NewEncoder(&w) - msg := Message{ - Headers: Headers{ - {Name: "event-id", Value: Int16Value(123)}, - }, - Payload: []byte(`{"abc":123}`), - } - - b.ResetTimer() - - for i := 0; i < b.N; i++ { - err := encoder.Encode(msg) - if err != nil { - b.Fatal(err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api_test.go deleted file mode 100644 index ed8bfec..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api_test.go +++ /dev/null @@ -1,253 +0,0 @@ -package eventstreamapi - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "testing" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" - "github.com/aws/aws-sdk-go/private/protocol/restjson" -) - -var eventMessageTypeHeader = eventstream.Header{ - Name: MessageTypeHeader, - Value: eventstream.StringValue(EventMessageType), -} - -func TestEventReader(t *testing.T) { - stream := createStream( - eventstream.Message{ - Headers: eventstream.Headers{ - eventMessageTypeHeader, - eventstream.Header{ - Name: EventTypeHeader, - Value: eventstream.StringValue("eventABC"), - }, - }, - }, - eventstream.Message{ - Headers: eventstream.Headers{ - eventMessageTypeHeader, - eventstream.Header{ - Name: EventTypeHeader, - Value: eventstream.StringValue("eventEFG"), - }, - }, - }, - ) - - var unmarshalers request.HandlerList - unmarshalers.PushBackNamed(restjson.UnmarshalHandler) - - eventReader := NewEventReader(stream, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - unmarshalerForEventType, - ) - - event, err := eventReader.ReadEvent() - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if event == nil { - t.Fatalf("expect event got none") - } - - event, err = eventReader.ReadEvent() - if err == nil { - t.Fatalf("expect error for unknown event, got none") - } - - if event != nil { - t.Fatalf("expect no event, got %T, %v", event, event) - } -} - -func TestEventReader_Error(t *testing.T) { - stream := createStream( - eventstream.Message{ - Headers: eventstream.Headers{ - eventstream.Header{ - Name: MessageTypeHeader, - Value: eventstream.StringValue(ErrorMessageType), - }, - eventstream.Header{ - Name: ErrorCodeHeader, - Value: eventstream.StringValue("errorCode"), - }, - eventstream.Header{ - Name: ErrorMessageHeader, - Value: eventstream.StringValue("error message occur"), - }, - }, - }, - ) - - var unmarshalers request.HandlerList - unmarshalers.PushBackNamed(restjson.UnmarshalHandler) - - eventReader := NewEventReader(stream, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - unmarshalerForEventType, - ) - - event, err := eventReader.ReadEvent() - if err == nil { - t.Fatalf("expect error got none") - } - - if event != nil { - t.Fatalf("expect no event, got %v", event) - } - - if e, a := "errorCode: error message occur", err.Error(); e != a { - t.Errorf("expect %v error, got %v", e, a) - } -} - -func TestEventReader_Exception(t *testing.T) { - eventMsgs := []eventstream.Message{ - { - Headers: eventstream.Headers{ - eventstream.Header{ - Name: MessageTypeHeader, - Value: eventstream.StringValue(ExceptionMessageType), - }, - eventstream.Header{ - Name: ExceptionTypeHeader, - Value: eventstream.StringValue("exception"), - }, - }, - Payload: []byte(`{"message":"exception message"}`), - }, - } - stream := createStream(eventMsgs...) - - var unmarshalers request.HandlerList - unmarshalers.PushBackNamed(restjson.UnmarshalHandler) - - eventReader := NewEventReader(stream, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - unmarshalerForEventType, - ) - - event, err := eventReader.ReadEvent() - if err == nil { - t.Fatalf("expect error got none") - } - - if event != nil { - t.Fatalf("expect no event, got %v", event) - } - - et := err.(*exceptionType) - if e, a := string(eventMsgs[0].Payload), string(et.Payload); e != a { - t.Errorf("expect %v payload, got %v", e, a) - } -} - -func BenchmarkEventReader(b *testing.B) { - var buf bytes.Buffer - encoder := eventstream.NewEncoder(&buf) - msg := eventstream.Message{ - Headers: eventstream.Headers{ - eventMessageTypeHeader, - eventstream.Header{ - Name: EventTypeHeader, - Value: eventstream.StringValue("eventABC"), - }, - }, - } - if err := encoder.Encode(msg); err != nil { - b.Fatalf("failed to encode message, %v", err) - } - stream := bytes.NewReader(buf.Bytes()) - - var unmarshalers request.HandlerList - unmarshalers.PushBackNamed(restjson.UnmarshalHandler) - - eventReader := NewEventReader(ioutil.NopCloser(stream), - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - unmarshalerForEventType, - ) - b.ResetTimer() - - for i := 0; i < b.N; i++ { - stream.Seek(0, 0) - - event, err := eventReader.ReadEvent() - if err != nil { - b.Fatalf("expect no error, got %v", err) - } - if event == nil { - b.Fatalf("expect event got none") - } - } -} - -func unmarshalerForEventType(eventType string) (Unmarshaler, error) { - switch eventType { - case "eventABC": - return &eventABC{}, nil - case "exception": - return &exceptionType{}, nil - default: - return nil, fmt.Errorf("unknown event type, %v", eventType) - } -} - -type eventABC struct { - _ struct{} - - HeaderField string - Payload []byte -} - -func (e *eventABC) UnmarshalEvent( - unmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - return nil -} - -func createStream(msgs ...eventstream.Message) io.ReadCloser { - w := bytes.NewBuffer(nil) - - encoder := eventstream.NewEncoder(w) - - for _, msg := range msgs { - if err := encoder.Encode(msg); err != nil { - panic("createStream failed, " + err.Error()) - } - } - - return ioutil.NopCloser(w) -} - -type exceptionType struct { - Payload []byte -} - -func (e exceptionType) Error() string { - return fmt.Sprintf("exception error message") -} - -func (e *exceptionType) UnmarshalEvent( - unmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - e.Payload = msg.Payload - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_test.go deleted file mode 100644 index d28096e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package eventstream - -import ( - "reflect" - "testing" - "time" -) - -func TestHeaders_Set(t *testing.T) { - expect := Headers{ - {Name: "ABC", Value: StringValue("123")}, - {Name: "EFG", Value: TimestampValue(time.Time{})}, - } - - var actual Headers - actual.Set("ABC", Int32Value(123)) - actual.Set("ABC", StringValue("123")) // replace case - actual.Set("EFG", TimestampValue(time.Time{})) - - if e, a := expect, actual; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v headers, got %v", e, a) - } -} - -func TestHeaders_Get(t *testing.T) { - headers := Headers{ - {Name: "ABC", Value: StringValue("123")}, - {Name: "EFG", Value: TimestampValue(time.Time{})}, - } - - cases := []struct { - Name string - Value Value - }{ - {Name: "ABC", Value: StringValue("123")}, - {Name: "EFG", Value: TimestampValue(time.Time{})}, - {Name: "NotFound"}, - } - - for i, c := range cases { - actual := headers.Get(c.Name) - if e, a := c.Value, actual; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v value, got %v", i, e, a) - } - } -} - -func TestHeaders_Del(t *testing.T) { - headers := Headers{ - {Name: "ABC", Value: StringValue("123")}, - {Name: "EFG", Value: TimestampValue(time.Time{})}, - {Name: "HIJ", Value: StringValue("123")}, - {Name: "KML", Value: TimestampValue(time.Time{})}, - } - expectAfterDel := Headers{ - {Name: "EFG", Value: TimestampValue(time.Time{})}, - } - - headers.Del("HIJ") - headers.Del("ABC") - headers.Del("KML") - - if e, a := expectAfterDel, headers; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v headers, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value_test.go deleted file mode 100644 index f2e67f2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/binary" - "io" - "reflect" - "testing" - "time" -) - -func binWrite(v interface{}) []byte { - var w bytes.Buffer - binary.Write(&w, binary.BigEndian, v) - return w.Bytes() -} - -var testValueEncodingCases = []struct { - Val Value - Expect []byte - Decode func(io.Reader) (Value, error) -}{ - { - BoolValue(true), - []byte{byte(trueValueType)}, - nil, - }, - { - BoolValue(false), - []byte{byte(falseValueType)}, - nil, - }, - { - Int8Value(0x0f), - []byte{byte(int8ValueType), 0x0f}, - func(r io.Reader) (Value, error) { - var v Int8Value - err := v.decode(r) - return v, err - }, - }, - { - Int16Value(0x0f), - append([]byte{byte(int16ValueType)}, binWrite(int16(0x0f))...), - func(r io.Reader) (Value, error) { - var v Int16Value - err := v.decode(r) - return v, err - }, - }, - { - Int32Value(0x0f), - append([]byte{byte(int32ValueType)}, binWrite(int32(0x0f))...), - func(r io.Reader) (Value, error) { - var v Int32Value - err := v.decode(r) - return v, err - }, - }, - { - Int64Value(0x0f), - append([]byte{byte(int64ValueType)}, binWrite(int64(0x0f))...), - func(r io.Reader) (Value, error) { - var v Int64Value - err := v.decode(r) - return v, err - }, - }, - { - BytesValue([]byte{0, 1, 2, 3}), - []byte{byte(bytesValueType), 0x00, 0x04, 0, 1, 2, 3}, - func(r io.Reader) (Value, error) { - var v BytesValue - err := v.decode(r) - return v, err - }, - }, - { - StringValue("abc123"), - append([]byte{byte(stringValueType), 0, 6}, []byte("abc123")...), - func(r io.Reader) (Value, error) { - var v StringValue - err := v.decode(r) - return v, err - }, - }, - { - TimestampValue( - time.Date(2014, 04, 04, 0, 1, 0, 0, time.FixedZone("PDT", -7)), - ), - append([]byte{byte(timestampValueType)}, binWrite(int64(1396569667000))...), - func(r io.Reader) (Value, error) { - var v TimestampValue - err := v.decode(r) - return v, err - }, - }, - { - UUIDValue( - [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}, - ), - []byte{byte(uuidValueType), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}, - func(r io.Reader) (Value, error) { - var v UUIDValue - err := v.decode(r) - return v, err - }, - }, -} - -func TestValue_MarshalValue(t *testing.T) { - for i, c := range testValueEncodingCases { - var w bytes.Buffer - - if err := c.Val.encode(&w); err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - if e, a := c.Expect, w.Bytes(); !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } -} - -func TestHeader_DecodeValues(t *testing.T) { - for i, c := range testValueEncodingCases { - r := bytes.NewBuffer(c.Expect) - v, err := decodeHeaderValue(r) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - switch tv := v.(type) { - case TimestampValue: - exp := time.Time(c.Val.(TimestampValue)) - if e, a := exp, time.Time(tv); !e.Equal(a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - default: - if e, a := c.Val, v; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } - } -} - -func TestValue_Decode(t *testing.T) { - for i, c := range testValueEncodingCases { - if c.Decode == nil { - continue - } - - r := bytes.NewBuffer(c.Expect) - r.ReadByte() // strip off Type field - - v, err := c.Decode(r) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - switch tv := v.(type) { - case TimestampValue: - exp := time.Time(c.Val.(TimestampValue)) - if e, a := exp, time.Time(tv); !e.Equal(a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - default: - if e, a := c.Val, v; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } - } -} - -func TestValue_String(t *testing.T) { - cases := []struct { - Val Value - Expect string - }{ - {BoolValue(true), "true"}, - {BoolValue(false), "false"}, - {Int8Value(0x0f), "0x0f"}, - {Int16Value(0x0f), "0x000f"}, - {Int32Value(0x0f), "0x0000000f"}, - {Int64Value(0x0f), "0x000000000000000f"}, - {BytesValue([]byte{0, 1, 2, 3}), "AAECAw=="}, - {StringValue("abc123"), "abc123"}, - {TimestampValue( - time.Date(2014, 04, 04, 0, 1, 0, 0, time.FixedZone("PDT", -7)), - ), - "1396569667000", - }, - {UUIDValue([16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}), - "00010203-0405-0607-0809-0A0B0C0D0E0F", - }, - } - - for i, c := range cases { - if e, a := c.Expect, c.Val.String(); e != a { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/shared_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/shared_test.go deleted file mode 100644 index 09e0f96..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/shared_test.go +++ /dev/null @@ -1,152 +0,0 @@ -package eventstream - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "path/filepath" - "testing" -) - -type testCase struct { - Name string - Encoded []byte - Decoded decodedMessage -} - -type testErrorCase struct { - Name string - Encoded []byte - Err string -} - -type rawTestCase struct { - Name string - Encoded, Decoded []byte -} - -func readRawTestCases(root, class string) (map[string]rawTestCase, error) { - encoded, err := readTests(filepath.Join(root, "encoded", class)) - if err != nil { - return nil, err - } - - decoded, err := readTests(filepath.Join(root, "decoded", class)) - if err != nil { - return nil, err - } - - if len(encoded) == 0 { - return nil, fmt.Errorf("expect encoded cases, found none") - } - - if len(encoded) != len(decoded) { - return nil, fmt.Errorf("encoded and decoded sets different") - } - - rawCases := map[string]rawTestCase{} - for name, encData := range encoded { - decData, ok := decoded[name] - if !ok { - return nil, fmt.Errorf("encoded %q case not found in decoded set", name) - } - - rawCases[name] = rawTestCase{ - Name: name, - Encoded: encData, - Decoded: decData, - } - } - - return rawCases, nil -} - -func readNegativeTests(root string) ([]testErrorCase, error) { - rawCases, err := readRawTestCases(root, "negative") - if err != nil { - return nil, err - } - - cases := make([]testErrorCase, 0, len(rawCases)) - for name, rawCase := range rawCases { - cases = append(cases, testErrorCase{ - Name: name, - Encoded: rawCase.Encoded, - Err: string(rawCase.Decoded), - }) - } - - return cases, nil -} - -func readPositiveTests(root string) ([]testCase, error) { - rawCases, err := readRawTestCases(root, "positive") - if err != nil { - return nil, err - } - - cases := make([]testCase, 0, len(rawCases)) - for name, rawCase := range rawCases { - - var dec decodedMessage - if err := json.Unmarshal(rawCase.Decoded, &dec); err != nil { - return nil, fmt.Errorf("failed to decode %q, %v", name, err) - } - - cases = append(cases, testCase{ - Name: name, - Encoded: rawCase.Encoded, - Decoded: dec, - }) - } - - return cases, nil -} - -func readTests(root string) (map[string][]byte, error) { - items, err := ioutil.ReadDir(root) - if err != nil { - return nil, fmt.Errorf("failed to read test suite %q dirs, %v", root, err) - } - - cases := map[string][]byte{} - for _, item := range items { - if item.IsDir() { - continue - } - - filename := filepath.Join(root, item.Name()) - data, err := ioutil.ReadFile(filename) - if err != nil { - return nil, fmt.Errorf("failed to read test_data file %q, %v", filename, err) - } - - cases[item.Name()] = data - } - - return cases, nil -} - -func compareLines(t *testing.T, a, b []byte) bool { - as := bufio.NewScanner(bytes.NewBuffer(a)) - bs := bufio.NewScanner(bytes.NewBuffer(b)) - - var failed bool - for { - if ab, bb := as.Scan(), bs.Scan(); ab != bb { - t.Errorf("expect a & b to have same number of lines") - return false - } else if !ab { - break - } - - if v1, v2 := as.Text(), bs.Text(); v1 != v2 { - t.Errorf("expect %q to be %q", v1, v2) - failed = true - } - } - - return !failed -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix_test.go deleted file mode 100644 index ff70e7c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix_test.go +++ /dev/null @@ -1,110 +0,0 @@ -// +build go1.7 - -package protocol - -import ( - "net/http" - "net/url" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestHostPrefixBuilder(t *testing.T) { - cases := map[string]struct { - URLHost string - ReqHost string - Prefix string - LabelsFn func() map[string]string - Disabled bool - - ExpectURLHost string - ExpectReqHost string - }{ - "no labels": { - URLHost: "service.region.amazonaws.com", - Prefix: "data-", - ExpectURLHost: "data-service.region.amazonaws.com", - }, - "with labels": { - URLHost: "service.region.amazonaws.com", - Prefix: "{first}-{second}.", - LabelsFn: func() map[string]string { - return map[string]string{ - "first": "abc", - "second": "123", - } - }, - ExpectURLHost: "abc-123.service.region.amazonaws.com", - }, - "with host prefix disabled": { - Disabled: true, - URLHost: "service.region.amazonaws.com", - Prefix: "{first}-{second}.", - LabelsFn: func() map[string]string { - return map[string]string{ - "first": "abc", - "second": "123", - } - }, - ExpectURLHost: "service.region.amazonaws.com", - }, - "with duplicate labels": { - URLHost: "service.region.amazonaws.com", - Prefix: "{first}-{second}-{first}.", - LabelsFn: func() map[string]string { - return map[string]string{ - "first": "abc", - "second": "123", - } - }, - ExpectURLHost: "abc-123-abc.service.region.amazonaws.com", - }, - "with unbracketed labels": { - URLHost: "service.region.amazonaws.com", - Prefix: "first-{second}.", - LabelsFn: func() map[string]string { - return map[string]string{ - "first": "abc", - "second": "123", - } - }, - ExpectURLHost: "first-123.service.region.amazonaws.com", - }, - "with req host": { - URLHost: "service.region.amazonaws.com:1234", - ReqHost: "service.region.amazonaws.com", - Prefix: "data-", - ExpectURLHost: "data-service.region.amazonaws.com:1234", - ExpectReqHost: "data-service.region.amazonaws.com", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - builder := HostPrefixBuilder{ - Prefix: c.Prefix, LabelsFn: c.LabelsFn, - } - req := &request.Request{ - Config: aws.Config{ - DisableEndpointHostPrefix: aws.Bool(c.Disabled), - }, - HTTPRequest: &http.Request{ - Host: c.ReqHost, - URL: &url.URL{ - Host: c.URLHost, - }, - }, - } - - builder.Build(req) - if e, a := c.ExpectURLHost, req.HTTPRequest.URL.Host; e != a { - t.Errorf("expect URL host %v, got %v", e, a) - } - if e, a := c.ExpectReqHost, req.HTTPRequest.Host; e != a { - t.Errorf("expect request host %v, got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_test.go deleted file mode 100644 index 11ea9b4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build go1.7 - -package protocol - -import ( - "strconv" - "testing" -) - -func TestValidHostLabel(t *testing.T) { - cases := []struct { - Input string - Valid bool - }{ - {Input: "abc123", Valid: true}, - {Input: "123", Valid: true}, - {Input: "abc", Valid: true}, - {Input: "123-abc", Valid: true}, - {Input: "{thing}-abc", Valid: false}, - {Input: "abc.123", Valid: false}, - {Input: "abc/123", Valid: false}, - {Input: "012345678901234567890123456789012345678901234567890123456789123", Valid: true}, - {Input: "0123456789012345678901234567890123456789012345678901234567891234", Valid: false}, - {Input: "", Valid: false}, - } - - for i, c := range cases { - t.Run(strconv.Itoa(i), func(t *testing.T) { - valid := ValidHostLabel(c.Input) - if e, a := c.Valid, valid; e != a { - t.Errorf("expect valid %v, got %v", e, a) - } - }) - } -} - -func TestValidateEndpointHostHandler(t *testing.T) { - cases := map[string]struct { - Input string - Valid bool - }{ - "valid host": {Input: "abc.123", Valid: true}, - "fqdn host": {Input: "abc.123.", Valid: true}, - "empty label": {Input: "abc..", Valid: false}, - "max host len": { - Input: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345", - Valid: true, - }, - "too long host": { - Input: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456", - Valid: false, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - err := ValidateEndpointHost("OpName", c.Input) - if e, a := c.Valid, err == nil; e != a { - t.Errorf("expect valid %v, got %v, %v", e, a, err) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency_test.go deleted file mode 100644 index dd90c21..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package protocol_test - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/private/protocol" -) - -func TestCanSetIdempotencyToken(t *testing.T) { - cases := []struct { - CanSet bool - Case interface{} - }{ - { - true, - struct { - Field *string `idempotencyToken:"true"` - }{}, - }, - { - true, - struct { - Field string `idempotencyToken:"true"` - }{}, - }, - { - false, - struct { - Field *string `idempotencyToken:"true"` - }{Field: new(string)}, - }, - { - false, - struct { - Field string `idempotencyToken:"true"` - }{Field: "value"}, - }, - { - false, - struct { - Field *int `idempotencyToken:"true"` - }{}, - }, - { - false, - struct { - Field *string - }{}, - }, - } - - for i, c := range cases { - v := reflect.Indirect(reflect.ValueOf(c.Case)) - ty := v.Type() - canSet := protocol.CanSetIdempotencyToken(v.Field(0), ty.Field(0)) - if e, a := c.CanSet, canSet; e != a { - t.Errorf("%d, expect %v, got %v", i, e, a) - } - } -} - -func TestSetIdempotencyToken(t *testing.T) { - cases := []struct { - Case interface{} - }{ - { - &struct { - Field *string `idempotencyToken:"true"` - }{}, - }, - { - &struct { - Field string `idempotencyToken:"true"` - }{}, - }, - { - &struct { - Field *string `idempotencyToken:"true"` - }{Field: new(string)}, - }, - { - &struct { - Field string `idempotencyToken:"true"` - }{Field: ""}, - }, - } - - for i, c := range cases { - v := reflect.Indirect(reflect.ValueOf(c.Case)) - - protocol.SetIdempotencyToken(v.Field(0)) - if v.Field(0).Interface() == nil { - t.Errorf("%d, expect not nil", i) - } - } -} - -func TestUUIDVersion4(t *testing.T) { - uuid := protocol.UUIDVersion4(make([]byte, 16)) - if e, a := `00000000-0000-4000-8000-000000000000`, uuid; e != a { - t.Errorf("expect %v, got %v", e, a) - } - - b := make([]byte, 16) - for i := 0; i < len(b); i++ { - b[i] = 1 - } - uuid = protocol.UUIDVersion4(b) - if e, a := `01010101-0101-4101-8101-010101010101`, uuid; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build_test.go deleted file mode 100644 index 66392b6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package jsonutil_test - -import ( - "encoding/json" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" -) - -func S(s string) *string { - return &s -} - -func D(s int64) *int64 { - return &s -} - -func F(s float64) *float64 { - return &s -} - -func T(s time.Time) *time.Time { - return &s -} - -type J struct { - S *string - SS []string - D *int64 - F *float64 - T *time.Time -} - -var zero = 0.0 - -var jsonTests = []struct { - in interface{} - out string - err string -}{ - { - J{}, - `{}`, - ``, - }, - { - J{ - S: S("str"), - SS: []string{"A", "B", "C"}, - D: D(123), - F: F(4.56), - T: T(time.Unix(987, 0)), - }, - `{"S":"str","SS":["A","B","C"],"D":123,"F":4.56,"T":987}`, - ``, - }, - { - J{ - S: S(`"''"`), - }, - `{"S":"\"''\""}`, - ``, - }, - { - J{ - S: S("\x00føø\u00FF\n\\\"\r\t\b\f"), - }, - `{"S":"\u0000føøÿ\n\\\"\r\t\b\f"}`, - ``, - }, - { - J{ - F: F(4.56 / zero), - }, - "", - `json: unsupported value: +Inf`, - }, -} - -func TestBuildJSON(t *testing.T) { - for _, test := range jsonTests { - out, err := jsonutil.BuildJSON(test.in) - if test.err != "" { - if err == nil { - t.Errorf("expect error") - } - if e, a := test.err, err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v, to contain %v", e, a) - } - } else { - if err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := string(out), test.out; e != a { - t.Errorf("expect %v, got %v", e, a) - } - } - } -} - -func BenchmarkBuildJSON(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, test := range jsonTests { - jsonutil.BuildJSON(test.in) - } - } -} - -func BenchmarkStdlibJSON(b *testing.B) { - for i := 0; i < b.N; i++ { - for _, test := range jsonTests { - json.Marshal(test.in) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue_test.go deleted file mode 100644 index 66a3c8c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue_test.go +++ /dev/null @@ -1,93 +0,0 @@ -package protocol - -import ( - "fmt" - "reflect" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -var testJSONValueCases = []struct { - Value aws.JSONValue - Mode EscapeMode - String string -}{ - { - Value: aws.JSONValue{ - "abc": 123., - }, - Mode: NoEscape, - String: `{"abc":123}`, - }, - { - Value: aws.JSONValue{ - "abc": 123., - }, - Mode: Base64Escape, - String: `eyJhYmMiOjEyM30=`, - }, - { - Value: aws.JSONValue{ - "abc": 123., - }, - Mode: QuotedEscape, - String: `"{\"abc\":123}"`, - }, -} - -func TestEncodeJSONValue(t *testing.T) { - for i, c := range testJSONValueCases { - str, err := EncodeJSONValue(c.Value, c.Mode) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - if e, a := c.String, str; e != a { - t.Errorf("%d, expect %v encoded value, got %v", i, e, a) - } - } -} - -func TestDecodeJSONValue(t *testing.T) { - for i, c := range testJSONValueCases { - val, err := DecodeJSONValue(c.String, c.Mode) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - if e, a := c.Value, val; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %v encoded value, got %v", i, e, a) - } - } -} - -func TestEncodeJSONValue_PanicUnkownMode(t *testing.T) { - defer func() { - if r := recover(); r == nil { - t.Errorf("expect panic, got none") - } else { - reason := fmt.Sprintf("%v", r) - if e, a := "unknown EscapeMode", reason; !strings.Contains(a, e) { - t.Errorf("expect %q to be in %v", e, a) - } - } - }() - - val := aws.JSONValue{} - - EncodeJSONValue(val, 123456) -} -func TestDecodeJSONValue_PanicUnkownMode(t *testing.T) { - defer func() { - if r := recover(); r == nil { - t.Errorf("expect panic, got none") - } else { - reason := fmt.Sprintf("%v", r) - if e, a := "unknown EscapeMode", reason; !strings.Contains(a, e) { - t.Errorf("expect %q to be in %v", e, a) - } - } - }() - - DecodeJSONValue(`{"abc":123}`, 123456) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol_test.go deleted file mode 100644 index 5e16643..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol_test.go +++ /dev/null @@ -1,209 +0,0 @@ -package protocol_test - -import ( - "net/http" - "net/url" - "testing" - - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/ec2query" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/protocol/rest" - "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -func xmlData(set bool, b []byte, size, delta int) { - const openingTags = "" - const closingTags = "" - if !set { - copy(b, []byte(openingTags)) - } - if size == 0 { - copy(b[delta-len(closingTags):], []byte(closingTags)) - } -} - -func jsonData(set bool, b []byte, size, delta int) { - if !set { - copy(b, []byte("{\"A\": \"")) - } - if size == 0 { - copy(b[delta-len("\"}"):], []byte("\"}")) - } -} - -func buildNewRequest(data interface{}) *request.Request { - v := url.Values{} - v.Set("test", "TEST") - v.Add("test1", "TEST1") - - req := &request.Request{ - HTTPRequest: &http.Request{ - Header: make(http.Header), - Body: &awstesting.ReadCloser{Size: 2048}, - URL: &url.URL{ - RawQuery: v.Encode(), - }, - }, - Params: &struct { - LocationName string `locationName:"test"` - }{ - "Test", - }, - ClientInfo: metadata.ClientInfo{ - ServiceName: "test", - TargetPrefix: "test", - JSONVersion: "test", - APIVersion: "test", - Endpoint: "test", - SigningName: "test", - SigningRegion: "test", - }, - Operation: &request.Operation{ - Name: "test", - }, - } - req.HTTPResponse = &http.Response{ - Body: &awstesting.ReadCloser{Size: 2048}, - Header: http.Header{ - "X-Amzn-Requestid": []string{"1"}, - }, - StatusCode: http.StatusOK, - } - - if data == nil { - data = &struct { - _ struct{} `type:"structure"` - LocationName *string `locationName:"testName"` - Location *string `location:"statusCode"` - A *string `type:"string"` - }{} - } - - req.Data = data - - return req -} - -type expected struct { - dataType int - closed bool - size int - errExists bool -} - -const ( - jsonType = iota - xmlType -) - -func checkForLeak(data interface{}, build, fn func(*request.Request), t *testing.T, result expected) { - req := buildNewRequest(data) - reader := req.HTTPResponse.Body.(*awstesting.ReadCloser) - switch result.dataType { - case jsonType: - reader.FillData = jsonData - case xmlType: - reader.FillData = xmlData - } - build(req) - fn(req) - - if result.errExists { - if err := req.Error; err == nil { - t.Errorf("expect error") - } - } else { - if err := req.Error; err != nil { - t.Errorf("expect nil, %v", err) - } - } - - if e, a := reader.Closed, result.closed; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := reader.Size, result.size; e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestJSONRpc(t *testing.T) { - checkForLeak(nil, jsonrpc.Build, jsonrpc.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(nil, jsonrpc.Build, jsonrpc.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - checkForLeak(nil, jsonrpc.Build, jsonrpc.UnmarshalError, t, expected{jsonType, true, 0, true}) -} - -func TestQuery(t *testing.T) { - checkForLeak(nil, query.Build, query.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(nil, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - checkForLeak(nil, query.Build, query.UnmarshalError, t, expected{jsonType, true, 0, true}) -} - -func TestRest(t *testing.T) { - // case 1: Payload io.ReadSeeker - checkForLeak(nil, rest.Build, rest.Unmarshal, t, expected{jsonType, false, 2048, false}) - checkForLeak(nil, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - - // case 2: Payload *string - // should close the body - dataStr := struct { - _ struct{} `type:"structure" payload:"Payload"` - LocationName *string `locationName:"testName"` - Location *string `location:"statusCode"` - A *string `type:"string"` - Payload *string `locationName:"payload" type:"blob" required:"true"` - }{} - checkForLeak(&dataStr, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(&dataStr, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - - // case 3: Payload []byte - // should close the body - dataBytes := struct { - _ struct{} `type:"structure" payload:"Payload"` - LocationName *string `locationName:"testName"` - Location *string `location:"statusCode"` - A *string `type:"string"` - Payload []byte `locationName:"payload" type:"blob" required:"true"` - }{} - checkForLeak(&dataBytes, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(&dataBytes, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - - // case 4: Payload unsupported type - // should close the body - dataUnsupported := struct { - _ struct{} `type:"structure" payload:"Payload"` - LocationName *string `locationName:"testName"` - Location *string `location:"statusCode"` - A *string `type:"string"` - Payload string `locationName:"payload" type:"blob" required:"true"` - }{} - checkForLeak(&dataUnsupported, rest.Build, rest.Unmarshal, t, expected{jsonType, true, 0, true}) - checkForLeak(&dataUnsupported, query.Build, query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) -} - -func TestRestJSON(t *testing.T) { - checkForLeak(nil, restjson.Build, restjson.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(nil, restjson.Build, restjson.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - checkForLeak(nil, restjson.Build, restjson.UnmarshalError, t, expected{jsonType, true, 0, true}) -} - -func TestRestXML(t *testing.T) { - checkForLeak(nil, restxml.Build, restxml.Unmarshal, t, expected{xmlType, true, 0, false}) - checkForLeak(nil, restxml.Build, restxml.UnmarshalMeta, t, expected{xmlType, false, 2048, false}) - checkForLeak(nil, restxml.Build, restxml.UnmarshalError, t, expected{xmlType, true, 0, true}) -} - -func TestXML(t *testing.T) { - checkForLeak(nil, ec2query.Build, ec2query.Unmarshal, t, expected{jsonType, true, 0, false}) - checkForLeak(nil, ec2query.Build, ec2query.UnmarshalMeta, t, expected{jsonType, false, 2048, false}) - checkForLeak(nil, ec2query.Build, ec2query.UnmarshalError, t, expected{jsonType, true, 0, true}) -} - -func TestProtocol(t *testing.T) { - checkForLeak(nil, restxml.Build, protocol.UnmarshalDiscardBody, t, expected{xmlType, true, 0, false}) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go deleted file mode 100644 index fc104c9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go +++ /dev/null @@ -1,4635 +0,0 @@ -// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. - -package query_test - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" -) - -var _ bytes.Buffer // always import bytes -var _ http.Request -var _ json.Marshaler -var _ time.Time -var _ xmlutil.XMLNode -var _ xml.Attr -var _ = ioutil.Discard -var _ = util.Trim("") -var _ = url.Values{} -var _ = io.EOF -var _ = aws.String -var _ = fmt.Println -var _ = reflect.Value{} - -func init() { - protocol.RandReader = &awstesting.ZeroReader{} -} - -// InputService1ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService1ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService1ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService1ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService1ProtocolTest client from just a session. -// svc := inputservice1protocoltest.New(mySession) -// -// // Create a InputService1ProtocolTest client with additional configuration -// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest { - c := p.ClientConfig("inputservice1protocoltest", cfgs...) - return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService1ProtocolTest", - ServiceID: "InputService1ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService1ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService1TestCaseOperation1 = "OperationName" - -// InputService1TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation1 for more information on using the InputService1TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation1Request method. -// req, resp := client.InputService1TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation1Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation1 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { - req, out := c.InputService1TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation1WithContext is the same as InputService1TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation1Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { - req, out := c.InputService1TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService1TestCaseOperation2 = "OperationName" - -// InputService1TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation2 for more information on using the InputService1TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation2Request method. -// req, resp := client.InputService1TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input *InputService1TestShapeInputService1TestCaseOperation2Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation2Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation2 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2(input *InputService1TestShapeInputService1TestCaseOperation2Input) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) { - req, out := c.InputService1TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation2WithContext is the same as InputService1TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation2Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) { - req, out := c.InputService1TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService1TestCaseOperation3 = "OperationName" - -// InputService1TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation3 for more information on using the InputService1TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation3Request method. -// req, resp := client.InputService1TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input *InputService1TestShapeInputService1TestCaseOperation3Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation3, - HTTPPath: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation3Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation3 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3(input *InputService1TestShapeInputService1TestCaseOperation3Input) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) { - req, out := c.InputService1TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation3WithContext is the same as InputService1TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation3Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) { - req, out := c.InputService1TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService1TestShapeInputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Baz *bool `type:"boolean"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetBar(v string) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Bar = &v - return s -} - -// SetBaz sets the Baz field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetBaz(v bool) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Baz = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetFoo(v string) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService1TestShapeInputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Baz *bool `type:"boolean"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation2Input) SetBar(v string) *InputService1TestShapeInputService1TestCaseOperation2Input { - s.Bar = &v - return s -} - -// SetBaz sets the Baz field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation2Input) SetBaz(v bool) *InputService1TestShapeInputService1TestCaseOperation2Input { - s.Baz = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation2Input) SetFoo(v string) *InputService1TestShapeInputService1TestCaseOperation2Input { - s.Foo = &v - return s -} - -type InputService1TestShapeInputService1TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation3Input struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Baz *bool `type:"boolean"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation3Input) SetBar(v string) *InputService1TestShapeInputService1TestCaseOperation3Input { - s.Bar = &v - return s -} - -// SetBaz sets the Baz field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation3Input) SetBaz(v bool) *InputService1TestShapeInputService1TestCaseOperation3Input { - s.Baz = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation3Input) SetFoo(v string) *InputService1TestShapeInputService1TestCaseOperation3Input { - s.Foo = &v - return s -} - -type InputService1TestShapeInputService1TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -// InputService2ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService2ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService2ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService2ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService2ProtocolTest client from just a session. -// svc := inputservice2protocoltest.New(mySession) -// -// // Create a InputService2ProtocolTest client with additional configuration -// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest { - c := p.ClientConfig("inputservice2protocoltest", cfgs...) - return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService2ProtocolTest", - ServiceID: "InputService2ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService2ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService2TestCaseOperation1 = "OperationName" - -// InputService2TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService2TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService2TestCaseOperation1 for more information on using the InputService2TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService2TestCaseOperation1Request method. -// req, resp := client.InputService2TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService2TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService2TestShapeInputService2TestCaseOperation1Input{} - } - - output = &InputService2TestShapeInputService2TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService2TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService2TestCaseOperation1 for usage and error information. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { - req, out := c.InputService2TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService2TestCaseOperation1WithContext is the same as InputService2TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService2TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1WithContext(ctx aws.Context, input *InputService2TestShapeInputService2TestCaseOperation1Input, opts ...request.Option) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { - req, out := c.InputService2TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService2TestShapeInputService2TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - StructArg *InputService2TestShapeStructType `type:"structure"` -} - -// SetStructArg sets the StructArg field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetStructArg(v *InputService2TestShapeStructType) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.StructArg = v - return s -} - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService2TestShapeStructType struct { - _ struct{} `type:"structure"` - - ScalarArg *string `type:"string"` -} - -// SetScalarArg sets the ScalarArg field's value. -func (s *InputService2TestShapeStructType) SetScalarArg(v string) *InputService2TestShapeStructType { - s.ScalarArg = &v - return s -} - -// InputService3ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService3ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService3ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService3ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService3ProtocolTest client from just a session. -// svc := inputservice3protocoltest.New(mySession) -// -// // Create a InputService3ProtocolTest client with additional configuration -// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest { - c := p.ClientConfig("inputservice3protocoltest", cfgs...) - return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService3ProtocolTest", - ServiceID: "InputService3ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService3ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService3TestCaseOperation1 = "OperationName" - -// InputService3TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService3TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService3TestCaseOperation1 for more information on using the InputService3TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService3TestCaseOperation1Request method. -// req, resp := client.InputService3TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation1Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService3TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService3TestCaseOperation1 for usage and error information. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { - req, out := c.InputService3TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService3TestCaseOperation1WithContext is the same as InputService3TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService3TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1WithContext(ctx aws.Context, input *InputService3TestShapeInputService3TestCaseOperation1Input, opts ...request.Option) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { - req, out := c.InputService3TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService3TestCaseOperation2 = "OperationName" - -// InputService3TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService3TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService3TestCaseOperation2 for more information on using the InputService3TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService3TestCaseOperation2Request method. -// req, resp := client.InputService3TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputService3TestCaseOperation2Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation2Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService3TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService3TestCaseOperation2 for usage and error information. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputService3TestCaseOperation2Input) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { - req, out := c.InputService3TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService3TestCaseOperation2WithContext is the same as InputService3TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService3TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2WithContext(ctx aws.Context, input *InputService3TestShapeInputService3TestCaseOperation2Input, opts ...request.Option) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { - req, out := c.InputService3TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService3TestShapeInputService3TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `type:"list"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation1Input) SetListArg(v []*string) *InputService3TestShapeInputService3TestCaseOperation1Input { - s.ListArg = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService3TestShapeInputService3TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `type:"list"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation2Input) SetListArg(v []*string) *InputService3TestShapeInputService3TestCaseOperation2Input { - s.ListArg = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService4ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService4ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService4ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService4ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService4ProtocolTest client from just a session. -// svc := inputservice4protocoltest.New(mySession) -// -// // Create a InputService4ProtocolTest client with additional configuration -// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest { - c := p.ClientConfig("inputservice4protocoltest", cfgs...) - return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService4ProtocolTest", - ServiceID: "InputService4ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService4ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService4TestCaseOperation1 = "OperationName" - -// InputService4TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService4TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService4TestCaseOperation1 for more information on using the InputService4TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService4TestCaseOperation1Request method. -// req, resp := client.InputService4TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService4TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation1Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService4TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService4TestCaseOperation1 for usage and error information. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { - req, out := c.InputService4TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService4TestCaseOperation1WithContext is the same as InputService4TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService4TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1WithContext(ctx aws.Context, input *InputService4TestShapeInputService4TestCaseOperation1Input, opts ...request.Option) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { - req, out := c.InputService4TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService4TestCaseOperation2 = "OperationName" - -// InputService4TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService4TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService4TestCaseOperation2 for more information on using the InputService4TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService4TestCaseOperation2Request method. -// req, resp := client.InputService4TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input *InputService4TestShapeInputService4TestCaseOperation2Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService4TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation2Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService4TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService4TestCaseOperation2 for usage and error information. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputService4TestCaseOperation2Input) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) { - req, out := c.InputService4TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService4TestCaseOperation2WithContext is the same as InputService4TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService4TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2WithContext(ctx aws.Context, input *InputService4TestShapeInputService4TestCaseOperation2Input, opts ...request.Option) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) { - req, out := c.InputService4TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService4TestShapeInputService4TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `type:"list" flattened:"true"` - - NamedListArg []*string `locationNameList:"Foo" type:"list" flattened:"true"` - - ScalarArg *string `type:"string"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.ListArg = v - return s -} - -// SetNamedListArg sets the NamedListArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetNamedListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.NamedListArg = v - return s -} - -// SetScalarArg sets the ScalarArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetScalarArg(v string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.ScalarArg = &v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService4TestShapeInputService4TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `type:"list" flattened:"true"` - - NamedListArg []*string `locationNameList:"Foo" type:"list" flattened:"true"` - - ScalarArg *string `type:"string"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation2Input) SetListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation2Input { - s.ListArg = v - return s -} - -// SetNamedListArg sets the NamedListArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation2Input) SetNamedListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation2Input { - s.NamedListArg = v - return s -} - -// SetScalarArg sets the ScalarArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation2Input) SetScalarArg(v string) *InputService4TestShapeInputService4TestCaseOperation2Input { - s.ScalarArg = &v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService5ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService5ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService5ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService5ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService5ProtocolTest client from just a session. -// svc := inputservice5protocoltest.New(mySession) -// -// // Create a InputService5ProtocolTest client with additional configuration -// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest { - c := p.ClientConfig("inputservice5protocoltest", cfgs...) - return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService5ProtocolTest", - ServiceID: "InputService5ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService5ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService5TestCaseOperation1 = "OperationName" - -// InputService5TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService5TestCaseOperation1 for more information on using the InputService5TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService5TestCaseOperation1Request method. -// req, resp := client.InputService5TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation1Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService5TestCaseOperation1 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { - req, out := c.InputService5TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation1WithContext is the same as InputService5TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation1Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { - req, out := c.InputService5TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService5TestShapeInputService5TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - MapArg map[string]*string `type:"map" flattened:"true"` -} - -// SetMapArg sets the MapArg field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation1Input) SetMapArg(v map[string]*string) *InputService5TestShapeInputService5TestCaseOperation1Input { - s.MapArg = v - return s -} - -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService6ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService6ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService6ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService6ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService6ProtocolTest client from just a session. -// svc := inputservice6protocoltest.New(mySession) -// -// // Create a InputService6ProtocolTest client with additional configuration -// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest { - c := p.ClientConfig("inputservice6protocoltest", cfgs...) - return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService6ProtocolTest", - ServiceID: "InputService6ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService6ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService6TestCaseOperation1 = "OperationName" - -// InputService6TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService6TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService6TestCaseOperation1 for more information on using the InputService6TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService6TestCaseOperation1Request method. -// req, resp := client.InputService6TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService6TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService6TestShapeInputService6TestCaseOperation1Input{} - } - - output = &InputService6TestShapeInputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService6TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService6TestCaseOperation1 for usage and error information. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { - req, out := c.InputService6TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService6TestCaseOperation1WithContext is the same as InputService6TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService6TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1WithContext(ctx aws.Context, input *InputService6TestShapeInputService6TestCaseOperation1Input, opts ...request.Option) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { - req, out := c.InputService6TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService6TestShapeInputService6TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `locationNameList:"item" type:"list"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService6TestShapeInputService6TestCaseOperation1Input) SetListArg(v []*string) *InputService6TestShapeInputService6TestCaseOperation1Input { - s.ListArg = v - return s -} - -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService7ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService7ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService7ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService7ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService7ProtocolTest client from just a session. -// svc := inputservice7protocoltest.New(mySession) -// -// // Create a InputService7ProtocolTest client with additional configuration -// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest { - c := p.ClientConfig("inputservice7protocoltest", cfgs...) - return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService7ProtocolTest", - ServiceID: "InputService7ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService7ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService7TestCaseOperation1 = "OperationName" - -// InputService7TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService7TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService7TestCaseOperation1 for more information on using the InputService7TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService7TestCaseOperation1Request method. -// req, resp := client.InputService7TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation1Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService7TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService7TestCaseOperation1 for usage and error information. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService7TestCaseOperation1WithContext is the same as InputService7TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService7TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1WithContext(ctx aws.Context, input *InputService7TestShapeInputService7TestCaseOperation1Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService7TestShapeInputService7TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - ListArg []*string `locationNameList:"ListArgLocation" type:"list" flattened:"true"` - - ScalarArg *string `type:"string"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation1Input) SetListArg(v []*string) *InputService7TestShapeInputService7TestCaseOperation1Input { - s.ListArg = v - return s -} - -// SetScalarArg sets the ScalarArg field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation1Input) SetScalarArg(v string) *InputService7TestShapeInputService7TestCaseOperation1Input { - s.ScalarArg = &v - return s -} - -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService8ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService8ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService8ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService8ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService8ProtocolTest client from just a session. -// svc := inputservice8protocoltest.New(mySession) -// -// // Create a InputService8ProtocolTest client with additional configuration -// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest { - c := p.ClientConfig("inputservice8protocoltest", cfgs...) - return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService8ProtocolTest", - ServiceID: "InputService8ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService8ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService8TestCaseOperation1 = "OperationName" - -// InputService8TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService8TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService8TestCaseOperation1 for more information on using the InputService8TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService8TestCaseOperation1Request method. -// req, resp := client.InputService8TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService8TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService8TestShapeInputService8TestCaseOperation1Input{} - } - - output = &InputService8TestShapeInputService8TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService8TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService8TestCaseOperation1 for usage and error information. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { - req, out := c.InputService8TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService8TestCaseOperation1WithContext is the same as InputService8TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService8TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1WithContext(ctx aws.Context, input *InputService8TestShapeInputService8TestCaseOperation1Input, opts ...request.Option) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { - req, out := c.InputService8TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService8TestShapeInputService8TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - MapArg map[string]*string `type:"map"` -} - -// SetMapArg sets the MapArg field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetMapArg(v map[string]*string) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.MapArg = v - return s -} - -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService9ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService9ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService9ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService9ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService9ProtocolTest client from just a session. -// svc := inputservice9protocoltest.New(mySession) -// -// // Create a InputService9ProtocolTest client with additional configuration -// svc := inputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService9ProtocolTest { - c := p.ClientConfig("inputservice9protocoltest", cfgs...) - return newInputService9ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService9ProtocolTest", - ServiceID: "InputService9ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService9ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService9TestCaseOperation1 = "OperationName" - -// InputService9TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService9TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService9TestCaseOperation1 for more information on using the InputService9TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService9TestCaseOperation1Request method. -// req, resp := client.InputService9TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputService9TestCaseOperation1Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService9TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService9TestShapeInputService9TestCaseOperation1Input{} - } - - output = &InputService9TestShapeInputService9TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService9TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService9TestCaseOperation1 for usage and error information. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputService9TestCaseOperation1Input) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { - req, out := c.InputService9TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService9TestCaseOperation1WithContext is the same as InputService9TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService9TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1WithContext(ctx aws.Context, input *InputService9TestShapeInputService9TestCaseOperation1Input, opts ...request.Option) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { - req, out := c.InputService9TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService9TestShapeInputService9TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"` -} - -// SetMapArg sets the MapArg field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetMapArg(v map[string]*string) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.MapArg = v - return s -} - -type InputService9TestShapeInputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService10ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService10ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService10ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService10ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService10ProtocolTest client from just a session. -// svc := inputservice10protocoltest.New(mySession) -// -// // Create a InputService10ProtocolTest client with additional configuration -// svc := inputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService10ProtocolTest { - c := p.ClientConfig("inputservice10protocoltest", cfgs...) - return newInputService10ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService10ProtocolTest { - svc := &InputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService10ProtocolTest", - ServiceID: "InputService10ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService10ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService10TestCaseOperation1 = "OperationName" - -// InputService10TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService10TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService10TestCaseOperation1 for more information on using the InputService10TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService10TestCaseOperation1Request method. -// req, resp := client.InputService10TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation1Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService10TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService10TestShapeInputService10TestCaseOperation1Input{} - } - - output = &InputService10TestShapeInputService10TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService10TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService10TestCaseOperation1 for usage and error information. -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation1Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) { - req, out := c.InputService10TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService10TestCaseOperation1WithContext is the same as InputService10TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService10TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1WithContext(ctx aws.Context, input *InputService10TestShapeInputService10TestCaseOperation1Input, opts ...request.Option) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) { - req, out := c.InputService10TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService10TestShapeInputService10TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - // BlobArg is automatically base64 encoded/decoded by the SDK. - BlobArg []byte `type:"blob"` -} - -// SetBlobArg sets the BlobArg field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetBlobArg(v []byte) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.BlobArg = v - return s -} - -type InputService10TestShapeInputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService11ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService11ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService11ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService11ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService11ProtocolTest client from just a session. -// svc := inputservice11protocoltest.New(mySession) -// -// // Create a InputService11ProtocolTest client with additional configuration -// svc := inputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService11ProtocolTest { - c := p.ClientConfig("inputservice11protocoltest", cfgs...) - return newInputService11ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService11ProtocolTest { - svc := &InputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService11ProtocolTest", - ServiceID: "InputService11ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService11ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService11TestCaseOperation1 = "OperationName" - -// InputService11TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService11TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService11TestCaseOperation1 for more information on using the InputService11TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService11TestCaseOperation1Request method. -// req, resp := client.InputService11TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(input *InputService11TestShapeInputService11TestCaseOperation1Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService11TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService11TestShapeInputService11TestCaseOperation1Input{} - } - - output = &InputService11TestShapeInputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService11TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService11TestCaseOperation1 for usage and error information. -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1(input *InputService11TestShapeInputService11TestCaseOperation1Input) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) { - req, out := c.InputService11TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService11TestCaseOperation1WithContext is the same as InputService11TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService11TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1WithContext(ctx aws.Context, input *InputService11TestShapeInputService11TestCaseOperation1Input, opts ...request.Option) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) { - req, out := c.InputService11TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService11TestShapeInputService11TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - BlobArgs [][]byte `type:"list" flattened:"true"` -} - -// SetBlobArgs sets the BlobArgs field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetBlobArgs(v [][]byte) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.BlobArgs = v - return s -} - -type InputService11TestShapeInputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService12ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService12ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService12ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService12ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService12ProtocolTest client from just a session. -// svc := inputservice12protocoltest.New(mySession) -// -// // Create a InputService12ProtocolTest client with additional configuration -// svc := inputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService12ProtocolTest { - c := p.ClientConfig("inputservice12protocoltest", cfgs...) - return newInputService12ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService12ProtocolTest { - svc := &InputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService12ProtocolTest", - ServiceID: "InputService12ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService12ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService12TestCaseOperation1 = "OperationName" - -// InputService12TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService12TestCaseOperation1 for more information on using the InputService12TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService12TestCaseOperation1Request method. -// req, resp := client.InputService12TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(input *InputService12TestShapeInputService12TestCaseOperation1Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation1Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService12TestCaseOperation1 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1(input *InputService12TestShapeInputService12TestCaseOperation1Input) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { - req, out := c.InputService12TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation1WithContext is the same as InputService12TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation1Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { - req, out := c.InputService12TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService12TestShapeInputService12TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - TimeArg *time.Time `type:"timestamp"` - - TimeCustom *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeFormat *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -// SetTimeCustom sets the TimeCustom field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetTimeCustom(v time.Time) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.TimeCustom = &v - return s -} - -// SetTimeFormat sets the TimeFormat field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetTimeFormat(v time.Time) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.TimeFormat = &v - return s -} - -type InputService12TestShapeInputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService13ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService13ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService13ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService13ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService13ProtocolTest client from just a session. -// svc := inputservice13protocoltest.New(mySession) -// -// // Create a InputService13ProtocolTest client with additional configuration -// svc := inputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService13ProtocolTest { - c := p.ClientConfig("inputservice13protocoltest", cfgs...) - return newInputService13ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService13ProtocolTest { - svc := &InputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService13ProtocolTest", - ServiceID: "InputService13ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService13ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService13TestCaseOperation1 = "OperationName" - -// InputService13TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation1 for more information on using the InputService13TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation1Request method. -// req, resp := client.InputService13TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1Request(input *InputService13TestShapeInputService13TestCaseOperation1Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation1Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation1 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1(input *InputService13TestShapeInputService13TestCaseOperation1Input) (*InputService13TestShapeInputService13TestCaseOperation1Output, error) { - req, out := c.InputService13TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation1WithContext is the same as InputService13TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation1Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation1Output, error) { - req, out := c.InputService13TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService13TestCaseOperation2 = "OperationName" - -// InputService13TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation2 for more information on using the InputService13TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation2Request method. -// req, resp := client.InputService13TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation2Request(input *InputService13TestShapeInputService13TestCaseOperation2Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation2Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation2 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation2(input *InputService13TestShapeInputService13TestCaseOperation2Input) (*InputService13TestShapeInputService13TestCaseOperation2Output, error) { - req, out := c.InputService13TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation2WithContext is the same as InputService13TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation2WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation2Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation2Output, error) { - req, out := c.InputService13TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService13TestCaseOperation3 = "OperationName" - -// InputService13TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation3 for more information on using the InputService13TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation3Request method. -// req, resp := client.InputService13TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation3Request(input *InputService13TestShapeInputService13TestCaseOperation3Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation3, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation3Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation3 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation3(input *InputService13TestShapeInputService13TestCaseOperation3Input) (*InputService13TestShapeInputService13TestCaseOperation3Output, error) { - req, out := c.InputService13TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation3WithContext is the same as InputService13TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation3WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation3Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation3Output, error) { - req, out := c.InputService13TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService13TestCaseOperation4 = "OperationName" - -// InputService13TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation4 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation4 for more information on using the InputService13TestCaseOperation4 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation4Request method. -// req, resp := client.InputService13TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation4Request(input *InputService13TestShapeInputService13TestCaseOperation4Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation4, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation4Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation4 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation4 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation4(input *InputService13TestShapeInputService13TestCaseOperation4Input) (*InputService13TestShapeInputService13TestCaseOperation4Output, error) { - req, out := c.InputService13TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation4WithContext is the same as InputService13TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation4 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation4WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation4Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation4Output, error) { - req, out := c.InputService13TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService13TestCaseOperation5 = "OperationName" - -// InputService13TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation5 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation5 for more information on using the InputService13TestCaseOperation5 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation5Request method. -// req, resp := client.InputService13TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation5Request(input *InputService13TestShapeInputService13TestCaseOperation5Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation5, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation5Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation5 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation5 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation5(input *InputService13TestShapeInputService13TestCaseOperation5Input) (*InputService13TestShapeInputService13TestCaseOperation5Output, error) { - req, out := c.InputService13TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation5WithContext is the same as InputService13TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation5 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation5WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation5Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation5Output, error) { - req, out := c.InputService13TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService13TestCaseOperation6 = "OperationName" - -// InputService13TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation6 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation6 for more information on using the InputService13TestCaseOperation6 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation6Request method. -// req, resp := client.InputService13TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation6Request(input *InputService13TestShapeInputService13TestCaseOperation6Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation6, - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation6Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation6 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation6 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation6(input *InputService13TestShapeInputService13TestCaseOperation6Input) (*InputService13TestShapeInputService13TestCaseOperation6Output, error) { - req, out := c.InputService13TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation6WithContext is the same as InputService13TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation6 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation6WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation6Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation6Output, error) { - req, out := c.InputService13TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService13TestShapeInputService13TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation1Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation1Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation2Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation2Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation3Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation3Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation3Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation4Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation4Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation4Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation5Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation5Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation5Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation6Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation6Input) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeInputService13TestCaseOperation6Input { - s.RecursiveStruct = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService13TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService13TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService13TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService13TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService13TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService13TestShapeRecursiveStructType) SetRecursiveList(v []*InputService13TestShapeRecursiveStructType) *InputService13TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService13TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService13TestShapeRecursiveStructType) *InputService13TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService13TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService13TestShapeRecursiveStructType) *InputService13TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// InputService14ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService14ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService14ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService14ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService14ProtocolTest client from just a session. -// svc := inputservice14protocoltest.New(mySession) -// -// // Create a InputService14ProtocolTest client with additional configuration -// svc := inputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService14ProtocolTest { - c := p.ClientConfig("inputservice14protocoltest", cfgs...) - return newInputService14ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService14ProtocolTest { - svc := &InputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService14ProtocolTest", - ServiceID: "InputService14ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService14ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService14TestCaseOperation1 = "OperationName" - -// InputService14TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService14TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService14TestCaseOperation1 for more information on using the InputService14TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService14TestCaseOperation1Request method. -// req, resp := client.InputService14TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1Request(input *InputService14TestShapeInputService14TestCaseOperation1Input) (req *request.Request, output *InputService14TestShapeInputService14TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService14TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService14TestShapeInputService14TestCaseOperation1Input{} - } - - output = &InputService14TestShapeInputService14TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService14TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService14TestCaseOperation1 for usage and error information. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1(input *InputService14TestShapeInputService14TestCaseOperation1Input) (*InputService14TestShapeInputService14TestCaseOperation1Output, error) { - req, out := c.InputService14TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService14TestCaseOperation1WithContext is the same as InputService14TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService14TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1WithContext(ctx aws.Context, input *InputService14TestShapeInputService14TestCaseOperation1Input, opts ...request.Option) (*InputService14TestShapeInputService14TestCaseOperation1Output, error) { - req, out := c.InputService14TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService14TestCaseOperation2 = "OperationName" - -// InputService14TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService14TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService14TestCaseOperation2 for more information on using the InputService14TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService14TestCaseOperation2Request method. -// req, resp := client.InputService14TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService14ProtocolTest) InputService14TestCaseOperation2Request(input *InputService14TestShapeInputService14TestCaseOperation2Input) (req *request.Request, output *InputService14TestShapeInputService14TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService14TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService14TestShapeInputService14TestCaseOperation2Input{} - } - - output = &InputService14TestShapeInputService14TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService14TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService14TestCaseOperation2 for usage and error information. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation2(input *InputService14TestShapeInputService14TestCaseOperation2Input) (*InputService14TestShapeInputService14TestCaseOperation2Output, error) { - req, out := c.InputService14TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService14TestCaseOperation2WithContext is the same as InputService14TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService14TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation2WithContext(ctx aws.Context, input *InputService14TestShapeInputService14TestCaseOperation2Input, opts ...request.Option) (*InputService14TestShapeInputService14TestCaseOperation2Output, error) { - req, out := c.InputService14TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService14TestShapeInputService14TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService14TestShapeInputService14TestCaseOperation1Input) SetToken(v string) *InputService14TestShapeInputService14TestCaseOperation1Input { - s.Token = &v - return s -} - -type InputService14TestShapeInputService14TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService14TestShapeInputService14TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService14TestShapeInputService14TestCaseOperation2Input) SetToken(v string) *InputService14TestShapeInputService14TestCaseOperation2Input { - s.Token = &v - return s -} - -type InputService14TestShapeInputService14TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService15ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService15ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService15ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService15ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService15ProtocolTest client from just a session. -// svc := inputservice15protocoltest.New(mySession) -// -// // Create a InputService15ProtocolTest client with additional configuration -// svc := inputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService15ProtocolTest { - c := p.ClientConfig("inputservice15protocoltest", cfgs...) - return newInputService15ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService15ProtocolTest { - svc := &InputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService15ProtocolTest", - ServiceID: "InputService15ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService15ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService15TestCaseOperation1 = "OperationName" - -// InputService15TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService15TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService15TestCaseOperation1 for more information on using the InputService15TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService15TestCaseOperation1Request method. -// req, resp := client.InputService15TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1Request(input *InputService15TestShapeInputService15TestCaseOperation1Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation1Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService15TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService15TestCaseOperation1 for usage and error information. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1(input *InputService15TestShapeInputService15TestCaseOperation1Input) (*InputService15TestShapeInputService15TestCaseOperation1Output, error) { - req, out := c.InputService15TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService15TestCaseOperation1WithContext is the same as InputService15TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService15TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1WithContext(ctx aws.Context, input *InputService15TestShapeInputService15TestCaseOperation1Input, opts ...request.Option) (*InputService15TestShapeInputService15TestCaseOperation1Output, error) { - req, out := c.InputService15TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService15TestCaseOperation2 = "OperationName" - -// InputService15TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService15TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService15TestCaseOperation2 for more information on using the InputService15TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService15TestCaseOperation2Request method. -// req, resp := client.InputService15TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService15ProtocolTest) InputService15TestCaseOperation2Request(input *InputService15TestShapeInputService15TestCaseOperation2Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation2Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService15TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService15TestCaseOperation2 for usage and error information. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation2(input *InputService15TestShapeInputService15TestCaseOperation2Input) (*InputService15TestShapeInputService15TestCaseOperation2Output, error) { - req, out := c.InputService15TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService15TestCaseOperation2WithContext is the same as InputService15TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService15TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation2WithContext(ctx aws.Context, input *InputService15TestShapeInputService15TestCaseOperation2Input, opts ...request.Option) (*InputService15TestShapeInputService15TestCaseOperation2Output, error) { - req, out := c.InputService15TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService15TestCaseOperation3 = "OperationName" - -// InputService15TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService15TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService15TestCaseOperation3 for more information on using the InputService15TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService15TestCaseOperation3Request method. -// req, resp := client.InputService15TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService15ProtocolTest) InputService15TestCaseOperation3Request(input *InputService15TestShapeInputService15TestCaseOperation3Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation3Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService15TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService15TestCaseOperation3 for usage and error information. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation3(input *InputService15TestShapeInputService15TestCaseOperation3Input) (*InputService15TestShapeInputService15TestCaseOperation3Output, error) { - req, out := c.InputService15TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService15TestCaseOperation3WithContext is the same as InputService15TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService15TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation3WithContext(ctx aws.Context, input *InputService15TestShapeInputService15TestCaseOperation3Input, opts ...request.Option) (*InputService15TestShapeInputService15TestCaseOperation3Output, error) { - req, out := c.InputService15TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService15TestShapeInputService15TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - FooEnum *string `type:"string" enum:"InputService15TestShapeEnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation1Input) SetFooEnum(v string) *InputService15TestShapeInputService15TestCaseOperation1Input { - s.FooEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation1Input) SetListEnums(v []*string) *InputService15TestShapeInputService15TestCaseOperation1Input { - s.ListEnums = v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService15TestShapeInputService15TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - FooEnum *string `type:"string" enum:"InputService15TestShapeEnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation2Input) SetFooEnum(v string) *InputService15TestShapeInputService15TestCaseOperation2Input { - s.FooEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation2Input) SetListEnums(v []*string) *InputService15TestShapeInputService15TestCaseOperation2Input { - s.ListEnums = v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService15TestShapeInputService15TestCaseOperation3Input struct { - _ struct{} `type:"structure"` - - FooEnum *string `type:"string" enum:"InputService15TestShapeEnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation3Input) SetFooEnum(v string) *InputService15TestShapeInputService15TestCaseOperation3Input { - s.FooEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation3Input) SetListEnums(v []*string) *InputService15TestShapeInputService15TestCaseOperation3Input { - s.ListEnums = v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -const ( - // EnumTypeFoo is a InputService15TestShapeEnumType enum value - EnumTypeFoo = "foo" - - // EnumTypeBar is a InputService15TestShapeEnumType enum value - EnumTypeBar = "bar" -) - -// InputService16ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService16ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService16ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService16ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService16ProtocolTest client from just a session. -// svc := inputservice16protocoltest.New(mySession) -// -// // Create a InputService16ProtocolTest client with additional configuration -// svc := inputservice16protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService16ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService16ProtocolTest { - c := p.ClientConfig("inputservice16protocoltest", cfgs...) - return newInputService16ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService16ProtocolTest { - svc := &InputService16ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService16ProtocolTest", - ServiceID: "InputService16ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService16ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService16ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService16TestCaseOperation1 = "StaticOp" - -// InputService16TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService16TestCaseOperation1 for more information on using the InputService16TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService16TestCaseOperation1Request method. -// req, resp := client.InputService16TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1Request(input *InputService16TestShapeInputService16TestCaseOperation1Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation1Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("data-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// InputService16TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService16TestCaseOperation1 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1(input *InputService16TestShapeInputService16TestCaseOperation1Input) (*InputService16TestShapeInputService16TestCaseOperation1Output, error) { - req, out := c.InputService16TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation1WithContext is the same as InputService16TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation1Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation1Output, error) { - req, out := c.InputService16TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService16TestCaseOperation2 = "MemberRefOp" - -// InputService16TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService16TestCaseOperation2 for more information on using the InputService16TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService16TestCaseOperation2Request method. -// req, resp := client.InputService16TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("foo-{Name}.", input.hostLabels)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// InputService16TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService16TestCaseOperation2 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation2Output, error) { - req, out := c.InputService16TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation2WithContext is the same as InputService16TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation2Output, error) { - req, out := c.InputService16TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService16TestShapeInputService16TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Name *string `type:"string"` -} - -// SetName sets the Name field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation1Input) SetName(v string) *InputService16TestShapeInputService16TestCaseOperation1Input { - s.Name = &v - return s -} - -type InputService16TestShapeInputService16TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService16TestShapeInputService16TestCaseOperation2Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService16TestShapeInputService16TestCaseOperation2Input"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation2Input) SetName(v string) *InputService16TestShapeInputService16TestCaseOperation2Input { - s.Name = &v - return s -} - -func (s *InputService16TestShapeInputService16TestCaseOperation2Input) hostLabels() map[string]string { - return map[string]string{ - "Name": aws.StringValue(s.Name), - } -} - -type InputService16TestShapeInputService16TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// -// Tests begin here -// - -func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation1Input{ - Bar: aws.String("val2"), - Foo: aws.String("val1"), - } - req, _ := svc.InputService1TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Bar=val2&Foo=val1&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService1ProtocolTestScalarMembersCase2(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation2Input{ - Baz: aws.Bool(true), - } - req, _ := svc.InputService1TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Baz=true&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService1ProtocolTestScalarMembersCase3(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation3Input{ - Baz: aws.Bool(false), - } - req, _ := svc.InputService1TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Baz=false&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) { - svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService2TestShapeInputService2TestCaseOperation1Input{ - StructArg: &InputService2TestShapeStructType{ - ScalarArg: aws.String("foo"), - }, - } - req, _ := svc.InputService2TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&StructArg.ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("foo"), - aws.String("bar"), - aws.String("baz"), - }, - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArg.member.1=foo&ListArg.member.2=bar&ListArg.member.3=baz&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestListTypesCase2(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation2Input{ - ListArg: []*string{}, - } - req, _ := svc.InputService3TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArg=&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("a"), - aws.String("b"), - aws.String("c"), - }, - ScalarArg: aws.String("foo"), - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArg.1=a&ListArg.2=b&ListArg.3=c&ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation2Input{ - NamedListArg: []*string{ - aws.String("a"), - }, - } - req, _ := svc.InputService4TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Foo.1=a&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService5ProtocolTestSerializeFlattenedMapTypeCase1(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation1Input{ - MapArg: map[string]*string{ - "key1": aws.String("val1"), - "key2": aws.String("val2"), - }, - } - req, _ := svc.InputService5TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&MapArg.1.key=key1&MapArg.1.value=val1&MapArg.2.key=key2&MapArg.2.value=val2&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService6ProtocolTestNonFlattenedListWithLocationNameCase1(t *testing.T) { - svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService6TestShapeInputService6TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("a"), - aws.String("b"), - aws.String("c"), - }, - } - req, _ := svc.InputService6TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArg.item.1=a&ListArg.item.2=b&ListArg.item.3=c&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService7ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("a"), - aws.String("b"), - aws.String("c"), - }, - ScalarArg: aws.String("foo"), - } - req, _ := svc.InputService7TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArgLocation.1=a&ListArgLocation.2=b&ListArgLocation.3=c&ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService8ProtocolTestSerializeMapTypeCase1(t *testing.T) { - svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService8TestShapeInputService8TestCaseOperation1Input{ - MapArg: map[string]*string{ - "key1": aws.String("val1"), - "key2": aws.String("val2"), - }, - } - req, _ := svc.InputService8TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&MapArg.entry.1.key=key1&MapArg.entry.1.value=val1&MapArg.entry.2.key=key2&MapArg.entry.2.value=val2&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService9ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) { - svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService9TestShapeInputService9TestCaseOperation1Input{ - MapArg: map[string]*string{ - "key1": aws.String("val1"), - "key2": aws.String("val2"), - }, - } - req, _ := svc.InputService9TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&MapArg.entry.1.TheKey=key1&MapArg.entry.1.TheValue=val1&MapArg.entry.2.TheKey=key2&MapArg.entry.2.TheValue=val2&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService10ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService10TestShapeInputService10TestCaseOperation1Input{ - BlobArg: []byte("foo"), - } - req, _ := svc.InputService10TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&BlobArg=Zm9v&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService11ProtocolTestBase64EncodedBlobsNestedCase1(t *testing.T) { - svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService11TestShapeInputService11TestCaseOperation1Input{ - BlobArgs: [][]byte{ - []byte("foo"), - }, - } - req, _ := svc.InputService11TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&BlobArgs.1=Zm9v&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService12ProtocolTestTimestampValuesCase1(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - TimeCustom: aws.Time(time.Unix(1422172800, 0)), - TimeFormat: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService12TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&TimeCustom=1422172800&TimeFormat=1422172800&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation1Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService13TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation2Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService13TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation3Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService13TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveStruct.RecursiveStruct.RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation4Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveList: []*InputService13TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService13TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveList.member.1.NoRecurse=foo&RecursiveStruct.RecursiveList.member.2.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation5Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveList: []*InputService13TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService13TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveList.member.1.NoRecurse=foo&RecursiveStruct.RecursiveList.member.2.RecursiveStruct.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation6Input{ - RecursiveStruct: &InputService13TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService13TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService13TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveMap.entry.1.key=foo&RecursiveStruct.RecursiveMap.entry.1.value.NoRecurse=foo&RecursiveStruct.RecursiveMap.entry.2.key=bar&RecursiveStruct.RecursiveMap.entry.2.value.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService14TestShapeInputService14TestCaseOperation1Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService14TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Token=abc123&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService14TestShapeInputService14TestCaseOperation2Input{} - req, _ := svc.InputService14TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Token=00000000-0000-4000-8000-000000000000&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestEnumCase1(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation1Input{ - FooEnum: aws.String("foo"), - ListEnums: []*string{ - aws.String("foo"), - aws.String(""), - aws.String("bar"), - }, - } - req, _ := svc.InputService15TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&FooEnum=foo&ListEnums.member.1=foo&ListEnums.member.2=&ListEnums.member.3=bar&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestEnumCase2(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation2Input{ - FooEnum: aws.String("foo"), - } - req, _ := svc.InputService15TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&FooEnum=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestEnumCase3(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation3Input{} - req, _ := svc.InputService15TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestEndpointHostTraitCase1(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")}) - input := &InputService16TestShapeInputService16TestCaseOperation1Input{ - Name: aws.String("myname"), - } - req, _ := svc.InputService16TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=StaticOp&Name=myname&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://data-service.region.amazonaws.com/", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestEndpointHostTraitCase2(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - Name: aws.String("myname"), - } - req, _ := svc.InputService16TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=MemberRefOp&Name=myname&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://foo-myname.service.region.amazonaws.com/", r.URL.String()) - - // assert headers - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error_test.go deleted file mode 100644 index 5242a0c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error_test.go +++ /dev/null @@ -1,94 +0,0 @@ -// +build go1.8 - -package query - -import ( - "io/ioutil" - "net/http" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestUnmarshalError(t *testing.T) { - cases := map[string]struct { - Request *request.Request - Code, Msg string - ReqID string - Status int - }{ - "ErrorResponse": { - Request: &request.Request{ - HTTPResponse: &http.Response{ - StatusCode: 400, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader( - ` - - codeAbcmsg123 - - reqID123 - `)), - }, - }, - Code: "codeAbc", Msg: "msg123", - Status: 400, ReqID: "reqID123", - }, - "ServiceUnavailableException": { - Request: &request.Request{ - HTTPResponse: &http.Response{ - StatusCode: 502, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader( - ` - else - `)), - }, - }, - Code: "ServiceUnavailableException", - Msg: "service is unavailable", - Status: 502, - }, - "unknown tag": { - Request: &request.Request{ - HTTPResponse: &http.Response{ - StatusCode: 400, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader( - ` - . - `)), - }, - }, - Code: request.ErrCodeSerialization, - Msg: "failed to unmarshal error message", - Status: 400, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - r := c.Request - UnmarshalError(r) - if r.Error == nil { - t.Fatalf("expect error, got none") - } - - aerr := r.Error.(awserr.RequestFailure) - if e, a := c.Code, aerr.Code(); e != a { - t.Errorf("expect %v code, got %v", e, a) - } - if e, a := c.Msg, aerr.Message(); e != a { - t.Errorf("expect %q message, got %q", e, a) - } - if e, a := c.ReqID, aerr.RequestID(); e != a { - t.Errorf("expect %v request ID, got %v", e, a) - } - if e, a := c.Status, aerr.StatusCode(); e != a { - t.Errorf("expect %v status code, got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go deleted file mode 100644 index d4ad342..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go +++ /dev/null @@ -1,3286 +0,0 @@ -// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. - -package query_test - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" -) - -var _ bytes.Buffer // always import bytes -var _ http.Request -var _ json.Marshaler -var _ time.Time -var _ xmlutil.XMLNode -var _ xml.Attr -var _ = ioutil.Discard -var _ = util.Trim("") -var _ = url.Values{} -var _ = io.EOF -var _ = aws.String -var _ = fmt.Println -var _ = reflect.Value{} - -func init() { - protocol.RandReader = &awstesting.ZeroReader{} -} - -// OutputService1ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService1ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService1ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService1ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService1ProtocolTest client from just a session. -// svc := outputservice1protocoltest.New(mySession) -// -// // Create a OutputService1ProtocolTest client with additional configuration -// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest { - c := p.ClientConfig("outputservice1protocoltest", cfgs...) - return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService1ProtocolTest", - ServiceID: "OutputService1ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService1TestCaseOperation1 = "OperationName" - -// OutputService1TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService1TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService1TestCaseOperation1 for more information on using the OutputService1TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService1TestCaseOperation1Request method. -// req, resp := client.OutputService1TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService1TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} - } - - output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService1TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService1TestCaseOperation1 for usage and error information. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { - req, out := c.OutputService1TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService1TestCaseOperation1WithContext is the same as OutputService1TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService1TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1WithContext(ctx aws.Context, input *OutputService1TestShapeOutputService1TestCaseOperation1Input, opts ...request.Option) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { - req, out := c.OutputService1TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Char *string `type:"character"` - - Double *float64 `type:"double"` - - FalseBool *bool `type:"boolean"` - - Float *float64 `type:"float"` - - Long *int64 `type:"long"` - - Num *int64 `locationName:"FooNum" type:"integer"` - - Str *string `type:"string"` - - Timestamp *time.Time `type:"timestamp"` - - TrueBool *bool `type:"boolean"` -} - -// SetChar sets the Char field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetChar(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Char = &v - return s -} - -// SetDouble sets the Double field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetDouble(v float64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Double = &v - return s -} - -// SetFalseBool sets the FalseBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetFalseBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.FalseBool = &v - return s -} - -// SetFloat sets the Float field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetFloat(v float64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Float = &v - return s -} - -// SetLong sets the Long field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetLong(v int64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Long = &v - return s -} - -// SetNum sets the Num field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetNum(v int64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Num = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetStr(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Str = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTimestamp(v time.Time) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Timestamp = &v - return s -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -// OutputService2ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService2ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService2ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService2ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService2ProtocolTest client from just a session. -// svc := outputservice2protocoltest.New(mySession) -// -// // Create a OutputService2ProtocolTest client with additional configuration -// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest { - c := p.ClientConfig("outputservice2protocoltest", cfgs...) - return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService2ProtocolTest", - ServiceID: "OutputService2ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService2TestCaseOperation1 = "OperationName" - -// OutputService2TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService2TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService2TestCaseOperation1 for more information on using the OutputService2TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService2TestCaseOperation1Request method. -// req, resp := client.OutputService2TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService2TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} - } - - output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService2TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService2TestCaseOperation1 for usage and error information. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { - req, out := c.OutputService2TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService2TestCaseOperation1WithContext is the same as OutputService2TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService2TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1WithContext(ctx aws.Context, input *OutputService2TestShapeOutputService2TestCaseOperation1Input, opts ...request.Option) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { - req, out := c.OutputService2TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Num *int64 `type:"integer"` - - Str *string `type:"string"` -} - -// SetNum sets the Num field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetNum(v int64) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.Num = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetStr(v string) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.Str = &v - return s -} - -// OutputService3ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService3ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService3ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService3ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService3ProtocolTest client from just a session. -// svc := outputservice3protocoltest.New(mySession) -// -// // Create a OutputService3ProtocolTest client with additional configuration -// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest { - c := p.ClientConfig("outputservice3protocoltest", cfgs...) - return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService3ProtocolTest", - ServiceID: "OutputService3ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService3TestCaseOperation1 = "OperationName" - -// OutputService3TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService3TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService3TestCaseOperation1 for more information on using the OutputService3TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService3TestCaseOperation1Request method. -// req, resp := client.OutputService3TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService3TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} - } - - output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService3TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService3TestCaseOperation1 for usage and error information. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { - req, out := c.OutputService3TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService3TestCaseOperation1WithContext is the same as OutputService3TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService3TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1WithContext(ctx aws.Context, input *OutputService3TestShapeOutputService3TestCaseOperation1Input, opts ...request.Option) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { - req, out := c.OutputService3TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - // Blob is automatically base64 encoded/decoded by the SDK. - Blob []byte `type:"blob"` -} - -// SetBlob sets the Blob field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetBlob(v []byte) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.Blob = v - return s -} - -// OutputService4ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService4ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService4ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService4ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService4ProtocolTest client from just a session. -// svc := outputservice4protocoltest.New(mySession) -// -// // Create a OutputService4ProtocolTest client with additional configuration -// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest { - c := p.ClientConfig("outputservice4protocoltest", cfgs...) - return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService4ProtocolTest", - ServiceID: "OutputService4ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService4TestCaseOperation1 = "OperationName" - -// OutputService4TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService4TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService4TestCaseOperation1 for more information on using the OutputService4TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService4TestCaseOperation1Request method. -// req, resp := client.OutputService4TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService4TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} - } - - output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService4TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService4TestCaseOperation1 for usage and error information. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { - req, out := c.OutputService4TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService4TestCaseOperation1WithContext is the same as OutputService4TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService4TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1WithContext(ctx aws.Context, input *OutputService4TestShapeOutputService4TestCaseOperation1Input, opts ...request.Option) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { - req, out := c.OutputService4TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService4TestShapeOutputService4TestCaseOperation1Output) SetListMember(v []*string) *OutputService4TestShapeOutputService4TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService5ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService5ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService5ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService5ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService5ProtocolTest client from just a session. -// svc := outputservice5protocoltest.New(mySession) -// -// // Create a OutputService5ProtocolTest client with additional configuration -// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest { - c := p.ClientConfig("outputservice5protocoltest", cfgs...) - return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService5ProtocolTest", - ServiceID: "OutputService5ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService5TestCaseOperation1 = "OperationName" - -// OutputService5TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService5TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService5TestCaseOperation1 for more information on using the OutputService5TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService5TestCaseOperation1Request method. -// req, resp := client.OutputService5TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService5TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} - } - - output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService5TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService5TestCaseOperation1 for usage and error information. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { - req, out := c.OutputService5TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService5TestCaseOperation1WithContext is the same as OutputService5TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService5TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1WithContext(ctx aws.Context, input *OutputService5TestShapeOutputService5TestCaseOperation1Input, opts ...request.Option) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { - req, out := c.OutputService5TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `locationNameList:"item" type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService5TestShapeOutputService5TestCaseOperation1Output) SetListMember(v []*string) *OutputService5TestShapeOutputService5TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService6ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService6ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService6ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService6ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService6ProtocolTest client from just a session. -// svc := outputservice6protocoltest.New(mySession) -// -// // Create a OutputService6ProtocolTest client with additional configuration -// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest { - c := p.ClientConfig("outputservice6protocoltest", cfgs...) - return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService6ProtocolTest", - ServiceID: "OutputService6ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService6TestCaseOperation1 = "OperationName" - -// OutputService6TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService6TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService6TestCaseOperation1 for more information on using the OutputService6TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService6TestCaseOperation1Request method. -// req, resp := client.OutputService6TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService6TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} - } - - output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService6TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService6TestCaseOperation1 for usage and error information. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { - req, out := c.OutputService6TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService6TestCaseOperation1WithContext is the same as OutputService6TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService6TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1WithContext(ctx aws.Context, input *OutputService6TestShapeOutputService6TestCaseOperation1Input, opts ...request.Option) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { - req, out := c.OutputService6TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list" flattened:"true"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService6TestShapeOutputService6TestCaseOperation1Output) SetListMember(v []*string) *OutputService6TestShapeOutputService6TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService7ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService7ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService7ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService7ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService7ProtocolTest client from just a session. -// svc := outputservice7protocoltest.New(mySession) -// -// // Create a OutputService7ProtocolTest client with additional configuration -// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest { - c := p.ClientConfig("outputservice7protocoltest", cfgs...) - return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService7ProtocolTest", - ServiceID: "OutputService7ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService7TestCaseOperation1 = "OperationName" - -// OutputService7TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService7TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService7TestCaseOperation1 for more information on using the OutputService7TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService7TestCaseOperation1Request method. -// req, resp := client.OutputService7TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService7TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} - } - - output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService7TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService7TestCaseOperation1 for usage and error information. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { - req, out := c.OutputService7TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService7TestCaseOperation1WithContext is the same as OutputService7TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService7TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1WithContext(ctx aws.Context, input *OutputService7TestShapeOutputService7TestCaseOperation1Input, opts ...request.Option) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { - req, out := c.OutputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list" flattened:"true"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService7TestShapeOutputService7TestCaseOperation1Output) SetListMember(v []*string) *OutputService7TestShapeOutputService7TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService8ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService8ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService8ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService8ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService8ProtocolTest client from just a session. -// svc := outputservice8protocoltest.New(mySession) -// -// // Create a OutputService8ProtocolTest client with additional configuration -// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest { - c := p.ClientConfig("outputservice8protocoltest", cfgs...) - return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService8ProtocolTest", - ServiceID: "OutputService8ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService8TestCaseOperation1 = "OperationName" - -// OutputService8TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService8TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService8TestCaseOperation1 for more information on using the OutputService8TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService8TestCaseOperation1Request method. -// req, resp := client.OutputService8TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService8TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} - } - - output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService8TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService8TestCaseOperation1 for usage and error information. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { - req, out := c.OutputService8TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService8TestCaseOperation1WithContext is the same as OutputService8TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService8TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1WithContext(ctx aws.Context, input *OutputService8TestShapeOutputService8TestCaseOperation1Input, opts ...request.Option) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { - req, out := c.OutputService8TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - List []*OutputService8TestShapeStructureShape `type:"list"` -} - -// SetList sets the List field's value. -func (s *OutputService8TestShapeOutputService8TestCaseOperation1Output) SetList(v []*OutputService8TestShapeStructureShape) *OutputService8TestShapeOutputService8TestCaseOperation1Output { - s.List = v - return s -} - -type OutputService8TestShapeStructureShape struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Baz *string `type:"string"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *OutputService8TestShapeStructureShape) SetBar(v string) *OutputService8TestShapeStructureShape { - s.Bar = &v - return s -} - -// SetBaz sets the Baz field's value. -func (s *OutputService8TestShapeStructureShape) SetBaz(v string) *OutputService8TestShapeStructureShape { - s.Baz = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *OutputService8TestShapeStructureShape) SetFoo(v string) *OutputService8TestShapeStructureShape { - s.Foo = &v - return s -} - -// OutputService9ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService9ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService9ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService9ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService9ProtocolTest client from just a session. -// svc := outputservice9protocoltest.New(mySession) -// -// // Create a OutputService9ProtocolTest client with additional configuration -// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest { - c := p.ClientConfig("outputservice9protocoltest", cfgs...) - return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService9ProtocolTest", - ServiceID: "OutputService9ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService9TestCaseOperation1 = "OperationName" - -// OutputService9TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService9TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService9TestCaseOperation1 for more information on using the OutputService9TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService9TestCaseOperation1Request method. -// req, resp := client.OutputService9TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService9TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{} - } - - output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService9TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService9TestCaseOperation1 for usage and error information. -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { - req, out := c.OutputService9TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService9TestCaseOperation1WithContext is the same as OutputService9TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService9TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1WithContext(ctx aws.Context, input *OutputService9TestShapeOutputService9TestCaseOperation1Input, opts ...request.Option) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { - req, out := c.OutputService9TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - List []*OutputService9TestShapeStructureShape `type:"list" flattened:"true"` -} - -// SetList sets the List field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetList(v []*OutputService9TestShapeStructureShape) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.List = v - return s -} - -type OutputService9TestShapeStructureShape struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Baz *string `type:"string"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *OutputService9TestShapeStructureShape) SetBar(v string) *OutputService9TestShapeStructureShape { - s.Bar = &v - return s -} - -// SetBaz sets the Baz field's value. -func (s *OutputService9TestShapeStructureShape) SetBaz(v string) *OutputService9TestShapeStructureShape { - s.Baz = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *OutputService9TestShapeStructureShape) SetFoo(v string) *OutputService9TestShapeStructureShape { - s.Foo = &v - return s -} - -// OutputService10ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService10ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService10ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService10ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService10ProtocolTest client from just a session. -// svc := outputservice10protocoltest.New(mySession) -// -// // Create a OutputService10ProtocolTest client with additional configuration -// svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest { - c := p.ClientConfig("outputservice10protocoltest", cfgs...) - return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest { - svc := &OutputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService10ProtocolTest", - ServiceID: "OutputService10ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService10ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService10TestCaseOperation1 = "OperationName" - -// OutputService10TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService10TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService10TestCaseOperation1 for more information on using the OutputService10TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService10TestCaseOperation1Request method. -// req, resp := client.OutputService10TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService10TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{} - } - - output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService10TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService10TestCaseOperation1 for usage and error information. -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { - req, out := c.OutputService10TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService10TestCaseOperation1WithContext is the same as OutputService10TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService10TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1WithContext(ctx aws.Context, input *OutputService10TestShapeOutputService10TestCaseOperation1Input, opts ...request.Option) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { - req, out := c.OutputService10TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - List []*string `locationNameList:"NamedList" type:"list" flattened:"true"` -} - -// SetList sets the List field's value. -func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetList(v []*string) *OutputService10TestShapeOutputService10TestCaseOperation1Output { - s.List = v - return s -} - -// OutputService11ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService11ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService11ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService11ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService11ProtocolTest client from just a session. -// svc := outputservice11protocoltest.New(mySession) -// -// // Create a OutputService11ProtocolTest client with additional configuration -// svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest { - c := p.ClientConfig("outputservice11protocoltest", cfgs...) - return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest { - svc := &OutputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService11ProtocolTest", - ServiceID: "OutputService11ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService11ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService11TestCaseOperation1 = "OperationName" - -// OutputService11TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService11TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService11TestCaseOperation1 for more information on using the OutputService11TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService11TestCaseOperation1Request method. -// req, resp := client.OutputService11TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService11TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{} - } - - output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService11TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService11TestCaseOperation1 for usage and error information. -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { - req, out := c.OutputService11TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService11TestCaseOperation1WithContext is the same as OutputService11TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService11TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1WithContext(ctx aws.Context, input *OutputService11TestShapeOutputService11TestCaseOperation1Input, opts ...request.Option) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { - req, out := c.OutputService11TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService11TestShapeOutputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*OutputService11TestShapeStructType `type:"map"` -} - -// SetMap sets the Map field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetMap(v map[string]*OutputService11TestShapeStructType) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Map = v - return s -} - -type OutputService11TestShapeStructType struct { - _ struct{} `type:"structure"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService11TestShapeStructType) SetFoo(v string) *OutputService11TestShapeStructType { - s.Foo = &v - return s -} - -// OutputService12ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService12ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService12ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService12ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService12ProtocolTest client from just a session. -// svc := outputservice12protocoltest.New(mySession) -// -// // Create a OutputService12ProtocolTest client with additional configuration -// svc := outputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService12ProtocolTest { - c := p.ClientConfig("outputservice12protocoltest", cfgs...) - return newOutputService12ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService12ProtocolTest { - svc := &OutputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService12ProtocolTest", - ServiceID: "OutputService12ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService12ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService12TestCaseOperation1 = "OperationName" - -// OutputService12TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService12TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService12TestCaseOperation1 for more information on using the OutputService12TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService12TestCaseOperation1Request method. -// req, resp := client.OutputService12TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *request.Request, output *OutputService12TestShapeOutputService12TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService12TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService12TestShapeOutputService12TestCaseOperation1Input{} - } - - output = &OutputService12TestShapeOutputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService12TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService12TestCaseOperation1 for usage and error information. -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { - req, out := c.OutputService12TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService12TestCaseOperation1WithContext is the same as OutputService12TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService12TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1WithContext(ctx aws.Context, input *OutputService12TestShapeOutputService12TestCaseOperation1Input, opts ...request.Option) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { - req, out := c.OutputService12TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService12TestShapeOutputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*string `type:"map" flattened:"true"` -} - -// SetMap sets the Map field's value. -func (s *OutputService12TestShapeOutputService12TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService12TestShapeOutputService12TestCaseOperation1Output { - s.Map = v - return s -} - -// OutputService13ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService13ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService13ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService13ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService13ProtocolTest client from just a session. -// svc := outputservice13protocoltest.New(mySession) -// -// // Create a OutputService13ProtocolTest client with additional configuration -// svc := outputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService13ProtocolTest { - c := p.ClientConfig("outputservice13protocoltest", cfgs...) - return newOutputService13ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService13ProtocolTest { - svc := &OutputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService13ProtocolTest", - ServiceID: "OutputService13ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService13ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService13TestCaseOperation1 = "OperationName" - -// OutputService13TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService13TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService13TestCaseOperation1 for more information on using the OutputService13TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService13TestCaseOperation1Request method. -// req, resp := client.OutputService13TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService13TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService13TestShapeOutputService13TestCaseOperation1Input{} - } - - output = &OutputService13TestShapeOutputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService13TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService13TestCaseOperation1 for usage and error information. -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { - req, out := c.OutputService13TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService13TestCaseOperation1WithContext is the same as OutputService13TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService13TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1WithContext(ctx aws.Context, input *OutputService13TestShapeOutputService13TestCaseOperation1Input, opts ...request.Option) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { - req, out := c.OutputService13TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService13TestShapeOutputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` -} - -// SetMap sets the Map field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.Map = v - return s -} - -// OutputService14ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService14ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService14ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService14ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService14ProtocolTest client from just a session. -// svc := outputservice14protocoltest.New(mySession) -// -// // Create a OutputService14ProtocolTest client with additional configuration -// svc := outputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService14ProtocolTest { - c := p.ClientConfig("outputservice14protocoltest", cfgs...) - return newOutputService14ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService14ProtocolTest { - svc := &OutputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService14ProtocolTest", - ServiceID: "OutputService14ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService14ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService14TestCaseOperation1 = "OperationName" - -// OutputService14TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService14TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService14TestCaseOperation1 for more information on using the OutputService14TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService14TestCaseOperation1Request method. -// req, resp := client.OutputService14TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService14TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService14TestShapeOutputService14TestCaseOperation1Input{} - } - - output = &OutputService14TestShapeOutputService14TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService14TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService14TestCaseOperation1 for usage and error information. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { - req, out := c.OutputService14TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService14TestCaseOperation1WithContext is the same as OutputService14TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService14TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1WithContext(ctx aws.Context, input *OutputService14TestShapeOutputService14TestCaseOperation1Input, opts ...request.Option) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { - req, out := c.OutputService14TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService14TestShapeOutputService14TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService14TestShapeOutputService14TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` -} - -// SetMap sets the Map field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService14TestShapeOutputService14TestCaseOperation1Output { - s.Map = v - return s -} - -// OutputService15ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService15ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService15ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService15ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService15ProtocolTest client from just a session. -// svc := outputservice15protocoltest.New(mySession) -// -// // Create a OutputService15ProtocolTest client with additional configuration -// svc := outputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService15ProtocolTest { - c := p.ClientConfig("outputservice15protocoltest", cfgs...) - return newOutputService15ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService15ProtocolTest { - svc := &OutputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService15ProtocolTest", - ServiceID: "OutputService15ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService15ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService15TestCaseOperation1 = "OperationName" - -// OutputService15TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService15TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService15TestCaseOperation1 for more information on using the OutputService15TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService15TestCaseOperation1Request method. -// req, resp := client.OutputService15TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1Request(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (req *request.Request, output *OutputService15TestShapeOutputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService15TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService15TestShapeOutputService15TestCaseOperation1Input{} - } - - output = &OutputService15TestShapeOutputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService15TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService15TestCaseOperation1 for usage and error information. -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) { - req, out := c.OutputService15TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService15TestCaseOperation1WithContext is the same as OutputService15TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService15TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1WithContext(ctx aws.Context, input *OutputService15TestShapeOutputService15TestCaseOperation1Input, opts ...request.Option) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) { - req, out := c.OutputService15TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService15TestShapeOutputService15TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService15TestShapeOutputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService15TestShapeOutputService15TestCaseOperation1Output) SetFoo(v string) *OutputService15TestShapeOutputService15TestCaseOperation1Output { - s.Foo = &v - return s -} - -// OutputService16ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService16ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService16ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService16ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService16ProtocolTest client from just a session. -// svc := outputservice16protocoltest.New(mySession) -// -// // Create a OutputService16ProtocolTest client with additional configuration -// svc := outputservice16protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService16ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService16ProtocolTest { - c := p.ClientConfig("outputservice16protocoltest", cfgs...) - return newOutputService16ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService16ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService16ProtocolTest { - svc := &OutputService16ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService16ProtocolTest", - ServiceID: "OutputService16ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService16ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService16ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService16TestCaseOperation1 = "OperationName" - -// OutputService16TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService16TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService16TestCaseOperation1 for more information on using the OutputService16TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService16TestCaseOperation1Request method. -// req, resp := client.OutputService16TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService16ProtocolTest) OutputService16TestCaseOperation1Request(input *OutputService16TestShapeOutputService16TestCaseOperation1Input) (req *request.Request, output *OutputService16TestShapeOutputService16TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService16TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService16TestShapeOutputService16TestCaseOperation1Input{} - } - - output = &OutputService16TestShapeOutputService16TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService16TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService16TestCaseOperation1 for usage and error information. -func (c *OutputService16ProtocolTest) OutputService16TestCaseOperation1(input *OutputService16TestShapeOutputService16TestCaseOperation1Input) (*OutputService16TestShapeOutputService16TestCaseOperation1Output, error) { - req, out := c.OutputService16TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService16TestCaseOperation1WithContext is the same as OutputService16TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService16TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService16ProtocolTest) OutputService16TestCaseOperation1WithContext(ctx aws.Context, input *OutputService16TestShapeOutputService16TestCaseOperation1Input, opts ...request.Option) (*OutputService16TestShapeOutputService16TestCaseOperation1Output, error) { - req, out := c.OutputService16TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService16TestShapeOutputService16TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService16TestShapeOutputService16TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - StructMember *OutputService16TestShapeTimeContainer `type:"structure"` - - TimeArg *time.Time `type:"timestamp"` - - TimeCustom *time.Time `type:"timestamp" timestampFormat:"rfc822"` - - TimeFormat *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"` -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetStructMember(v *OutputService16TestShapeTimeContainer) *OutputService16TestShapeOutputService16TestCaseOperation1Output { - s.StructMember = v - return s -} - -// SetTimeArg sets the TimeArg field's value. -func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeArg(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output { - s.TimeArg = &v - return s -} - -// SetTimeCustom sets the TimeCustom field's value. -func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeCustom(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output { - s.TimeCustom = &v - return s -} - -// SetTimeFormat sets the TimeFormat field's value. -func (s *OutputService16TestShapeOutputService16TestCaseOperation1Output) SetTimeFormat(v time.Time) *OutputService16TestShapeOutputService16TestCaseOperation1Output { - s.TimeFormat = &v - return s -} - -type OutputService16TestShapeTimeContainer struct { - _ struct{} `type:"structure"` - - Bar *time.Time `locationName:"bar" type:"timestamp" timestampFormat:"unixTimestamp"` - - Foo *time.Time `locationName:"foo" type:"timestamp"` -} - -// SetBar sets the Bar field's value. -func (s *OutputService16TestShapeTimeContainer) SetBar(v time.Time) *OutputService16TestShapeTimeContainer { - s.Bar = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *OutputService16TestShapeTimeContainer) SetFoo(v time.Time) *OutputService16TestShapeTimeContainer { - s.Foo = &v - return s -} - -// OutputService17ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService17ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService17ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService17ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService17ProtocolTest client from just a session. -// svc := outputservice17protocoltest.New(mySession) -// -// // Create a OutputService17ProtocolTest client with additional configuration -// svc := outputservice17protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService17ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService17ProtocolTest { - c := p.ClientConfig("outputservice17protocoltest", cfgs...) - return newOutputService17ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService17ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService17ProtocolTest { - svc := &OutputService17ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService17ProtocolTest", - ServiceID: "OutputService17ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService17ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService17ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService17TestCaseOperation1 = "OperationName" - -// OutputService17TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService17TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService17TestCaseOperation1 for more information on using the OutputService17TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService17TestCaseOperation1Request method. -// req, resp := client.OutputService17TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService17ProtocolTest) OutputService17TestCaseOperation1Request(input *OutputService17TestShapeOutputService17TestCaseOperation1Input) (req *request.Request, output *OutputService17TestShapeOutputService17TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService17TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService17TestShapeOutputService17TestCaseOperation1Input{} - } - - output = &OutputService17TestShapeOutputService17TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService17TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService17TestCaseOperation1 for usage and error information. -func (c *OutputService17ProtocolTest) OutputService17TestCaseOperation1(input *OutputService17TestShapeOutputService17TestCaseOperation1Input) (*OutputService17TestShapeOutputService17TestCaseOperation1Output, error) { - req, out := c.OutputService17TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService17TestCaseOperation1WithContext is the same as OutputService17TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService17TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService17ProtocolTest) OutputService17TestCaseOperation1WithContext(ctx aws.Context, input *OutputService17TestShapeOutputService17TestCaseOperation1Input, opts ...request.Option) (*OutputService17TestShapeOutputService17TestCaseOperation1Output, error) { - req, out := c.OutputService17TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService17TestShapeOutputService17TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService17TestShapeOutputService17TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - FooEnum *string `type:"string" enum:"OutputService17TestShapeEC2EnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *OutputService17TestShapeOutputService17TestCaseOperation1Output) SetFooEnum(v string) *OutputService17TestShapeOutputService17TestCaseOperation1Output { - s.FooEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *OutputService17TestShapeOutputService17TestCaseOperation1Output) SetListEnums(v []*string) *OutputService17TestShapeOutputService17TestCaseOperation1Output { - s.ListEnums = v - return s -} - -const ( - // EC2EnumTypeFoo is a OutputService17TestShapeEC2EnumType enum value - EC2EnumTypeFoo = "foo" - - // EC2EnumTypeBar is a OutputService17TestShapeEC2EnumType enum value - EC2EnumTypeBar = "bar" -) - -// -// Tests begin here -// - -func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00Zrequest-id")) - req, out := svc.OutputService1TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "a", *out.Char; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.3, *out.Double; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := false, *out.FalseBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.2, *out.Float; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(200), *out.Long; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(123), *out.Num; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "myname", *out.Str; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := true, *out.TrueBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) { - svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("mynamerequest-id")) - req, out := svc.OutputService2TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "myname", *out.Str; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService3ProtocolTestBlobCase1(t *testing.T) { - svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("dmFsdWU=requestid")) - req, out := svc.OutputService3TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "value", string(out.Blob); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123requestid")) - req, out := svc.OutputService4TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { - svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123requestid")) - req, out := svc.OutputService5TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) { - svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123requestid")) - req, out := svc.OutputService6TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T) { - svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abcrequestid")) - req, out := svc.OutputService7TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) { - svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) - req, out := svc.OutputService8TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "firstbar", *out.List[0].Bar; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "firstbaz", *out.List[0].Baz; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "firstfoo", *out.List[0].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondbar", *out.List[1].Bar; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondbaz", *out.List[1].Baz; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondfoo", *out.List[1].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T) { - svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) - req, out := svc.OutputService9TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "firstbar", *out.List[0].Bar; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "firstbaz", *out.List[0].Baz; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "firstfoo", *out.List[0].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondbar", *out.List[1].Bar; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondbaz", *out.List[1].Baz; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "secondfoo", *out.List[1].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { - svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abrequestid")) - req, out := svc.OutputService10TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "a", *out.List[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "b", *out.List[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) { - svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService11TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) { - svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService12TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testing.T) { - svc := NewOutputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarrequestid")) - req, out := svc.OutputService13TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bar", *out.Map["qux"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) { - svc := NewOutputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService14TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) { - svc := NewOutputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("requestid")) - req, out := svc.OutputService15TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "", *out.Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService16ProtocolTestTimestampMembersCase1(t *testing.T) { - svc := NewOutputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("2014-04-29T18:30:38Z13987962382014-04-29T18:30:38ZTue, 29 Apr 2014 18:30:38 GMT1398796238requestid")) - req, out := svc.OutputService16TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Bar.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Foo.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeArg.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeCustom.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeFormat.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService17ProtocolTestEnumOutputCase1(t *testing.T) { - svc := NewOutputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("foofoobar")) - req, out := svc.OutputService17TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "foo", *out.FooEnum; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "foo", *out.ListEnums[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.ListEnums[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build_test.go deleted file mode 100644 index 9f18081..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package rest - -import ( - "net/http" - "net/url" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -func TestCleanPath(t *testing.T) { - uri := &url.URL{ - Path: "//foo//bar", - Scheme: "https", - Host: "host", - } - cleanPath(uri) - - expected := "https://host/foo/bar" - if a, e := uri.String(), expected; a != e { - t.Errorf("expect %q URI, got %q", e, a) - } -} - -func TestMarshalPath(t *testing.T) { - in := struct { - Bucket *string `location:"uri" locationName:"bucket"` - Key *string `location:"uri" locationName:"key"` - }{ - Bucket: aws.String("mybucket"), - Key: aws.String("my/cool+thing space/object世界"), - } - - expectURL := `/mybucket/my/cool+thing space/object世界` - expectEscapedURL := `/mybucket/my/cool%2Bthing%20space/object%E4%B8%96%E7%95%8C` - - req := &request.Request{ - HTTPRequest: &http.Request{ - URL: &url.URL{Scheme: "https", Host: "exmaple.com", Path: "/{bucket}/{key+}"}, - }, - Params: &in, - } - - Build(req) - - if req.Error != nil { - t.Fatalf("unexpected error, %v", req.Error) - } - - if a, e := req.HTTPRequest.URL.Path, expectURL; a != e { - t.Errorf("expect %q URI, got %q", e, a) - } - - if a, e := req.HTTPRequest.URL.RawPath, expectEscapedURL; a != e { - t.Errorf("expect %q escaped URI, got %q", e, a) - } - - if a, e := req.HTTPRequest.URL.EscapedPath(), expectEscapedURL; a != e { - t.Errorf("expect %q escaped URI, got %q", e, a) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/rest_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/rest_test.go deleted file mode 100644 index 46457b2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/rest_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package rest_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -func TestUnsetHeaders(t *testing.T) { - cfg := &aws.Config{Region: aws.String("us-west-2")} - c := unit.Session.ClientConfig("testService", cfg) - svc := client.New( - *cfg, - metadata.ClientInfo{ - ServiceName: "testService", - SigningName: c.SigningName, - SigningRegion: c.SigningRegion, - Endpoint: c.Endpoint, - APIVersion: "", - }, - c.Handlers, - ) - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(rest.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(rest.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(rest.UnmarshalMetaHandler) - op := &request.Operation{ - Name: "test-operation", - HTTPPath: "/", - } - - input := &struct { - Foo aws.JSONValue `location:"header" locationName:"x-amz-foo" type:"jsonvalue"` - Bar aws.JSONValue `location:"header" locationName:"x-amz-bar" type:"jsonvalue"` - }{} - - output := &struct { - Foo aws.JSONValue `location:"header" locationName:"x-amz-foo" type:"jsonvalue"` - Bar aws.JSONValue `location:"header" locationName:"x-amz-bar" type:"jsonvalue"` - }{} - - req := svc.NewRequest(op, input, output) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewBuffer(nil)), Header: http.Header{}} - req.HTTPResponse.Header.Set("X-Amz-Foo", "e30=") - - // unmarshal response - rest.UnmarshalMeta(req) - rest.Unmarshal(req) - if req.Error != nil { - t.Fatal(req.Error) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_bench_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_bench_test.go deleted file mode 100644 index 13106ee..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_bench_test.go +++ /dev/null @@ -1,366 +0,0 @@ -// +build bench - -package restxml_test - -import ( - "net/http" - "net/http/httptest" - "os" - "testing" - - "bytes" - "encoding/xml" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/service/cloudfront" - "github.com/aws/aws-sdk-go/service/s3" -) - -var ( - cloudfrontSvc *cloudfront.CloudFront - s3Svc *s3.S3 -) - -func TestMain(m *testing.M) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - })) - - sess := session.Must(session.NewSession(&aws.Config{ - Credentials: credentials.NewStaticCredentials("Key", "Secret", "Token"), - Endpoint: aws.String(server.URL), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - Region: aws.String(endpoints.UsWest2RegionID), - })) - cloudfrontSvc = cloudfront.New(sess) - s3Svc = s3.New(sess) - - c := m.Run() - server.Close() - os.Exit(c) -} - -func BenchmarkRESTXMLBuild_Complex_CFCreateDistro(b *testing.B) { - params := cloudfrontCreateDistributionInput() - - benchRESTXMLBuild(b, func() *request.Request { - req, _ := cloudfrontSvc.CreateDistributionRequest(params) - return req - }) -} - -func BenchmarkRESTXMLBuild_Simple_CFDeleteDistro(b *testing.B) { - params := cloudfrontDeleteDistributionInput() - - benchRESTXMLBuild(b, func() *request.Request { - req, _ := cloudfrontSvc.DeleteDistributionRequest(params) - return req - }) -} - -func BenchmarkRESTXMLBuild_REST_S3HeadObject(b *testing.B) { - params := s3HeadObjectInput() - - benchRESTXMLBuild(b, func() *request.Request { - req, _ := s3Svc.HeadObjectRequest(params) - return req - }) -} - -func BenchmarkRESTXMLBuild_XML_S3PutObjectAcl(b *testing.B) { - params := s3PutObjectAclInput() - - benchRESTXMLBuild(b, func() *request.Request { - req, _ := s3Svc.PutObjectAclRequest(params) - return req - }) -} - -func BenchmarkRESTXMLRequest_Complex_CFCreateDistro(b *testing.B) { - benchRESTXMLRequest(b, func() *request.Request { - req, _ := cloudfrontSvc.CreateDistributionRequest(cloudfrontCreateDistributionInput()) - return req - }) -} - -func BenchmarkRESTXMLRequest_Simple_CFDeleteDistro(b *testing.B) { - benchRESTXMLRequest(b, func() *request.Request { - req, _ := cloudfrontSvc.DeleteDistributionRequest(cloudfrontDeleteDistributionInput()) - return req - }) -} - -func BenchmarkRESTXMLRequest_REST_S3HeadObject(b *testing.B) { - benchRESTXMLRequest(b, func() *request.Request { - req, _ := s3Svc.HeadObjectRequest(s3HeadObjectInput()) - return req - }) -} - -func BenchmarkRESTXMLRequest_XML_S3PutObjectAcl(b *testing.B) { - benchRESTXMLRequest(b, func() *request.Request { - req, _ := s3Svc.PutObjectAclRequest(s3PutObjectAclInput()) - return req - }) -} - -func BenchmarkEncodingXML_Simple(b *testing.B) { - params := cloudfrontDeleteDistributionInput() - - for i := 0; i < b.N; i++ { - buf := &bytes.Buffer{} - encoder := xml.NewEncoder(buf) - if err := encoder.Encode(params); err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -func benchRESTXMLBuild(b *testing.B, reqFn func() *request.Request) { - b.ResetTimer() - - for i := 0; i < b.N; i++ { - req := reqFn() - restxml.Build(req) - if req.Error != nil { - b.Fatal("Unexpected error", req.Error) - } - } -} - -func benchRESTXMLRequest(b *testing.B, reqFn func() *request.Request) { - b.ResetTimer() - - for i := 0; i < b.N; i++ { - err := reqFn().Send() - if err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -func cloudfrontCreateDistributionInput() *cloudfront.CreateDistributionInput { - return &cloudfront.CreateDistributionInput{ - DistributionConfig: &cloudfront.DistributionConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - DefaultCacheBehavior: &cloudfront.DefaultCacheBehavior{ // Required - ForwardedValues: &cloudfront.ForwardedValues{ // Required - Cookies: &cloudfront.CookiePreference{ // Required - Forward: aws.String("ItemSelection"), // Required - WhitelistedNames: &cloudfront.CookieNames{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - QueryString: aws.Bool(true), // Required - Headers: &cloudfront.Headers{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - MinTTL: aws.Int64(1), // Required - TargetOriginId: aws.String("string"), // Required - TrustedSigners: &cloudfront.TrustedSigners{ // Required - Enabled: aws.Bool(true), // Required - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - ViewerProtocolPolicy: aws.String("ViewerProtocolPolicy"), // Required - AllowedMethods: &cloudfront.AllowedMethods{ - Items: []*string{ // Required - aws.String("Method"), // Required - // More values... - }, - Quantity: aws.Int64(1), // Required - CachedMethods: &cloudfront.CachedMethods{ - Items: []*string{ // Required - aws.String("Method"), // Required - // More values... - }, - Quantity: aws.Int64(1), // Required - }, - }, - DefaultTTL: aws.Int64(1), - MaxTTL: aws.Int64(1), - SmoothStreaming: aws.Bool(true), - }, - Enabled: aws.Bool(true), // Required - Origins: &cloudfront.Origins{ // Required - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.Origin{ - { // Required - DomainName: aws.String("string"), // Required - Id: aws.String("string"), // Required - CustomOriginConfig: &cloudfront.CustomOriginConfig{ - HTTPPort: aws.Int64(1), // Required - HTTPSPort: aws.Int64(1), // Required - OriginProtocolPolicy: aws.String("OriginProtocolPolicy"), // Required - }, - OriginPath: aws.String("string"), - S3OriginConfig: &cloudfront.S3OriginConfig{ - OriginAccessIdentity: aws.String("string"), // Required - }, - }, - // More values... - }, - }, - Aliases: &cloudfront.Aliases{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - CacheBehaviors: &cloudfront.CacheBehaviors{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.CacheBehavior{ - { // Required - ForwardedValues: &cloudfront.ForwardedValues{ // Required - Cookies: &cloudfront.CookiePreference{ // Required - Forward: aws.String("ItemSelection"), // Required - WhitelistedNames: &cloudfront.CookieNames{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - QueryString: aws.Bool(true), // Required - Headers: &cloudfront.Headers{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - MinTTL: aws.Int64(1), // Required - PathPattern: aws.String("string"), // Required - TargetOriginId: aws.String("string"), // Required - TrustedSigners: &cloudfront.TrustedSigners{ // Required - Enabled: aws.Bool(true), // Required - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - ViewerProtocolPolicy: aws.String("ViewerProtocolPolicy"), // Required - AllowedMethods: &cloudfront.AllowedMethods{ - Items: []*string{ // Required - aws.String("Method"), // Required - // More values... - }, - Quantity: aws.Int64(1), // Required - CachedMethods: &cloudfront.CachedMethods{ - Items: []*string{ // Required - aws.String("Method"), // Required - // More values... - }, - Quantity: aws.Int64(1), // Required - }, - }, - DefaultTTL: aws.Int64(1), - MaxTTL: aws.Int64(1), - SmoothStreaming: aws.Bool(true), - }, - // More values... - }, - }, - CustomErrorResponses: &cloudfront.CustomErrorResponses{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.CustomErrorResponse{ - { // Required - ErrorCode: aws.Int64(1), // Required - ErrorCachingMinTTL: aws.Int64(1), - ResponseCode: aws.String("string"), - ResponsePagePath: aws.String("string"), - }, - // More values... - }, - }, - DefaultRootObject: aws.String("string"), - Logging: &cloudfront.LoggingConfig{ - Bucket: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - IncludeCookies: aws.Bool(true), // Required - Prefix: aws.String("string"), // Required - }, - PriceClass: aws.String("PriceClass"), - Restrictions: &cloudfront.Restrictions{ - GeoRestriction: &cloudfront.GeoRestriction{ // Required - Quantity: aws.Int64(1), // Required - RestrictionType: aws.String("GeoRestrictionType"), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - ViewerCertificate: &cloudfront.ViewerCertificate{ - CloudFrontDefaultCertificate: aws.Bool(true), - IAMCertificateId: aws.String("string"), - MinimumProtocolVersion: aws.String("MinimumProtocolVersion"), - SSLSupportMethod: aws.String("SSLSupportMethod"), - }, - }, - } -} - -func cloudfrontDeleteDistributionInput() *cloudfront.DeleteDistributionInput { - return &cloudfront.DeleteDistributionInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } -} - -func s3HeadObjectInput() *s3.HeadObjectInput { - return &s3.HeadObjectInput{ - Bucket: aws.String("somebucketname"), - Key: aws.String("keyname"), - VersionId: aws.String("someVersion"), - IfMatch: aws.String("IfMatch"), - } -} - -func s3PutObjectAclInput() *s3.PutObjectAclInput { - return &s3.PutObjectAclInput{ - Bucket: aws.String("somebucketname"), - Key: aws.String("keyname"), - AccessControlPolicy: &s3.AccessControlPolicy{ - Grants: []*s3.Grant{ - { - Grantee: &s3.Grantee{ - DisplayName: aws.String("someName"), - EmailAddress: aws.String("someAddr"), - ID: aws.String("someID"), - Type: aws.String(s3.TypeCanonicalUser), - URI: aws.String("someURI"), - }, - Permission: aws.String(s3.PermissionWrite), - }, - }, - Owner: &s3.Owner{ - DisplayName: aws.String("howdy"), - ID: aws.String("someID"), - }, - }, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go deleted file mode 100644 index 066eb0a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go +++ /dev/null @@ -1,7324 +0,0 @@ -// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. - -package restxml_test - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" -) - -var _ bytes.Buffer // always import bytes -var _ http.Request -var _ json.Marshaler -var _ time.Time -var _ xmlutil.XMLNode -var _ xml.Attr -var _ = ioutil.Discard -var _ = util.Trim("") -var _ = url.Values{} -var _ = io.EOF -var _ = aws.String -var _ = fmt.Println -var _ = reflect.Value{} - -func init() { - protocol.RandReader = &awstesting.ZeroReader{} -} - -// InputService1ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService1ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService1ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService1ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService1ProtocolTest client from just a session. -// svc := inputservice1protocoltest.New(mySession) -// -// // Create a InputService1ProtocolTest client with additional configuration -// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest { - c := p.ClientConfig("inputservice1protocoltest", cfgs...) - return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService1ProtocolTest", - ServiceID: "InputService1ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService1ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService1TestCaseOperation1 = "OperationName" - -// InputService1TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation1 for more information on using the InputService1TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation1Request method. -// req, resp := client.InputService1TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation1Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation1 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { - req, out := c.InputService1TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation1WithContext is the same as InputService1TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation1Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { - req, out := c.InputService1TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService1TestCaseOperation2 = "OperationName" - -// InputService1TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation2 for more information on using the InputService1TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation2Request method. -// req, resp := client.InputService1TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input *InputService1TestShapeInputService1TestCaseOperation2Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation2, - HTTPMethod: "PUT", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation2Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation2 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2(input *InputService1TestShapeInputService1TestCaseOperation2Input) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) { - req, out := c.InputService1TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation2WithContext is the same as InputService1TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation2WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation2Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) { - req, out := c.InputService1TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService1TestCaseOperation3 = "OperationName" - -// InputService1TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService1TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService1TestCaseOperation3 for more information on using the InputService1TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService1TestCaseOperation3Request method. -// req, resp := client.InputService1TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input *InputService1TestShapeInputService1TestCaseOperation3Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation3, - HTTPMethod: "GET", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation3Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService1TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService1TestCaseOperation3 for usage and error information. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3(input *InputService1TestShapeInputService1TestCaseOperation3Input) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) { - req, out := c.InputService1TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService1TestCaseOperation3WithContext is the same as InputService1TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService1TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService1ProtocolTest) InputService1TestCaseOperation3WithContext(ctx aws.Context, input *InputService1TestShapeInputService1TestCaseOperation3Input, opts ...request.Option) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) { - req, out := c.InputService1TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService1TestShapeInputService1TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Description *string `type:"string"` - - Name *string `type:"string"` -} - -// SetDescription sets the Description field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetDescription(v string) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetName(v string) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Name = &v - return s -} - -type InputService1TestShapeInputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation2Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Description *string `type:"string"` - - Name *string `type:"string"` -} - -// SetDescription sets the Description field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation2Input) SetDescription(v string) *InputService1TestShapeInputService1TestCaseOperation2Input { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation2Input) SetName(v string) *InputService1TestShapeInputService1TestCaseOperation2Input { - s.Name = &v - return s -} - -type InputService1TestShapeInputService1TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation3Input struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -// InputService2ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService2ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService2ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService2ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService2ProtocolTest client from just a session. -// svc := inputservice2protocoltest.New(mySession) -// -// // Create a InputService2ProtocolTest client with additional configuration -// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest { - c := p.ClientConfig("inputservice2protocoltest", cfgs...) - return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService2ProtocolTest", - ServiceID: "InputService2ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService2ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService2TestCaseOperation1 = "OperationName" - -// InputService2TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService2TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService2TestCaseOperation1 for more information on using the InputService2TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService2TestCaseOperation1Request method. -// req, resp := client.InputService2TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService2TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService2TestShapeInputService2TestCaseOperation1Input{} - } - - output = &InputService2TestShapeInputService2TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService2TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService2TestCaseOperation1 for usage and error information. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { - req, out := c.InputService2TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService2TestCaseOperation1WithContext is the same as InputService2TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService2TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1WithContext(ctx aws.Context, input *InputService2TestShapeInputService2TestCaseOperation1Input, opts ...request.Option) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { - req, out := c.InputService2TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService2TestShapeInputService2TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - First *bool `type:"boolean"` - - Fourth *int64 `type:"integer"` - - Second *bool `type:"boolean"` - - Third *float64 `type:"float"` -} - -// SetFirst sets the First field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetFirst(v bool) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.First = &v - return s -} - -// SetFourth sets the Fourth field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetFourth(v int64) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Fourth = &v - return s -} - -// SetSecond sets the Second field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetSecond(v bool) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Second = &v - return s -} - -// SetThird sets the Third field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetThird(v float64) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Third = &v - return s -} - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService3ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService3ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService3ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService3ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService3ProtocolTest client from just a session. -// svc := inputservice3protocoltest.New(mySession) -// -// // Create a InputService3ProtocolTest client with additional configuration -// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest { - c := p.ClientConfig("inputservice3protocoltest", cfgs...) - return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService3ProtocolTest", - ServiceID: "InputService3ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService3ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService3TestCaseOperation1 = "OperationName" - -// InputService3TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService3TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService3TestCaseOperation1 for more information on using the InputService3TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService3TestCaseOperation1Request method. -// req, resp := client.InputService3TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation1Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService3TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService3TestCaseOperation1 for usage and error information. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { - req, out := c.InputService3TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService3TestCaseOperation1WithContext is the same as InputService3TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService3TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1WithContext(ctx aws.Context, input *InputService3TestShapeInputService3TestCaseOperation1Input, opts ...request.Option) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { - req, out := c.InputService3TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService3TestCaseOperation2 = "OperationName" - -// InputService3TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService3TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService3TestCaseOperation2 for more information on using the InputService3TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService3TestCaseOperation2Request method. -// req, resp := client.InputService3TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputService3TestCaseOperation2Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation2Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService3TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService3TestCaseOperation2 for usage and error information. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputService3TestCaseOperation2Input) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { - req, out := c.InputService3TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService3TestCaseOperation2WithContext is the same as InputService3TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService3TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2WithContext(ctx aws.Context, input *InputService3TestShapeInputService3TestCaseOperation2Input, opts ...request.Option) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { - req, out := c.InputService3TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService3TestShapeInputService3TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Description *string `type:"string"` - - SubStructure *InputService3TestShapeSubStructure `type:"structure"` -} - -// SetDescription sets the Description field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation1Input) SetDescription(v string) *InputService3TestShapeInputService3TestCaseOperation1Input { - s.Description = &v - return s -} - -// SetSubStructure sets the SubStructure field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation1Input) SetSubStructure(v *InputService3TestShapeSubStructure) *InputService3TestShapeInputService3TestCaseOperation1Input { - s.SubStructure = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService3TestShapeInputService3TestCaseOperation2Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Description *string `type:"string"` - - SubStructure *InputService3TestShapeSubStructure `type:"structure"` -} - -// SetDescription sets the Description field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation2Input) SetDescription(v string) *InputService3TestShapeInputService3TestCaseOperation2Input { - s.Description = &v - return s -} - -// SetSubStructure sets the SubStructure field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation2Input) SetSubStructure(v *InputService3TestShapeSubStructure) *InputService3TestShapeInputService3TestCaseOperation2Input { - s.SubStructure = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService3TestShapeSubStructure struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService3TestShapeSubStructure) SetBar(v string) *InputService3TestShapeSubStructure { - s.Bar = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService3TestShapeSubStructure) SetFoo(v string) *InputService3TestShapeSubStructure { - s.Foo = &v - return s -} - -// InputService4ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService4ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService4ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService4ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService4ProtocolTest client from just a session. -// svc := inputservice4protocoltest.New(mySession) -// -// // Create a InputService4ProtocolTest client with additional configuration -// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest { - c := p.ClientConfig("inputservice4protocoltest", cfgs...) - return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService4ProtocolTest", - ServiceID: "InputService4ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService4ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService4TestCaseOperation1 = "OperationName" - -// InputService4TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService4TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService4TestCaseOperation1 for more information on using the InputService4TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService4TestCaseOperation1Request method. -// req, resp := client.InputService4TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService4TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation1Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService4TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService4TestCaseOperation1 for usage and error information. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { - req, out := c.InputService4TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService4TestCaseOperation1WithContext is the same as InputService4TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService4TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1WithContext(ctx aws.Context, input *InputService4TestShapeInputService4TestCaseOperation1Input, opts ...request.Option) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { - req, out := c.InputService4TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService4TestShapeInputService4TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Description *string `type:"string"` - - SubStructure *InputService4TestShapeSubStructure `type:"structure"` -} - -// SetDescription sets the Description field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetDescription(v string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.Description = &v - return s -} - -// SetSubStructure sets the SubStructure field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetSubStructure(v *InputService4TestShapeSubStructure) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.SubStructure = v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService4TestShapeSubStructure struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService4TestShapeSubStructure) SetBar(v string) *InputService4TestShapeSubStructure { - s.Bar = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService4TestShapeSubStructure) SetFoo(v string) *InputService4TestShapeSubStructure { - s.Foo = &v - return s -} - -// InputService5ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService5ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService5ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService5ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService5ProtocolTest client from just a session. -// svc := inputservice5protocoltest.New(mySession) -// -// // Create a InputService5ProtocolTest client with additional configuration -// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest { - c := p.ClientConfig("inputservice5protocoltest", cfgs...) - return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService5ProtocolTest", - ServiceID: "InputService5ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService5ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService5TestCaseOperation1 = "OperationName" - -// InputService5TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService5TestCaseOperation1 for more information on using the InputService5TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService5TestCaseOperation1Request method. -// req, resp := client.InputService5TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation1Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService5TestCaseOperation1 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { - req, out := c.InputService5TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation1WithContext is the same as InputService5TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation1Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { - req, out := c.InputService5TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService5TestShapeInputService5TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - ListParam []*string `type:"list"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation1Input) SetListParam(v []*string) *InputService5TestShapeInputService5TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService6ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService6ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService6ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService6ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService6ProtocolTest client from just a session. -// svc := inputservice6protocoltest.New(mySession) -// -// // Create a InputService6ProtocolTest client with additional configuration -// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest { - c := p.ClientConfig("inputservice6protocoltest", cfgs...) - return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService6ProtocolTest", - ServiceID: "InputService6ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService6ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService6TestCaseOperation1 = "OperationName" - -// InputService6TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService6TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService6TestCaseOperation1 for more information on using the InputService6TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService6TestCaseOperation1Request method. -// req, resp := client.InputService6TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService6TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService6TestShapeInputService6TestCaseOperation1Input{} - } - - output = &InputService6TestShapeInputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService6TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService6TestCaseOperation1 for usage and error information. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { - req, out := c.InputService6TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService6TestCaseOperation1WithContext is the same as InputService6TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService6TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1WithContext(ctx aws.Context, input *InputService6TestShapeInputService6TestCaseOperation1Input, opts ...request.Option) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { - req, out := c.InputService6TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService6TestShapeInputService6TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - ListParam []*string `locationName:"AlternateName" locationNameList:"NotMember" type:"list"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService6TestShapeInputService6TestCaseOperation1Input) SetListParam(v []*string) *InputService6TestShapeInputService6TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService7ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService7ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService7ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService7ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService7ProtocolTest client from just a session. -// svc := inputservice7protocoltest.New(mySession) -// -// // Create a InputService7ProtocolTest client with additional configuration -// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest { - c := p.ClientConfig("inputservice7protocoltest", cfgs...) - return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService7ProtocolTest", - ServiceID: "InputService7ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService7ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService7TestCaseOperation1 = "OperationName" - -// InputService7TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService7TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService7TestCaseOperation1 for more information on using the InputService7TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService7TestCaseOperation1Request method. -// req, resp := client.InputService7TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation1Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService7TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService7TestCaseOperation1 for usage and error information. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService7TestCaseOperation1WithContext is the same as InputService7TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService7TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1WithContext(ctx aws.Context, input *InputService7TestShapeInputService7TestCaseOperation1Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService7TestShapeInputService7TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - ListParam []*string `type:"list" flattened:"true"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation1Input) SetListParam(v []*string) *InputService7TestShapeInputService7TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService8ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService8ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService8ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService8ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService8ProtocolTest client from just a session. -// svc := inputservice8protocoltest.New(mySession) -// -// // Create a InputService8ProtocolTest client with additional configuration -// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest { - c := p.ClientConfig("inputservice8protocoltest", cfgs...) - return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService8ProtocolTest", - ServiceID: "InputService8ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService8ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService8TestCaseOperation1 = "OperationName" - -// InputService8TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService8TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService8TestCaseOperation1 for more information on using the InputService8TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService8TestCaseOperation1Request method. -// req, resp := client.InputService8TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService8TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService8TestShapeInputService8TestCaseOperation1Input{} - } - - output = &InputService8TestShapeInputService8TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService8TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService8TestCaseOperation1 for usage and error information. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { - req, out := c.InputService8TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService8TestCaseOperation1WithContext is the same as InputService8TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService8TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1WithContext(ctx aws.Context, input *InputService8TestShapeInputService8TestCaseOperation1Input, opts ...request.Option) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { - req, out := c.InputService8TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService8TestShapeInputService8TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - ListParam []*string `locationName:"item" type:"list" flattened:"true"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetListParam(v []*string) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService9ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService9ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService9ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService9ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService9ProtocolTest client from just a session. -// svc := inputservice9protocoltest.New(mySession) -// -// // Create a InputService9ProtocolTest client with additional configuration -// svc := inputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService9ProtocolTest { - c := p.ClientConfig("inputservice9protocoltest", cfgs...) - return newInputService9ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService9ProtocolTest", - ServiceID: "InputService9ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService9ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService9TestCaseOperation1 = "OperationName" - -// InputService9TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService9TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService9TestCaseOperation1 for more information on using the InputService9TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService9TestCaseOperation1Request method. -// req, resp := client.InputService9TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputService9TestCaseOperation1Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService9TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService9TestShapeInputService9TestCaseOperation1Input{} - } - - output = &InputService9TestShapeInputService9TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService9TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService9TestCaseOperation1 for usage and error information. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputService9TestCaseOperation1Input) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { - req, out := c.InputService9TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService9TestCaseOperation1WithContext is the same as InputService9TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService9TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1WithContext(ctx aws.Context, input *InputService9TestShapeInputService9TestCaseOperation1Input, opts ...request.Option) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { - req, out := c.InputService9TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService9TestShapeInputService9TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - ListParam []*InputService9TestShapeSingleFieldStruct `locationName:"item" type:"list" flattened:"true"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetListParam(v []*InputService9TestShapeSingleFieldStruct) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService9TestShapeInputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService9TestShapeSingleFieldStruct struct { - _ struct{} `type:"structure"` - - Element *string `locationName:"value" type:"string"` -} - -// SetElement sets the Element field's value. -func (s *InputService9TestShapeSingleFieldStruct) SetElement(v string) *InputService9TestShapeSingleFieldStruct { - s.Element = &v - return s -} - -// InputService10ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService10ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService10ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService10ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService10ProtocolTest client from just a session. -// svc := inputservice10protocoltest.New(mySession) -// -// // Create a InputService10ProtocolTest client with additional configuration -// svc := inputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService10ProtocolTest { - c := p.ClientConfig("inputservice10protocoltest", cfgs...) - return newInputService10ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService10ProtocolTest { - svc := &InputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService10ProtocolTest", - ServiceID: "InputService10ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService10ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService10TestCaseOperation1 = "OperationName" - -// InputService10TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService10TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService10TestCaseOperation1 for more information on using the InputService10TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService10TestCaseOperation1Request method. -// req, resp := client.InputService10TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation1Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService10TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService10TestShapeInputService10TestCaseOperation1Input{} - } - - output = &InputService10TestShapeInputService10TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService10TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService10TestCaseOperation1 for usage and error information. -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation1Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) { - req, out := c.InputService10TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService10TestCaseOperation1WithContext is the same as InputService10TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService10TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService10ProtocolTest) InputService10TestCaseOperation1WithContext(ctx aws.Context, input *InputService10TestShapeInputService10TestCaseOperation1Input, opts ...request.Option) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) { - req, out := c.InputService10TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService10TestShapeInputService10TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - StructureParam *InputService10TestShapeStructureShape `type:"structure"` -} - -// SetStructureParam sets the StructureParam field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetStructureParam(v *InputService10TestShapeStructureShape) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.StructureParam = v - return s -} - -type InputService10TestShapeInputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService10TestShapeStructureShape struct { - _ struct{} `type:"structure"` - - // B is automatically base64 encoded/decoded by the SDK. - B []byte `locationName:"b" type:"blob"` -} - -// SetB sets the B field's value. -func (s *InputService10TestShapeStructureShape) SetB(v []byte) *InputService10TestShapeStructureShape { - s.B = v - return s -} - -// InputService11ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService11ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService11ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService11ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService11ProtocolTest client from just a session. -// svc := inputservice11protocoltest.New(mySession) -// -// // Create a InputService11ProtocolTest client with additional configuration -// svc := inputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService11ProtocolTest { - c := p.ClientConfig("inputservice11protocoltest", cfgs...) - return newInputService11ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService11ProtocolTest { - svc := &InputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService11ProtocolTest", - ServiceID: "InputService11ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService11ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService11TestCaseOperation1 = "OperationName" - -// InputService11TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService11TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService11TestCaseOperation1 for more information on using the InputService11TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService11TestCaseOperation1Request method. -// req, resp := client.InputService11TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(input *InputService11TestShapeInputService11TestCaseOperation1Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService11TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService11TestShapeInputService11TestCaseOperation1Input{} - } - - output = &InputService11TestShapeInputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService11TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService11TestCaseOperation1 for usage and error information. -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1(input *InputService11TestShapeInputService11TestCaseOperation1Input) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) { - req, out := c.InputService11TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService11TestCaseOperation1WithContext is the same as InputService11TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService11TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService11ProtocolTest) InputService11TestCaseOperation1WithContext(ctx aws.Context, input *InputService11TestShapeInputService11TestCaseOperation1Input, opts ...request.Option) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) { - req, out := c.InputService11TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService11TestShapeInputService11TestCaseOperation1Input struct { - _ struct{} `locationName:"TimestampStructure" type:"structure" xmlURI:"https://foo/"` - - TimeArg *time.Time `type:"timestamp"` - - TimeArgInHeader *time.Time `location:"header" locationName:"x-amz-timearg" type:"timestamp"` - - TimeArgInQuery *time.Time `location:"querystring" locationName:"TimeQuery" type:"timestamp"` - - TimeCustom *time.Time `type:"timestamp" timestampFormat:"rfc822"` - - TimeCustomInHeader *time.Time `location:"header" locationName:"x-amz-timecustom-header" type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeCustomInQuery *time.Time `location:"querystring" locationName:"TimeCustomQuery" type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeFormat *time.Time `type:"timestamp" timestampFormat:"rfc822"` - - TimeFormatInHeader *time.Time `location:"header" locationName:"x-amz-timeformat-header" type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeFormatInQuery *time.Time `location:"querystring" locationName:"TimeFormatQuery" type:"timestamp" timestampFormat:"unixTimestamp"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -// SetTimeArgInHeader sets the TimeArgInHeader field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeArgInHeader(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeArgInHeader = &v - return s -} - -// SetTimeArgInQuery sets the TimeArgInQuery field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeArgInQuery(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeArgInQuery = &v - return s -} - -// SetTimeCustom sets the TimeCustom field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeCustom(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeCustom = &v - return s -} - -// SetTimeCustomInHeader sets the TimeCustomInHeader field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeCustomInHeader(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeCustomInHeader = &v - return s -} - -// SetTimeCustomInQuery sets the TimeCustomInQuery field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeCustomInQuery(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeCustomInQuery = &v - return s -} - -// SetTimeFormat sets the TimeFormat field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeFormat(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeFormat = &v - return s -} - -// SetTimeFormatInHeader sets the TimeFormatInHeader field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeFormatInHeader(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeFormatInHeader = &v - return s -} - -// SetTimeFormatInQuery sets the TimeFormatInQuery field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeFormatInQuery(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeFormatInQuery = &v - return s -} - -type InputService11TestShapeInputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService12ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService12ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService12ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService12ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService12ProtocolTest client from just a session. -// svc := inputservice12protocoltest.New(mySession) -// -// // Create a InputService12ProtocolTest client with additional configuration -// svc := inputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService12ProtocolTest { - c := p.ClientConfig("inputservice12protocoltest", cfgs...) - return newInputService12ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService12ProtocolTest { - svc := &InputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService12ProtocolTest", - ServiceID: "InputService12ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService12ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService12TestCaseOperation1 = "OperationName" - -// InputService12TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService12TestCaseOperation1 for more information on using the InputService12TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService12TestCaseOperation1Request method. -// req, resp := client.InputService12TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(input *InputService12TestShapeInputService12TestCaseOperation1Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation1Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService12TestCaseOperation1 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1(input *InputService12TestShapeInputService12TestCaseOperation1Input) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { - req, out := c.InputService12TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation1WithContext is the same as InputService12TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation1WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation1Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { - req, out := c.InputService12TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService12TestShapeInputService12TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - Foo map[string]*string `location:"headers" locationName:"x-foo-" type:"map"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetFoo(v map[string]*string) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.Foo = v - return s -} - -type InputService12TestShapeInputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService13ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService13ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService13ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService13ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService13ProtocolTest client from just a session. -// svc := inputservice13protocoltest.New(mySession) -// -// // Create a InputService13ProtocolTest client with additional configuration -// svc := inputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService13ProtocolTest { - c := p.ClientConfig("inputservice13protocoltest", cfgs...) - return newInputService13ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService13ProtocolTest { - svc := &InputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService13ProtocolTest", - ServiceID: "InputService13ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService13ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService13TestCaseOperation1 = "OperationName" - -// InputService13TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService13TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService13TestCaseOperation1 for more information on using the InputService13TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService13TestCaseOperation1Request method. -// req, resp := client.InputService13TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1Request(input *InputService13TestShapeInputService13TestCaseOperation1Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation1Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService13TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService13TestCaseOperation1 for usage and error information. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1(input *InputService13TestShapeInputService13TestCaseOperation1Input) (*InputService13TestShapeInputService13TestCaseOperation1Output, error) { - req, out := c.InputService13TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService13TestCaseOperation1WithContext is the same as InputService13TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService13TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService13ProtocolTest) InputService13TestCaseOperation1WithContext(ctx aws.Context, input *InputService13TestShapeInputService13TestCaseOperation1Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation1Output, error) { - req, out := c.InputService13TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService13TestShapeInputService13TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Items []*string `location:"querystring" locationName:"item" type:"list"` -} - -// SetItems sets the Items field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation1Input) SetItems(v []*string) *InputService13TestShapeInputService13TestCaseOperation1Input { - s.Items = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService14ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService14ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService14ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService14ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService14ProtocolTest client from just a session. -// svc := inputservice14protocoltest.New(mySession) -// -// // Create a InputService14ProtocolTest client with additional configuration -// svc := inputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService14ProtocolTest { - c := p.ClientConfig("inputservice14protocoltest", cfgs...) - return newInputService14ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService14ProtocolTest { - svc := &InputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService14ProtocolTest", - ServiceID: "InputService14ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService14ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService14TestCaseOperation1 = "OperationName" - -// InputService14TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService14TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService14TestCaseOperation1 for more information on using the InputService14TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService14TestCaseOperation1Request method. -// req, resp := client.InputService14TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1Request(input *InputService14TestShapeInputService14TestCaseOperation1Input) (req *request.Request, output *InputService14TestShapeInputService14TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService14TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService14TestShapeInputService14TestCaseOperation1Input{} - } - - output = &InputService14TestShapeInputService14TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService14TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService14TestCaseOperation1 for usage and error information. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1(input *InputService14TestShapeInputService14TestCaseOperation1Input) (*InputService14TestShapeInputService14TestCaseOperation1Output, error) { - req, out := c.InputService14TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService14TestCaseOperation1WithContext is the same as InputService14TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService14TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService14ProtocolTest) InputService14TestCaseOperation1WithContext(ctx aws.Context, input *InputService14TestShapeInputService14TestCaseOperation1Input, opts ...request.Option) (*InputService14TestShapeInputService14TestCaseOperation1Output, error) { - req, out := c.InputService14TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService14TestShapeInputService14TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - // PipelineId is a required field - PipelineId *string `location:"uri" type:"string" required:"true"` - - QueryDoc map[string]*string `location:"querystring" type:"map"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService14TestShapeInputService14TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService14TestShapeInputService14TestCaseOperation1Input"} - if s.PipelineId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineId")) - } - if s.PipelineId != nil && len(*s.PipelineId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService14TestShapeInputService14TestCaseOperation1Input) SetPipelineId(v string) *InputService14TestShapeInputService14TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -// SetQueryDoc sets the QueryDoc field's value. -func (s *InputService14TestShapeInputService14TestCaseOperation1Input) SetQueryDoc(v map[string]*string) *InputService14TestShapeInputService14TestCaseOperation1Input { - s.QueryDoc = v - return s -} - -type InputService14TestShapeInputService14TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService15ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService15ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService15ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService15ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService15ProtocolTest client from just a session. -// svc := inputservice15protocoltest.New(mySession) -// -// // Create a InputService15ProtocolTest client with additional configuration -// svc := inputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService15ProtocolTest { - c := p.ClientConfig("inputservice15protocoltest", cfgs...) - return newInputService15ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService15ProtocolTest { - svc := &InputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService15ProtocolTest", - ServiceID: "InputService15ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService15ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService15TestCaseOperation1 = "OperationName" - -// InputService15TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService15TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService15TestCaseOperation1 for more information on using the InputService15TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService15TestCaseOperation1Request method. -// req, resp := client.InputService15TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1Request(input *InputService15TestShapeInputService15TestCaseOperation1Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation1Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService15TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService15TestCaseOperation1 for usage and error information. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1(input *InputService15TestShapeInputService15TestCaseOperation1Input) (*InputService15TestShapeInputService15TestCaseOperation1Output, error) { - req, out := c.InputService15TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService15TestCaseOperation1WithContext is the same as InputService15TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService15TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService15ProtocolTest) InputService15TestCaseOperation1WithContext(ctx aws.Context, input *InputService15TestShapeInputService15TestCaseOperation1Input, opts ...request.Option) (*InputService15TestShapeInputService15TestCaseOperation1Output, error) { - req, out := c.InputService15TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService15TestShapeInputService15TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - // PipelineId is a required field - PipelineId *string `location:"uri" type:"string" required:"true"` - - QueryDoc map[string][]*string `location:"querystring" type:"map"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService15TestShapeInputService15TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService15TestShapeInputService15TestCaseOperation1Input"} - if s.PipelineId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineId")) - } - if s.PipelineId != nil && len(*s.PipelineId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation1Input) SetPipelineId(v string) *InputService15TestShapeInputService15TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -// SetQueryDoc sets the QueryDoc field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation1Input) SetQueryDoc(v map[string][]*string) *InputService15TestShapeInputService15TestCaseOperation1Input { - s.QueryDoc = v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService16ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService16ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService16ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService16ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService16ProtocolTest client from just a session. -// svc := inputservice16protocoltest.New(mySession) -// -// // Create a InputService16ProtocolTest client with additional configuration -// svc := inputservice16protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService16ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService16ProtocolTest { - c := p.ClientConfig("inputservice16protocoltest", cfgs...) - return newInputService16ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService16ProtocolTest { - svc := &InputService16ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService16ProtocolTest", - ServiceID: "InputService16ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService16ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService16ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService16TestCaseOperation1 = "OperationName" - -// InputService16TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService16TestCaseOperation1 for more information on using the InputService16TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService16TestCaseOperation1Request method. -// req, resp := client.InputService16TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1Request(input *InputService16TestShapeInputService16TestCaseOperation1Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation1Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService16TestCaseOperation1 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1(input *InputService16TestShapeInputService16TestCaseOperation1Input) (*InputService16TestShapeInputService16TestCaseOperation1Output, error) { - req, out := c.InputService16TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation1WithContext is the same as InputService16TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation1WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation1Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation1Output, error) { - req, out := c.InputService16TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService16TestCaseOperation2 = "OperationName" - -// InputService16TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService16TestCaseOperation2 for more information on using the InputService16TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService16TestCaseOperation2Request method. -// req, resp := client.InputService16TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation2, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService16TestCaseOperation2 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation2Output, error) { - req, out := c.InputService16TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation2WithContext is the same as InputService16TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation2WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation2Output, error) { - req, out := c.InputService16TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService16TestShapeInputService16TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - BoolQuery *bool `location:"querystring" locationName:"bool-query" type:"boolean"` -} - -// SetBoolQuery sets the BoolQuery field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation1Input) SetBoolQuery(v bool) *InputService16TestShapeInputService16TestCaseOperation1Input { - s.BoolQuery = &v - return s -} - -type InputService16TestShapeInputService16TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - BoolQuery *bool `location:"querystring" locationName:"bool-query" type:"boolean"` -} - -// SetBoolQuery sets the BoolQuery field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation2Input) SetBoolQuery(v bool) *InputService16TestShapeInputService16TestCaseOperation2Input { - s.BoolQuery = &v - return s -} - -type InputService16TestShapeInputService16TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService17ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService17ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService17ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService17ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService17ProtocolTest client from just a session. -// svc := inputservice17protocoltest.New(mySession) -// -// // Create a InputService17ProtocolTest client with additional configuration -// svc := inputservice17protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService17ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService17ProtocolTest { - c := p.ClientConfig("inputservice17protocoltest", cfgs...) - return newInputService17ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService17ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService17ProtocolTest { - svc := &InputService17ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService17ProtocolTest", - ServiceID: "InputService17ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService17ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService17ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService17TestCaseOperation1 = "OperationName" - -// InputService17TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService17TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService17TestCaseOperation1 for more information on using the InputService17TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService17TestCaseOperation1Request method. -// req, resp := client.InputService17TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService17ProtocolTest) InputService17TestCaseOperation1Request(input *InputService17TestShapeInputService17TestCaseOperation1Input) (req *request.Request, output *InputService17TestShapeInputService17TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService17TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService17TestShapeInputService17TestCaseOperation1Input{} - } - - output = &InputService17TestShapeInputService17TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService17TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService17TestCaseOperation1 for usage and error information. -func (c *InputService17ProtocolTest) InputService17TestCaseOperation1(input *InputService17TestShapeInputService17TestCaseOperation1Input) (*InputService17TestShapeInputService17TestCaseOperation1Output, error) { - req, out := c.InputService17TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService17TestCaseOperation1WithContext is the same as InputService17TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService17TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService17ProtocolTest) InputService17TestCaseOperation1WithContext(ctx aws.Context, input *InputService17TestShapeInputService17TestCaseOperation1Input, opts ...request.Option) (*InputService17TestShapeInputService17TestCaseOperation1Output, error) { - req, out := c.InputService17TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService17TestShapeInputService17TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService17TestShapeInputService17TestCaseOperation1Input) SetFoo(v string) *InputService17TestShapeInputService17TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService17TestShapeInputService17TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService18ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService18ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService18ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService18ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService18ProtocolTest client from just a session. -// svc := inputservice18protocoltest.New(mySession) -// -// // Create a InputService18ProtocolTest client with additional configuration -// svc := inputservice18protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService18ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService18ProtocolTest { - c := p.ClientConfig("inputservice18protocoltest", cfgs...) - return newInputService18ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService18ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService18ProtocolTest { - svc := &InputService18ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService18ProtocolTest", - ServiceID: "InputService18ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService18ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService18ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService18TestCaseOperation1 = "OperationName" - -// InputService18TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService18TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService18TestCaseOperation1 for more information on using the InputService18TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService18TestCaseOperation1Request method. -// req, resp := client.InputService18TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService18ProtocolTest) InputService18TestCaseOperation1Request(input *InputService18TestShapeInputService18TestCaseOperation1Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation1Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService18TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService18TestCaseOperation1 for usage and error information. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation1(input *InputService18TestShapeInputService18TestCaseOperation1Input) (*InputService18TestShapeInputService18TestCaseOperation1Output, error) { - req, out := c.InputService18TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService18TestCaseOperation1WithContext is the same as InputService18TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService18TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation1WithContext(ctx aws.Context, input *InputService18TestShapeInputService18TestCaseOperation1Input, opts ...request.Option) (*InputService18TestShapeInputService18TestCaseOperation1Output, error) { - req, out := c.InputService18TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService18TestCaseOperation2 = "OperationName" - -// InputService18TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService18TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService18TestCaseOperation2 for more information on using the InputService18TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService18TestCaseOperation2Request method. -// req, resp := client.InputService18TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService18ProtocolTest) InputService18TestCaseOperation2Request(input *InputService18TestShapeInputService18TestCaseOperation2Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation2Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService18TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService18TestCaseOperation2 for usage and error information. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation2(input *InputService18TestShapeInputService18TestCaseOperation2Input) (*InputService18TestShapeInputService18TestCaseOperation2Output, error) { - req, out := c.InputService18TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService18TestCaseOperation2WithContext is the same as InputService18TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService18TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation2WithContext(ctx aws.Context, input *InputService18TestShapeInputService18TestCaseOperation2Input, opts ...request.Option) (*InputService18TestShapeInputService18TestCaseOperation2Output, error) { - req, out := c.InputService18TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService18TestShapeInputService18TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService18TestShapeInputService18TestCaseOperation1Input) SetFoo(v []byte) *InputService18TestShapeInputService18TestCaseOperation1Input { - s.Foo = v - return s -} - -type InputService18TestShapeInputService18TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService18TestShapeInputService18TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService18TestShapeInputService18TestCaseOperation2Input) SetFoo(v []byte) *InputService18TestShapeInputService18TestCaseOperation2Input { - s.Foo = v - return s -} - -type InputService18TestShapeInputService18TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService19ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService19ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService19ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService19ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService19ProtocolTest client from just a session. -// svc := inputservice19protocoltest.New(mySession) -// -// // Create a InputService19ProtocolTest client with additional configuration -// svc := inputservice19protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService19ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService19ProtocolTest { - c := p.ClientConfig("inputservice19protocoltest", cfgs...) - return newInputService19ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService19ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService19ProtocolTest { - svc := &InputService19ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService19ProtocolTest", - ServiceID: "InputService19ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService19ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService19ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService19TestCaseOperation1 = "OperationName" - -// InputService19TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService19TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService19TestCaseOperation1 for more information on using the InputService19TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService19TestCaseOperation1Request method. -// req, resp := client.InputService19TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService19ProtocolTest) InputService19TestCaseOperation1Request(input *InputService19TestShapeInputService19TestCaseOperation1Input) (req *request.Request, output *InputService19TestShapeInputService19TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService19TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService19TestShapeInputService19TestCaseOperation1Input{} - } - - output = &InputService19TestShapeInputService19TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService19TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService19TestCaseOperation1 for usage and error information. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation1(input *InputService19TestShapeInputService19TestCaseOperation1Input) (*InputService19TestShapeInputService19TestCaseOperation1Output, error) { - req, out := c.InputService19TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService19TestCaseOperation1WithContext is the same as InputService19TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService19TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation1WithContext(ctx aws.Context, input *InputService19TestShapeInputService19TestCaseOperation1Input, opts ...request.Option) (*InputService19TestShapeInputService19TestCaseOperation1Output, error) { - req, out := c.InputService19TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService19TestCaseOperation2 = "OperationName" - -// InputService19TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService19TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService19TestCaseOperation2 for more information on using the InputService19TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService19TestCaseOperation2Request method. -// req, resp := client.InputService19TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService19ProtocolTest) InputService19TestCaseOperation2Request(input *InputService19TestShapeInputService19TestCaseOperation2Input) (req *request.Request, output *InputService19TestShapeInputService19TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService19TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService19TestShapeInputService19TestCaseOperation2Input{} - } - - output = &InputService19TestShapeInputService19TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService19TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService19TestCaseOperation2 for usage and error information. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation2(input *InputService19TestShapeInputService19TestCaseOperation2Input) (*InputService19TestShapeInputService19TestCaseOperation2Output, error) { - req, out := c.InputService19TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService19TestCaseOperation2WithContext is the same as InputService19TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService19TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation2WithContext(ctx aws.Context, input *InputService19TestShapeInputService19TestCaseOperation2Input, opts ...request.Option) (*InputService19TestShapeInputService19TestCaseOperation2Output, error) { - req, out := c.InputService19TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService19TestCaseOperation3 = "OperationName" - -// InputService19TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService19TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService19TestCaseOperation3 for more information on using the InputService19TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService19TestCaseOperation3Request method. -// req, resp := client.InputService19TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService19ProtocolTest) InputService19TestCaseOperation3Request(input *InputService19TestShapeInputService19TestCaseOperation3Input) (req *request.Request, output *InputService19TestShapeInputService19TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService19TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService19TestShapeInputService19TestCaseOperation3Input{} - } - - output = &InputService19TestShapeInputService19TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService19TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService19TestCaseOperation3 for usage and error information. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation3(input *InputService19TestShapeInputService19TestCaseOperation3Input) (*InputService19TestShapeInputService19TestCaseOperation3Output, error) { - req, out := c.InputService19TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService19TestCaseOperation3WithContext is the same as InputService19TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService19TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation3WithContext(ctx aws.Context, input *InputService19TestShapeInputService19TestCaseOperation3Input, opts ...request.Option) (*InputService19TestShapeInputService19TestCaseOperation3Output, error) { - req, out := c.InputService19TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService19TestCaseOperation4 = "OperationName" - -// InputService19TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService19TestCaseOperation4 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService19TestCaseOperation4 for more information on using the InputService19TestCaseOperation4 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService19TestCaseOperation4Request method. -// req, resp := client.InputService19TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService19ProtocolTest) InputService19TestCaseOperation4Request(input *InputService19TestShapeInputService19TestCaseOperation4Input) (req *request.Request, output *InputService19TestShapeInputService19TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService19TestCaseOperation4, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService19TestShapeInputService19TestCaseOperation4Input{} - } - - output = &InputService19TestShapeInputService19TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService19TestCaseOperation4 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService19TestCaseOperation4 for usage and error information. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation4(input *InputService19TestShapeInputService19TestCaseOperation4Input) (*InputService19TestShapeInputService19TestCaseOperation4Output, error) { - req, out := c.InputService19TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService19TestCaseOperation4WithContext is the same as InputService19TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService19TestCaseOperation4 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService19ProtocolTest) InputService19TestCaseOperation4WithContext(ctx aws.Context, input *InputService19TestShapeInputService19TestCaseOperation4Input, opts ...request.Option) (*InputService19TestShapeInputService19TestCaseOperation4Output, error) { - req, out := c.InputService19TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService19TestShapeFooShape struct { - _ struct{} `locationName:"foo" type:"structure"` - - Baz *string `locationName:"baz" type:"string"` -} - -// SetBaz sets the Baz field's value. -func (s *InputService19TestShapeFooShape) SetBaz(v string) *InputService19TestShapeFooShape { - s.Baz = &v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo *InputService19TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation1Input) SetFoo(v *InputService19TestShapeFooShape) *InputService19TestShapeInputService19TestCaseOperation1Input { - s.Foo = v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService19TestShapeInputService19TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo *InputService19TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation2Input) SetFoo(v *InputService19TestShapeFooShape) *InputService19TestShapeInputService19TestCaseOperation2Input { - s.Foo = v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService19TestShapeInputService19TestCaseOperation3Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo *InputService19TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation3Input) SetFoo(v *InputService19TestShapeFooShape) *InputService19TestShapeInputService19TestCaseOperation3Input { - s.Foo = v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService19TestShapeInputService19TestCaseOperation4Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Foo"` - - Foo *InputService19TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation4Input) SetFoo(v *InputService19TestShapeFooShape) *InputService19TestShapeInputService19TestCaseOperation4Input { - s.Foo = v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -// InputService20ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService20ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService20ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService20ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService20ProtocolTest client from just a session. -// svc := inputservice20protocoltest.New(mySession) -// -// // Create a InputService20ProtocolTest client with additional configuration -// svc := inputservice20protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService20ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService20ProtocolTest { - c := p.ClientConfig("inputservice20protocoltest", cfgs...) - return newInputService20ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService20ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService20ProtocolTest { - svc := &InputService20ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService20ProtocolTest", - ServiceID: "InputService20ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService20ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService20ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService20TestCaseOperation1 = "OperationName" - -// InputService20TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService20TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService20TestCaseOperation1 for more information on using the InputService20TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService20TestCaseOperation1Request method. -// req, resp := client.InputService20TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService20ProtocolTest) InputService20TestCaseOperation1Request(input *InputService20TestShapeInputService20TestCaseOperation1Input) (req *request.Request, output *InputService20TestShapeInputService20TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService20TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService20TestShapeInputService20TestCaseOperation1Input{} - } - - output = &InputService20TestShapeInputService20TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService20TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService20TestCaseOperation1 for usage and error information. -func (c *InputService20ProtocolTest) InputService20TestCaseOperation1(input *InputService20TestShapeInputService20TestCaseOperation1Input) (*InputService20TestShapeInputService20TestCaseOperation1Output, error) { - req, out := c.InputService20TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService20TestCaseOperation1WithContext is the same as InputService20TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService20TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService20ProtocolTest) InputService20TestCaseOperation1WithContext(ctx aws.Context, input *InputService20TestShapeInputService20TestCaseOperation1Input, opts ...request.Option) (*InputService20TestShapeInputService20TestCaseOperation1Output, error) { - req, out := c.InputService20TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService20TestShapeGrant struct { - _ struct{} `locationName:"Grant" type:"structure"` - - Grantee *InputService20TestShapeGrantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` -} - -// SetGrantee sets the Grantee field's value. -func (s *InputService20TestShapeGrant) SetGrantee(v *InputService20TestShapeGrantee) *InputService20TestShapeGrant { - s.Grantee = v - return s -} - -type InputService20TestShapeGrantee struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - EmailAddress *string `type:"string"` - - Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true"` -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *InputService20TestShapeGrantee) SetEmailAddress(v string) *InputService20TestShapeGrantee { - s.EmailAddress = &v - return s -} - -// SetType sets the Type field's value. -func (s *InputService20TestShapeGrantee) SetType(v string) *InputService20TestShapeGrantee { - s.Type = &v - return s -} - -type InputService20TestShapeInputService20TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure" payload:"Grant"` - - Grant *InputService20TestShapeGrant `locationName:"Grant" type:"structure"` -} - -// SetGrant sets the Grant field's value. -func (s *InputService20TestShapeInputService20TestCaseOperation1Input) SetGrant(v *InputService20TestShapeGrant) *InputService20TestShapeInputService20TestCaseOperation1Input { - s.Grant = v - return s -} - -type InputService20TestShapeInputService20TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService21ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService21ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService21ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService21ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService21ProtocolTest client from just a session. -// svc := inputservice21protocoltest.New(mySession) -// -// // Create a InputService21ProtocolTest client with additional configuration -// svc := inputservice21protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService21ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService21ProtocolTest { - c := p.ClientConfig("inputservice21protocoltest", cfgs...) - return newInputService21ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService21ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService21ProtocolTest { - svc := &InputService21ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService21ProtocolTest", - ServiceID: "InputService21ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService21ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService21ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService21TestCaseOperation1 = "OperationName" - -// InputService21TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService21TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService21TestCaseOperation1 for more information on using the InputService21TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService21TestCaseOperation1Request method. -// req, resp := client.InputService21TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService21ProtocolTest) InputService21TestCaseOperation1Request(input *InputService21TestShapeInputService21TestCaseOperation1Input) (req *request.Request, output *InputService21TestShapeInputService21TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService21TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &InputService21TestShapeInputService21TestCaseOperation1Input{} - } - - output = &InputService21TestShapeInputService21TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService21TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService21TestCaseOperation1 for usage and error information. -func (c *InputService21ProtocolTest) InputService21TestCaseOperation1(input *InputService21TestShapeInputService21TestCaseOperation1Input) (*InputService21TestShapeInputService21TestCaseOperation1Output, error) { - req, out := c.InputService21TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService21TestCaseOperation1WithContext is the same as InputService21TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService21TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService21ProtocolTest) InputService21TestCaseOperation1WithContext(ctx aws.Context, input *InputService21TestShapeInputService21TestCaseOperation1Input, opts ...request.Option) (*InputService21TestShapeInputService21TestCaseOperation1Output, error) { - req, out := c.InputService21TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService21TestShapeInputService21TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" type:"string" required:"true"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService21TestShapeInputService21TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService21TestShapeInputService21TestCaseOperation1Input"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *InputService21TestShapeInputService21TestCaseOperation1Input) SetBucket(v string) *InputService21TestShapeInputService21TestCaseOperation1Input { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *InputService21TestShapeInputService21TestCaseOperation1Input) SetKey(v string) *InputService21TestShapeInputService21TestCaseOperation1Input { - s.Key = &v - return s -} - -type InputService21TestShapeInputService21TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// InputService22ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService22ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService22ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService22ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService22ProtocolTest client from just a session. -// svc := inputservice22protocoltest.New(mySession) -// -// // Create a InputService22ProtocolTest client with additional configuration -// svc := inputservice22protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService22ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService22ProtocolTest { - c := p.ClientConfig("inputservice22protocoltest", cfgs...) - return newInputService22ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService22ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService22ProtocolTest { - svc := &InputService22ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService22ProtocolTest", - ServiceID: "InputService22ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService22ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService22ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService22TestCaseOperation1 = "OperationName" - -// InputService22TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService22TestCaseOperation1 for more information on using the InputService22TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService22TestCaseOperation1Request method. -// req, resp := client.InputService22TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation1Request(input *InputService22TestShapeInputService22TestCaseOperation1Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation1Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService22TestCaseOperation1 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation1(input *InputService22TestShapeInputService22TestCaseOperation1Input) (*InputService22TestShapeInputService22TestCaseOperation1Output, error) { - req, out := c.InputService22TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation1WithContext is the same as InputService22TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation1WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation1Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation1Output, error) { - req, out := c.InputService22TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService22TestCaseOperation2 = "OperationName" - -// InputService22TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService22TestCaseOperation2 for more information on using the InputService22TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService22TestCaseOperation2Request method. -// req, resp := client.InputService22TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation2Request(input *InputService22TestShapeInputService22TestCaseOperation2Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path?abc=mno", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation2Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService22TestCaseOperation2 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation2(input *InputService22TestShapeInputService22TestCaseOperation2Input) (*InputService22TestShapeInputService22TestCaseOperation2Output, error) { - req, out := c.InputService22TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation2WithContext is the same as InputService22TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation2WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation2Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation2Output, error) { - req, out := c.InputService22TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService22TestShapeInputService22TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Foo *string `location:"querystring" locationName:"param-name" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService22TestShapeInputService22TestCaseOperation1Input) SetFoo(v string) *InputService22TestShapeInputService22TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService22TestShapeInputService22TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Foo *string `location:"querystring" locationName:"param-name" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService22TestShapeInputService22TestCaseOperation2Input) SetFoo(v string) *InputService22TestShapeInputService22TestCaseOperation2Input { - s.Foo = &v - return s -} - -type InputService22TestShapeInputService22TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService23ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService23ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService23ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService23ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService23ProtocolTest client from just a session. -// svc := inputservice23protocoltest.New(mySession) -// -// // Create a InputService23ProtocolTest client with additional configuration -// svc := inputservice23protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService23ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService23ProtocolTest { - c := p.ClientConfig("inputservice23protocoltest", cfgs...) - return newInputService23ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService23ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService23ProtocolTest { - svc := &InputService23ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService23ProtocolTest", - ServiceID: "InputService23ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService23ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService23ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService23TestCaseOperation1 = "OperationName" - -// InputService23TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation1 for more information on using the InputService23TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation1Request method. -// req, resp := client.InputService23TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation1Request(input *InputService23TestShapeInputService23TestCaseOperation1Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation1Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation1 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation1(input *InputService23TestShapeInputService23TestCaseOperation1Input) (*InputService23TestShapeInputService23TestCaseOperation1Output, error) { - req, out := c.InputService23TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation1WithContext is the same as InputService23TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation1WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation1Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation1Output, error) { - req, out := c.InputService23TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService23TestCaseOperation2 = "OperationName" - -// InputService23TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation2 for more information on using the InputService23TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation2Request method. -// req, resp := client.InputService23TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation2Request(input *InputService23TestShapeInputService23TestCaseOperation2Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation2Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation2 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation2(input *InputService23TestShapeInputService23TestCaseOperation2Input) (*InputService23TestShapeInputService23TestCaseOperation2Output, error) { - req, out := c.InputService23TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation2WithContext is the same as InputService23TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation2WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation2Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation2Output, error) { - req, out := c.InputService23TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService23TestCaseOperation3 = "OperationName" - -// InputService23TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation3 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation3 for more information on using the InputService23TestCaseOperation3 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation3Request method. -// req, resp := client.InputService23TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation3Request(input *InputService23TestShapeInputService23TestCaseOperation3Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation3Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation3 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation3 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation3(input *InputService23TestShapeInputService23TestCaseOperation3Input) (*InputService23TestShapeInputService23TestCaseOperation3Output, error) { - req, out := c.InputService23TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation3WithContext is the same as InputService23TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation3 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation3WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation3Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation3Output, error) { - req, out := c.InputService23TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService23TestCaseOperation4 = "OperationName" - -// InputService23TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation4 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation4 for more information on using the InputService23TestCaseOperation4 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation4Request method. -// req, resp := client.InputService23TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation4Request(input *InputService23TestShapeInputService23TestCaseOperation4Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation4, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation4Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation4 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation4 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation4(input *InputService23TestShapeInputService23TestCaseOperation4Input) (*InputService23TestShapeInputService23TestCaseOperation4Output, error) { - req, out := c.InputService23TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation4WithContext is the same as InputService23TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation4 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation4WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation4Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation4Output, error) { - req, out := c.InputService23TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService23TestCaseOperation5 = "OperationName" - -// InputService23TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation5 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation5 for more information on using the InputService23TestCaseOperation5 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation5Request method. -// req, resp := client.InputService23TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation5Request(input *InputService23TestShapeInputService23TestCaseOperation5Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation5, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation5Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation5 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation5 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation5(input *InputService23TestShapeInputService23TestCaseOperation5Input) (*InputService23TestShapeInputService23TestCaseOperation5Output, error) { - req, out := c.InputService23TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation5WithContext is the same as InputService23TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation5 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation5WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation5Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation5Output, error) { - req, out := c.InputService23TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService23TestCaseOperation6 = "OperationName" - -// InputService23TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService23TestCaseOperation6 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService23TestCaseOperation6 for more information on using the InputService23TestCaseOperation6 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService23TestCaseOperation6Request method. -// req, resp := client.InputService23TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService23ProtocolTest) InputService23TestCaseOperation6Request(input *InputService23TestShapeInputService23TestCaseOperation6Input) (req *request.Request, output *InputService23TestShapeInputService23TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService23TestCaseOperation6, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService23TestShapeInputService23TestCaseOperation6Input{} - } - - output = &InputService23TestShapeInputService23TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService23TestCaseOperation6 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService23TestCaseOperation6 for usage and error information. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation6(input *InputService23TestShapeInputService23TestCaseOperation6Input) (*InputService23TestShapeInputService23TestCaseOperation6Output, error) { - req, out := c.InputService23TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService23TestCaseOperation6WithContext is the same as InputService23TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService23TestCaseOperation6 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService23ProtocolTest) InputService23TestCaseOperation6WithContext(ctx aws.Context, input *InputService23TestShapeInputService23TestCaseOperation6Input, opts ...request.Option) (*InputService23TestShapeInputService23TestCaseOperation6Output, error) { - req, out := c.InputService23TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService23TestShapeInputService23TestCaseOperation1Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation1Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation1Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeInputService23TestCaseOperation2Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation2Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation2Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeInputService23TestCaseOperation3Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation3Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation3Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeInputService23TestCaseOperation4Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation4Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation4Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeInputService23TestCaseOperation5Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation5Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation5Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeInputService23TestCaseOperation6Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation6Input) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeInputService23TestCaseOperation6Input { - s.RecursiveStruct = v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService23TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService23TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService23TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService23TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService23TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService23TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService23TestShapeRecursiveStructType) SetRecursiveList(v []*InputService23TestShapeRecursiveStructType) *InputService23TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService23TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService23TestShapeRecursiveStructType) *InputService23TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService23TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService23TestShapeRecursiveStructType) *InputService23TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// InputService24ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService24ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService24ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService24ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService24ProtocolTest client from just a session. -// svc := inputservice24protocoltest.New(mySession) -// -// // Create a InputService24ProtocolTest client with additional configuration -// svc := inputservice24protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService24ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService24ProtocolTest { - c := p.ClientConfig("inputservice24protocoltest", cfgs...) - return newInputService24ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService24ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService24ProtocolTest { - svc := &InputService24ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService24ProtocolTest", - ServiceID: "InputService24ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService24ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService24ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService24TestCaseOperation1 = "OperationName" - -// InputService24TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService24TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService24TestCaseOperation1 for more information on using the InputService24TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService24TestCaseOperation1Request method. -// req, resp := client.InputService24TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService24ProtocolTest) InputService24TestCaseOperation1Request(input *InputService24TestShapeInputService24TestCaseOperation1Input) (req *request.Request, output *InputService24TestShapeInputService24TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService24TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService24TestShapeInputService24TestCaseOperation1Input{} - } - - output = &InputService24TestShapeInputService24TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService24TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService24TestCaseOperation1 for usage and error information. -func (c *InputService24ProtocolTest) InputService24TestCaseOperation1(input *InputService24TestShapeInputService24TestCaseOperation1Input) (*InputService24TestShapeInputService24TestCaseOperation1Output, error) { - req, out := c.InputService24TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService24TestCaseOperation1WithContext is the same as InputService24TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService24TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService24ProtocolTest) InputService24TestCaseOperation1WithContext(ctx aws.Context, input *InputService24TestShapeInputService24TestCaseOperation1Input, opts ...request.Option) (*InputService24TestShapeInputService24TestCaseOperation1Output, error) { - req, out := c.InputService24TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService24TestCaseOperation2 = "OperationName" - -// InputService24TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService24TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService24TestCaseOperation2 for more information on using the InputService24TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService24TestCaseOperation2Request method. -// req, resp := client.InputService24TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService24ProtocolTest) InputService24TestCaseOperation2Request(input *InputService24TestShapeInputService24TestCaseOperation2Input) (req *request.Request, output *InputService24TestShapeInputService24TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService24TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService24TestShapeInputService24TestCaseOperation2Input{} - } - - output = &InputService24TestShapeInputService24TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService24TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService24TestCaseOperation2 for usage and error information. -func (c *InputService24ProtocolTest) InputService24TestCaseOperation2(input *InputService24TestShapeInputService24TestCaseOperation2Input) (*InputService24TestShapeInputService24TestCaseOperation2Output, error) { - req, out := c.InputService24TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService24TestCaseOperation2WithContext is the same as InputService24TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService24TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService24ProtocolTest) InputService24TestCaseOperation2WithContext(ctx aws.Context, input *InputService24TestShapeInputService24TestCaseOperation2Input, opts ...request.Option) (*InputService24TestShapeInputService24TestCaseOperation2Output, error) { - req, out := c.InputService24TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService24TestShapeInputService24TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService24TestShapeInputService24TestCaseOperation1Input) SetToken(v string) *InputService24TestShapeInputService24TestCaseOperation1Input { - s.Token = &v - return s -} - -type InputService24TestShapeInputService24TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService24TestShapeInputService24TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService24TestShapeInputService24TestCaseOperation2Input) SetToken(v string) *InputService24TestShapeInputService24TestCaseOperation2Input { - s.Token = &v - return s -} - -type InputService24TestShapeInputService24TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService25ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService25ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService25ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService25ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService25ProtocolTest client from just a session. -// svc := inputservice25protocoltest.New(mySession) -// -// // Create a InputService25ProtocolTest client with additional configuration -// svc := inputservice25protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService25ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService25ProtocolTest { - c := p.ClientConfig("inputservice25protocoltest", cfgs...) - return newInputService25ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService25ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService25ProtocolTest { - svc := &InputService25ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService25ProtocolTest", - ServiceID: "InputService25ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService25ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService25ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService25TestCaseOperation1 = "OperationName" - -// InputService25TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService25TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService25TestCaseOperation1 for more information on using the InputService25TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService25TestCaseOperation1Request method. -// req, resp := client.InputService25TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService25ProtocolTest) InputService25TestCaseOperation1Request(input *InputService25TestShapeInputService25TestCaseOperation1Input) (req *request.Request, output *InputService25TestShapeInputService25TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService25TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/Enum/{URIEnum}", - } - - if input == nil { - input = &InputService25TestShapeInputService25TestCaseOperation1Input{} - } - - output = &InputService25TestShapeInputService25TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService25TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService25TestCaseOperation1 for usage and error information. -func (c *InputService25ProtocolTest) InputService25TestCaseOperation1(input *InputService25TestShapeInputService25TestCaseOperation1Input) (*InputService25TestShapeInputService25TestCaseOperation1Output, error) { - req, out := c.InputService25TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService25TestCaseOperation1WithContext is the same as InputService25TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService25TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService25ProtocolTest) InputService25TestCaseOperation1WithContext(ctx aws.Context, input *InputService25TestShapeInputService25TestCaseOperation1Input, opts ...request.Option) (*InputService25TestShapeInputService25TestCaseOperation1Output, error) { - req, out := c.InputService25TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService25TestCaseOperation2 = "OperationName" - -// InputService25TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService25TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService25TestCaseOperation2 for more information on using the InputService25TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService25TestCaseOperation2Request method. -// req, resp := client.InputService25TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService25ProtocolTest) InputService25TestCaseOperation2Request(input *InputService25TestShapeInputService25TestCaseOperation2Input) (req *request.Request, output *InputService25TestShapeInputService25TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService25TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/Enum/{URIEnum}", - } - - if input == nil { - input = &InputService25TestShapeInputService25TestCaseOperation2Input{} - } - - output = &InputService25TestShapeInputService25TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService25TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService25TestCaseOperation2 for usage and error information. -func (c *InputService25ProtocolTest) InputService25TestCaseOperation2(input *InputService25TestShapeInputService25TestCaseOperation2Input) (*InputService25TestShapeInputService25TestCaseOperation2Output, error) { - req, out := c.InputService25TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService25TestCaseOperation2WithContext is the same as InputService25TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService25TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService25ProtocolTest) InputService25TestCaseOperation2WithContext(ctx aws.Context, input *InputService25TestShapeInputService25TestCaseOperation2Input, opts ...request.Option) (*InputService25TestShapeInputService25TestCaseOperation2Output, error) { - req, out := c.InputService25TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService25TestShapeInputService25TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - FooEnum *string `type:"string" enum:"InputService25TestShapeEnumType"` - - HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"InputService25TestShapeEnumType"` - - ListEnums []*string `type:"list"` - - // URIFooEnum is a required field - URIFooEnum *string `location:"uri" locationName:"URIEnum" type:"string" required:"true" enum:"InputService25TestShapeEnumType"` - - URIListEnums []*string `location:"querystring" locationName:"ListEnums" type:"list"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService25TestShapeInputService25TestCaseOperation1Input"} - if s.URIFooEnum == nil { - invalidParams.Add(request.NewErrParamRequired("URIFooEnum")) - } - if s.URIFooEnum != nil && len(*s.URIFooEnum) < 1 { - invalidParams.Add(request.NewErrParamMinLen("URIFooEnum", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFooEnum sets the FooEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) SetFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation1Input { - s.FooEnum = &v - return s -} - -// SetHeaderEnum sets the HeaderEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) SetHeaderEnum(v string) *InputService25TestShapeInputService25TestCaseOperation1Input { - s.HeaderEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) SetListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation1Input { - s.ListEnums = v - return s -} - -// SetURIFooEnum sets the URIFooEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) SetURIFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation1Input { - s.URIFooEnum = &v - return s -} - -// SetURIListEnums sets the URIListEnums field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation1Input) SetURIListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation1Input { - s.URIListEnums = v - return s -} - -type InputService25TestShapeInputService25TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService25TestShapeInputService25TestCaseOperation2Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - FooEnum *string `type:"string" enum:"InputService25TestShapeEnumType"` - - HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"InputService25TestShapeEnumType"` - - ListEnums []*string `type:"list"` - - // URIFooEnum is a required field - URIFooEnum *string `location:"uri" locationName:"URIEnum" type:"string" required:"true" enum:"InputService25TestShapeEnumType"` - - URIListEnums []*string `location:"querystring" locationName:"ListEnums" type:"list"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService25TestShapeInputService25TestCaseOperation2Input"} - if s.URIFooEnum == nil { - invalidParams.Add(request.NewErrParamRequired("URIFooEnum")) - } - if s.URIFooEnum != nil && len(*s.URIFooEnum) < 1 { - invalidParams.Add(request.NewErrParamMinLen("URIFooEnum", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFooEnum sets the FooEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input { - s.FooEnum = &v - return s -} - -// SetHeaderEnum sets the HeaderEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetHeaderEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input { - s.HeaderEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation2Input { - s.ListEnums = v - return s -} - -// SetURIFooEnum sets the URIFooEnum field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetURIFooEnum(v string) *InputService25TestShapeInputService25TestCaseOperation2Input { - s.URIFooEnum = &v - return s -} - -// SetURIListEnums sets the URIListEnums field's value. -func (s *InputService25TestShapeInputService25TestCaseOperation2Input) SetURIListEnums(v []*string) *InputService25TestShapeInputService25TestCaseOperation2Input { - s.URIListEnums = v - return s -} - -type InputService25TestShapeInputService25TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -const ( - // EnumTypeFoo is a InputService25TestShapeEnumType enum value - EnumTypeFoo = "foo" - - // EnumTypeBar is a InputService25TestShapeEnumType enum value - EnumTypeBar = "bar" - - // EnumType0 is a InputService25TestShapeEnumType enum value - EnumType0 = "0" - - // EnumType1 is a InputService25TestShapeEnumType enum value - EnumType1 = "1" -) - -// InputService26ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService26ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService26ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService26ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService26ProtocolTest client from just a session. -// svc := inputservice26protocoltest.New(mySession) -// -// // Create a InputService26ProtocolTest client with additional configuration -// svc := inputservice26protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService26ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService26ProtocolTest { - c := p.ClientConfig("inputservice26protocoltest", cfgs...) - return newInputService26ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService26ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService26ProtocolTest { - svc := &InputService26ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService26ProtocolTest", - ServiceID: "InputService26ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService26ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService26ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService26TestCaseOperation1 = "StaticOp" - -// InputService26TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService26TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService26TestCaseOperation1 for more information on using the InputService26TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService26TestCaseOperation1Request method. -// req, resp := client.InputService26TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService26ProtocolTest) InputService26TestCaseOperation1Request(input *InputService26TestShapeInputService26TestCaseOperation1Input) (req *request.Request, output *InputService26TestShapeInputService26TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService26TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService26TestShapeInputService26TestCaseOperation1Input{} - } - - output = &InputService26TestShapeInputService26TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("data-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// InputService26TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService26TestCaseOperation1 for usage and error information. -func (c *InputService26ProtocolTest) InputService26TestCaseOperation1(input *InputService26TestShapeInputService26TestCaseOperation1Input) (*InputService26TestShapeInputService26TestCaseOperation1Output, error) { - req, out := c.InputService26TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService26TestCaseOperation1WithContext is the same as InputService26TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService26TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService26ProtocolTest) InputService26TestCaseOperation1WithContext(ctx aws.Context, input *InputService26TestShapeInputService26TestCaseOperation1Input, opts ...request.Option) (*InputService26TestShapeInputService26TestCaseOperation1Output, error) { - req, out := c.InputService26TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService26TestCaseOperation2 = "MemberRefOp" - -// InputService26TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService26TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService26TestCaseOperation2 for more information on using the InputService26TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService26TestCaseOperation2Request method. -// req, resp := client.InputService26TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService26ProtocolTest) InputService26TestCaseOperation2Request(input *InputService26TestShapeInputService26TestCaseOperation2Input) (req *request.Request, output *InputService26TestShapeInputService26TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService26TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService26TestShapeInputService26TestCaseOperation2Input{} - } - - output = &InputService26TestShapeInputService26TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("foo-{Name}.", input.hostLabels)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// InputService26TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService26TestCaseOperation2 for usage and error information. -func (c *InputService26ProtocolTest) InputService26TestCaseOperation2(input *InputService26TestShapeInputService26TestCaseOperation2Input) (*InputService26TestShapeInputService26TestCaseOperation2Output, error) { - req, out := c.InputService26TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService26TestCaseOperation2WithContext is the same as InputService26TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService26TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService26ProtocolTest) InputService26TestCaseOperation2WithContext(ctx aws.Context, input *InputService26TestShapeInputService26TestCaseOperation2Input, opts ...request.Option) (*InputService26TestShapeInputService26TestCaseOperation2Output, error) { - req, out := c.InputService26TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService26TestShapeInputService26TestCaseOperation1Input struct { - _ struct{} `locationName:"StaticOpRequest" type:"structure"` - - Name *string `type:"string"` -} - -// SetName sets the Name field's value. -func (s *InputService26TestShapeInputService26TestCaseOperation1Input) SetName(v string) *InputService26TestShapeInputService26TestCaseOperation1Input { - s.Name = &v - return s -} - -type InputService26TestShapeInputService26TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService26TestShapeInputService26TestCaseOperation2Input struct { - _ struct{} `locationName:"MemberRefOpRequest" type:"structure"` - - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService26TestShapeInputService26TestCaseOperation2Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService26TestShapeInputService26TestCaseOperation2Input"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *InputService26TestShapeInputService26TestCaseOperation2Input) SetName(v string) *InputService26TestShapeInputService26TestCaseOperation2Input { - s.Name = &v - return s -} - -func (s *InputService26TestShapeInputService26TestCaseOperation2Input) hostLabels() map[string]string { - return map[string]string{ - "Name": aws.StringValue(s.Name), - } -} - -type InputService26TestShapeInputService26TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// InputService27ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// InputService27ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InputService27ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the InputService27ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a InputService27ProtocolTest client from just a session. -// svc := inputservice27protocoltest.New(mySession) -// -// // Create a InputService27ProtocolTest client with additional configuration -// svc := inputservice27protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewInputService27ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService27ProtocolTest { - c := p.ClientConfig("inputservice27protocoltest", cfgs...) - return newInputService27ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService27ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *InputService27ProtocolTest { - svc := &InputService27ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "InputService27ProtocolTest", - ServiceID: "InputService27ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a InputService27ProtocolTest operation and runs any -// custom request initialization. -func (c *InputService27ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opInputService27TestCaseOperation1 = "OperationName" - -// InputService27TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the InputService27TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InputService27TestCaseOperation1 for more information on using the InputService27TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the InputService27TestCaseOperation1Request method. -// req, resp := client.InputService27TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService27ProtocolTest) InputService27TestCaseOperation1Request(input *InputService27TestShapeInputService27TestCaseOperation1Input) (req *request.Request, output *InputService27TestShapeInputService27TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService27TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &InputService27TestShapeInputService27TestCaseOperation1Input{} - } - - output = &InputService27TestShapeInputService27TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService27TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation InputService27TestCaseOperation1 for usage and error information. -func (c *InputService27ProtocolTest) InputService27TestCaseOperation1(input *InputService27TestShapeInputService27TestCaseOperation1Input) (*InputService27TestShapeInputService27TestCaseOperation1Output, error) { - req, out := c.InputService27TestCaseOperation1Request(input) - return out, req.Send() -} - -// InputService27TestCaseOperation1WithContext is the same as InputService27TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService27TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *InputService27ProtocolTest) InputService27TestCaseOperation1WithContext(ctx aws.Context, input *InputService27TestShapeInputService27TestCaseOperation1Input, opts ...request.Option) (*InputService27TestShapeInputService27TestCaseOperation1Output, error) { - req, out := c.InputService27TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService27TestShapeInputService27TestCaseOperation1Input struct { - _ struct{} `locationName:"InputShape" type:"structure"` - - Header1 *string `location:"header" type:"string"` - - HeaderMap map[string]*string `location:"headers" locationName:"header-map-" type:"map"` -} - -// SetHeader1 sets the Header1 field's value. -func (s *InputService27TestShapeInputService27TestCaseOperation1Input) SetHeader1(v string) *InputService27TestShapeInputService27TestCaseOperation1Input { - s.Header1 = &v - return s -} - -// SetHeaderMap sets the HeaderMap field's value. -func (s *InputService27TestShapeInputService27TestCaseOperation1Input) SetHeaderMap(v map[string]*string) *InputService27TestShapeInputService27TestCaseOperation1Input { - s.HeaderMap = v - return s -} - -type InputService27TestShapeInputService27TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// -// Tests begin here -// - -func TestInputService1ProtocolTestBasicXMLSerializationCase1(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation1Input{ - Description: aws.String("bar"), - Name: aws.String("foo"), - } - req, _ := svc.InputService1TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `barfoo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService1ProtocolTestBasicXMLSerializationCase2(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation2Input{ - Description: aws.String("bar"), - Name: aws.String("foo"), - } - req, _ := svc.InputService1TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `barfoo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService1ProtocolTestBasicXMLSerializationCase3(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation3Input{} - req, _ := svc.InputService1TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService2ProtocolTestSerializeOtherScalarTypesCase1(t *testing.T) { - svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService2TestShapeInputService2TestCaseOperation1Input{ - First: aws.Bool(true), - Fourth: aws.Int64(3), - Second: aws.Bool(false), - Third: aws.Float64(1.2), - } - req, _ := svc.InputService2TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `true3false1.2`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestNestedStructuresCase1(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation1Input{ - Description: aws.String("baz"), - SubStructure: &InputService3TestShapeSubStructure{ - Bar: aws.String("b"), - Foo: aws.String("a"), - }, - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `bazba`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestNestedStructuresCase2(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation2Input{ - Description: aws.String("baz"), - SubStructure: &InputService3TestShapeSubStructure{ - Foo: aws.String("a"), - }, - } - req, _ := svc.InputService3TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `baza`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService4ProtocolTestNestedStructuresCase1(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation1Input{ - Description: aws.String("baz"), - SubStructure: &InputService4TestShapeSubStructure{}, - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `baz`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService5ProtocolTestNonFlattenedListsCase1(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation1Input{ - ListParam: []*string{ - aws.String("one"), - aws.String("two"), - aws.String("three"), - }, - } - req, _ := svc.InputService5TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService6ProtocolTestNonFlattenedListsWithLocationNameCase1(t *testing.T) { - svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService6TestShapeInputService6TestCaseOperation1Input{ - ListParam: []*string{ - aws.String("one"), - aws.String("two"), - aws.String("three"), - }, - } - req, _ := svc.InputService6TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService7ProtocolTestFlattenedListsCase1(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation1Input{ - ListParam: []*string{ - aws.String("one"), - aws.String("two"), - aws.String("three"), - }, - } - req, _ := svc.InputService7TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService8ProtocolTestFlattenedListsWithLocationNameCase1(t *testing.T) { - svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService8TestShapeInputService8TestCaseOperation1Input{ - ListParam: []*string{ - aws.String("one"), - aws.String("two"), - aws.String("three"), - }, - } - req, _ := svc.InputService8TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService9ProtocolTestListOfStructuresCase1(t *testing.T) { - svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService9TestShapeInputService9TestCaseOperation1Input{ - ListParam: []*InputService9TestShapeSingleFieldStruct{ - { - Element: aws.String("one"), - }, - { - Element: aws.String("two"), - }, - { - Element: aws.String("three"), - }, - }, - } - req, _ := svc.InputService9TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService10ProtocolTestBlobShapesCase1(t *testing.T) { - svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService10TestShapeInputService10TestCaseOperation1Input{ - StructureParam: &InputService10TestShapeStructureShape{ - B: []byte("foo"), - }, - } - req, _ := svc.InputService10TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `Zm9v`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService11ProtocolTestTimestampShapesCase1(t *testing.T) { - svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService11TestShapeInputService11TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - TimeArgInHeader: aws.Time(time.Unix(1422172800, 0)), - TimeArgInQuery: aws.Time(time.Unix(1422172800, 0)), - TimeCustom: aws.Time(time.Unix(1422172800, 0)), - TimeCustomInHeader: aws.Time(time.Unix(1422172800, 0)), - TimeCustomInQuery: aws.Time(time.Unix(1422172800, 0)), - TimeFormat: aws.Time(time.Unix(1422172800, 0)), - TimeFormatInHeader: aws.Time(time.Unix(1422172800, 0)), - TimeFormatInQuery: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService11TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `2015-01-25T08:00:00ZSun, 25 Jan 2015 08:00:00 GMTSun, 25 Jan 2015 08:00:00 GMT`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone?TimeQuery=2015-01-25T08%3A00%3A00Z&TimeCustomQuery=1422172800&TimeFormatQuery=1422172800", r.URL.String()) - - // assert headers - if e, a := "Sun, 25 Jan 2015 08:00:00 GMT", r.Header.Get("x-amz-timearg"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "1422172800", r.Header.Get("x-amz-timecustom-header"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "1422172800", r.Header.Get("x-amz-timeformat-header"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestInputService12ProtocolTestHeaderMapsCase1(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation1Input{ - Foo: map[string]*string{ - "a": aws.String("b"), - "c": aws.String("d"), - }, - } - req, _ := svc.InputService12TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - if e, a := "b", r.Header.Get("x-foo-a"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "d", r.Header.Get("x-foo-c"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestInputService13ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation1Input{ - Items: []*string{ - aws.String("value1"), - aws.String("value2"), - }, - } - req, _ := svc.InputService13TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/path?item=value1&item=value2", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestStringToStringMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService14TestShapeInputService14TestCaseOperation1Input{ - PipelineId: aws.String("foo"), - QueryDoc: map[string]*string{ - "bar": aws.String("baz"), - "fizz": aws.String("buzz"), - }, - } - req, _ := svc.InputService14TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?bar=baz&fizz=buzz", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestStringToStringListMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation1Input{ - PipelineId: aws.String("id"), - QueryDoc: map[string][]*string{ - "fizz": { - aws.String("buzz"), - aws.String("pop"), - }, - "foo": { - aws.String("bar"), - aws.String("baz"), - }, - }, - } - req, _ := svc.InputService15TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/id?foo=bar&foo=baz&fizz=buzz&fizz=pop", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestBooleanInQuerystringCase1(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation1Input{ - BoolQuery: aws.Bool(true), - } - req, _ := svc.InputService16TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=true", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestBooleanInQuerystringCase2(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - BoolQuery: aws.Bool(false), - } - req, _ := svc.InputService16TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=false", r.URL.String()) - - // assert headers - -} - -func TestInputService17ProtocolTestStringPayloadCase1(t *testing.T) { - svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService17TestShapeInputService17TestCaseOperation1Input{ - Foo: aws.String("bar"), - } - req, _ := svc.InputService17TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - if e, a := "bar", util.Trim(string(body)); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestBlobPayloadCase1(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation1Input{ - Foo: []byte("bar"), - } - req, _ := svc.InputService18TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - if e, a := "bar", util.Trim(string(body)); e != a { - t.Errorf("expect %v, got %v", e, a) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestBlobPayloadCase2(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation2Input{} - req, _ := svc.InputService18TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestStructurePayloadCase1(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation1Input{ - Foo: &InputService19TestShapeFooShape{ - Baz: aws.String("bar"), - }, - } - req, _ := svc.InputService19TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `bar`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestStructurePayloadCase2(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation2Input{} - req, _ := svc.InputService19TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestStructurePayloadCase3(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation3Input{ - Foo: &InputService19TestShapeFooShape{}, - } - req, _ := svc.InputService19TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, ``, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestStructurePayloadCase4(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation4Input{} - req, _ := svc.InputService19TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService20ProtocolTestXMLAttributeCase1(t *testing.T) { - svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService20TestShapeInputService20TestCaseOperation1Input{ - Grant: &InputService20TestShapeGrant{ - Grantee: &InputService20TestShapeGrantee{ - EmailAddress: aws.String("foo@example.com"), - Type: aws.String("CanonicalUser"), - }, - }, - } - req, _ := svc.InputService20TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo@example.com`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService21ProtocolTestGreedyKeysCase1(t *testing.T) { - svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService21TestShapeInputService21TestCaseOperation1Input{ - Bucket: aws.String("my/bucket"), - Key: aws.String("testing /123"), - } - req, _ := svc.InputService21TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/my%2Fbucket/testing%20/123", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase1(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation1Input{} - req, _ := svc.InputService22TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase2(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation2Input{ - Foo: aws.String(""), - } - req, _ := svc.InputService22TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/path?abc=mno¶m-name=", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation1Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService23TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation2Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService23TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation3Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService23TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation4Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveList: []*InputService23TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService23TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foobar`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation5Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveList: []*InputService23TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService23TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foobar`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation6Input{ - RecursiveStruct: &InputService23TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService23TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService23TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `barbarfoofoo`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService24ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService24ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService24TestShapeInputService24TestCaseOperation1Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService24TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `abc123`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService24ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService24ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService24TestShapeInputService24TestCaseOperation2Input{} - req, _ := svc.InputService24TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `00000000-0000-4000-8000-000000000000`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService25ProtocolTestEnumCase1(t *testing.T) { - svc := NewInputService25ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService25TestShapeInputService25TestCaseOperation1Input{ - FooEnum: aws.String("foo"), - HeaderEnum: aws.String("baz"), - ListEnums: []*string{ - aws.String("foo"), - aws.String(""), - aws.String("bar"), - }, - URIFooEnum: aws.String("bar"), - URIListEnums: []*string{ - aws.String("0"), - aws.String(""), - aws.String("1"), - }, - } - req, _ := svc.InputService25TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foofoobar`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://test/Enum/bar?ListEnums=0&ListEnums=&ListEnums=1", r.URL.String()) - - // assert headers - if e, a := "baz", r.Header.Get("x-amz-enum"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestInputService25ProtocolTestEnumCase2(t *testing.T) { - svc := NewInputService25ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService25TestShapeInputService25TestCaseOperation2Input{ - URIFooEnum: aws.String("bar"), - } - req, _ := svc.InputService25TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/Enum/bar", r.URL.String()) - - // assert headers - -} - -func TestInputService26ProtocolTestEndpointHostTraitCase1(t *testing.T) { - svc := NewInputService26ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")}) - input := &InputService26TestShapeInputService26TestCaseOperation1Input{ - Name: aws.String("myname"), - } - req, _ := svc.InputService26TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `myname`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://data-service.region.amazonaws.com/path", r.URL.String()) - - // assert headers - -} - -func TestInputService26ProtocolTestEndpointHostTraitCase2(t *testing.T) { - svc := NewInputService26ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://service.region.amazonaws.com")}) - input := &InputService26TestShapeInputService26TestCaseOperation2Input{ - Name: aws.String("myname"), - } - req, _ := svc.InputService26TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert body - if r.Body == nil { - t.Errorf("expect body not to be nil") - } - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `myname`, util.Trim(body)) - - // assert URL - awstesting.AssertURL(t, "https://foo-myname.service.region.amazonaws.com/path", r.URL.String()) - - // assert headers - -} - -func TestInputService27ProtocolTestHeaderWhitespaceCase1(t *testing.T) { - svc := NewInputService27ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService27TestShapeInputService27TestCaseOperation1Input{ - Header1: aws.String(" headerValue"), - HeaderMap: map[string]*string{ - " key-leading-space": aws.String("value"), - " key-with-space ": aws.String("value"), - "leading-space": aws.String(" value"), - "leading-tab": aws.String(" value"), - "with-space": aws.String(" value "), - }, - } - req, _ := svc.InputService27TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - req.Build() - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - if e, a := "value", r.Header.Get("header-map-key-leading-space"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "value", r.Header.Get("header-map-key-with-space"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "value", r.Header.Get("header-map-leading-space"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "value", r.Header.Get("header-map-leading-tab"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "value", r.Header.Get("header-map-with-space"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "headerValue", r.Header.Get("header1"); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go deleted file mode 100644 index fff7d22..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go +++ /dev/null @@ -1,3493 +0,0 @@ -// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. - -package restxml_test - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" -) - -var _ bytes.Buffer // always import bytes -var _ http.Request -var _ json.Marshaler -var _ time.Time -var _ xmlutil.XMLNode -var _ xml.Attr -var _ = ioutil.Discard -var _ = util.Trim("") -var _ = url.Values{} -var _ = io.EOF -var _ = aws.String -var _ = fmt.Println -var _ = reflect.Value{} - -func init() { - protocol.RandReader = &awstesting.ZeroReader{} -} - -// OutputService1ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService1ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService1ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService1ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService1ProtocolTest client from just a session. -// svc := outputservice1protocoltest.New(mySession) -// -// // Create a OutputService1ProtocolTest client with additional configuration -// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest { - c := p.ClientConfig("outputservice1protocoltest", cfgs...) - return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService1ProtocolTest", - ServiceID: "OutputService1ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService1TestCaseOperation1 = "OperationName" - -// OutputService1TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService1TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService1TestCaseOperation1 for more information on using the OutputService1TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService1TestCaseOperation1Request method. -// req, resp := client.OutputService1TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService1TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} - } - - output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService1TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService1TestCaseOperation1 for usage and error information. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { - req, out := c.OutputService1TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService1TestCaseOperation1WithContext is the same as OutputService1TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService1TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1WithContext(ctx aws.Context, input *OutputService1TestShapeOutputService1TestCaseOperation1Input, opts ...request.Option) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { - req, out := c.OutputService1TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opOutputService1TestCaseOperation2 = "OperationName" - -// OutputService1TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the OutputService1TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService1TestCaseOperation2 for more information on using the OutputService1TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService1TestCaseOperation2Request method. -// req, resp := client.OutputService1TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2Request(input *OutputService1TestShapeOutputService1TestCaseOperation2Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opOutputService1TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService1TestShapeOutputService1TestCaseOperation2Input{} - } - - output = &OutputService1TestShapeOutputService1TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService1TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService1TestCaseOperation2 for usage and error information. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2(input *OutputService1TestShapeOutputService1TestCaseOperation2Input) (*OutputService1TestShapeOutputService1TestCaseOperation2Output, error) { - req, out := c.OutputService1TestCaseOperation2Request(input) - return out, req.Send() -} - -// OutputService1TestCaseOperation2WithContext is the same as OutputService1TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService1TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation2WithContext(ctx aws.Context, input *OutputService1TestShapeOutputService1TestCaseOperation2Input, opts ...request.Option) (*OutputService1TestShapeOutputService1TestCaseOperation2Output, error) { - req, out := c.OutputService1TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - // Blob is automatically base64 encoded/decoded by the SDK. - Blob []byte `type:"blob"` - - // BlobHeader is automatically base64 encoded/decoded by the SDK. - BlobHeader []byte `location:"header" type:"blob"` - - Char *string `type:"character"` - - Double *float64 `type:"double"` - - FalseBool *bool `type:"boolean"` - - Float *float64 `type:"float"` - - ImaHeader *string `location:"header" type:"string"` - - ImaHeaderLocation *string `location:"header" locationName:"X-Foo" type:"string"` - - Long *int64 `type:"long"` - - Num *int64 `locationName:"FooNum" type:"integer"` - - Str *string `type:"string"` - - Timestamp *time.Time `type:"timestamp"` - - TrueBool *bool `type:"boolean"` -} - -// SetBlob sets the Blob field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetBlob(v []byte) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Blob = v - return s -} - -// SetBlobHeader sets the BlobHeader field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetBlobHeader(v []byte) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.BlobHeader = v - return s -} - -// SetChar sets the Char field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetChar(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Char = &v - return s -} - -// SetDouble sets the Double field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetDouble(v float64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Double = &v - return s -} - -// SetFalseBool sets the FalseBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetFalseBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.FalseBool = &v - return s -} - -// SetFloat sets the Float field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetFloat(v float64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Float = &v - return s -} - -// SetImaHeader sets the ImaHeader field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetImaHeader(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.ImaHeader = &v - return s -} - -// SetImaHeaderLocation sets the ImaHeaderLocation field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetImaHeaderLocation(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.ImaHeaderLocation = &v - return s -} - -// SetLong sets the Long field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetLong(v int64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Long = &v - return s -} - -// SetNum sets the Num field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetNum(v int64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Num = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetStr(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Str = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTimestamp(v time.Time) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Timestamp = &v - return s -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -type OutputService1TestShapeOutputService1TestCaseOperation2Input struct { - _ struct{} `type:"structure"` -} - -type OutputService1TestShapeOutputService1TestCaseOperation2Output struct { - _ struct{} `type:"structure"` - - // Blob is automatically base64 encoded/decoded by the SDK. - Blob []byte `type:"blob"` - - // BlobHeader is automatically base64 encoded/decoded by the SDK. - BlobHeader []byte `location:"header" type:"blob"` - - Char *string `type:"character"` - - Double *float64 `type:"double"` - - FalseBool *bool `type:"boolean"` - - Float *float64 `type:"float"` - - ImaHeader *string `location:"header" type:"string"` - - ImaHeaderLocation *string `location:"header" locationName:"X-Foo" type:"string"` - - Long *int64 `type:"long"` - - Num *int64 `locationName:"FooNum" type:"integer"` - - Str *string `type:"string"` - - Timestamp *time.Time `type:"timestamp"` - - TrueBool *bool `type:"boolean"` -} - -// SetBlob sets the Blob field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetBlob(v []byte) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Blob = v - return s -} - -// SetBlobHeader sets the BlobHeader field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetBlobHeader(v []byte) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.BlobHeader = v - return s -} - -// SetChar sets the Char field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetChar(v string) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Char = &v - return s -} - -// SetDouble sets the Double field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetDouble(v float64) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Double = &v - return s -} - -// SetFalseBool sets the FalseBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetFalseBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.FalseBool = &v - return s -} - -// SetFloat sets the Float field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetFloat(v float64) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Float = &v - return s -} - -// SetImaHeader sets the ImaHeader field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetImaHeader(v string) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.ImaHeader = &v - return s -} - -// SetImaHeaderLocation sets the ImaHeaderLocation field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetImaHeaderLocation(v string) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.ImaHeaderLocation = &v - return s -} - -// SetLong sets the Long field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetLong(v int64) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Long = &v - return s -} - -// SetNum sets the Num field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetNum(v int64) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Num = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetStr(v string) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Str = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetTimestamp(v time.Time) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.Timestamp = &v - return s -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation2Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation2Output { - s.TrueBool = &v - return s -} - -// OutputService2ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService2ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService2ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService2ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService2ProtocolTest client from just a session. -// svc := outputservice2protocoltest.New(mySession) -// -// // Create a OutputService2ProtocolTest client with additional configuration -// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest { - c := p.ClientConfig("outputservice2protocoltest", cfgs...) - return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService2ProtocolTest", - ServiceID: "OutputService2ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService2TestCaseOperation1 = "OperationName" - -// OutputService2TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService2TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService2TestCaseOperation1 for more information on using the OutputService2TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService2TestCaseOperation1Request method. -// req, resp := client.OutputService2TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService2TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} - } - - output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService2TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService2TestCaseOperation1 for usage and error information. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { - req, out := c.OutputService2TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService2TestCaseOperation1WithContext is the same as OutputService2TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService2TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1WithContext(ctx aws.Context, input *OutputService2TestShapeOutputService2TestCaseOperation1Input, opts ...request.Option) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { - req, out := c.OutputService2TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - // Blob is automatically base64 encoded/decoded by the SDK. - Blob []byte `type:"blob"` -} - -// SetBlob sets the Blob field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetBlob(v []byte) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.Blob = v - return s -} - -// OutputService3ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService3ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService3ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService3ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService3ProtocolTest client from just a session. -// svc := outputservice3protocoltest.New(mySession) -// -// // Create a OutputService3ProtocolTest client with additional configuration -// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest { - c := p.ClientConfig("outputservice3protocoltest", cfgs...) - return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService3ProtocolTest", - ServiceID: "OutputService3ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService3TestCaseOperation1 = "OperationName" - -// OutputService3TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService3TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService3TestCaseOperation1 for more information on using the OutputService3TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService3TestCaseOperation1Request method. -// req, resp := client.OutputService3TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService3TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} - } - - output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService3TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService3TestCaseOperation1 for usage and error information. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { - req, out := c.OutputService3TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService3TestCaseOperation1WithContext is the same as OutputService3TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService3TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1WithContext(ctx aws.Context, input *OutputService3TestShapeOutputService3TestCaseOperation1Input, opts ...request.Option) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { - req, out := c.OutputService3TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetListMember(v []*string) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService4ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService4ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService4ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService4ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService4ProtocolTest client from just a session. -// svc := outputservice4protocoltest.New(mySession) -// -// // Create a OutputService4ProtocolTest client with additional configuration -// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest { - c := p.ClientConfig("outputservice4protocoltest", cfgs...) - return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService4ProtocolTest", - ServiceID: "OutputService4ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService4TestCaseOperation1 = "OperationName" - -// OutputService4TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService4TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService4TestCaseOperation1 for more information on using the OutputService4TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService4TestCaseOperation1Request method. -// req, resp := client.OutputService4TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService4TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} - } - - output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService4TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService4TestCaseOperation1 for usage and error information. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { - req, out := c.OutputService4TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService4TestCaseOperation1WithContext is the same as OutputService4TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService4TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1WithContext(ctx aws.Context, input *OutputService4TestShapeOutputService4TestCaseOperation1Input, opts ...request.Option) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { - req, out := c.OutputService4TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `locationNameList:"item" type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService4TestShapeOutputService4TestCaseOperation1Output) SetListMember(v []*string) *OutputService4TestShapeOutputService4TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService5ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService5ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService5ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService5ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService5ProtocolTest client from just a session. -// svc := outputservice5protocoltest.New(mySession) -// -// // Create a OutputService5ProtocolTest client with additional configuration -// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest { - c := p.ClientConfig("outputservice5protocoltest", cfgs...) - return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService5ProtocolTest", - ServiceID: "OutputService5ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService5TestCaseOperation1 = "OperationName" - -// OutputService5TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService5TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService5TestCaseOperation1 for more information on using the OutputService5TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService5TestCaseOperation1Request method. -// req, resp := client.OutputService5TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService5TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} - } - - output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService5TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService5TestCaseOperation1 for usage and error information. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { - req, out := c.OutputService5TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService5TestCaseOperation1WithContext is the same as OutputService5TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService5TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1WithContext(ctx aws.Context, input *OutputService5TestShapeOutputService5TestCaseOperation1Input, opts ...request.Option) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { - req, out := c.OutputService5TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list" flattened:"true"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService5TestShapeOutputService5TestCaseOperation1Output) SetListMember(v []*string) *OutputService5TestShapeOutputService5TestCaseOperation1Output { - s.ListMember = v - return s -} - -// OutputService6ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService6ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService6ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService6ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService6ProtocolTest client from just a session. -// svc := outputservice6protocoltest.New(mySession) -// -// // Create a OutputService6ProtocolTest client with additional configuration -// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest { - c := p.ClientConfig("outputservice6protocoltest", cfgs...) - return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService6ProtocolTest", - ServiceID: "OutputService6ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService6TestCaseOperation1 = "OperationName" - -// OutputService6TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService6TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService6TestCaseOperation1 for more information on using the OutputService6TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService6TestCaseOperation1Request method. -// req, resp := client.OutputService6TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService6TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} - } - - output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService6TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService6TestCaseOperation1 for usage and error information. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { - req, out := c.OutputService6TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService6TestCaseOperation1WithContext is the same as OutputService6TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService6TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1WithContext(ctx aws.Context, input *OutputService6TestShapeOutputService6TestCaseOperation1Input, opts ...request.Option) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { - req, out := c.OutputService6TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*OutputService6TestShapeSingleStructure `type:"map"` -} - -// SetMap sets the Map field's value. -func (s *OutputService6TestShapeOutputService6TestCaseOperation1Output) SetMap(v map[string]*OutputService6TestShapeSingleStructure) *OutputService6TestShapeOutputService6TestCaseOperation1Output { - s.Map = v - return s -} - -type OutputService6TestShapeSingleStructure struct { - _ struct{} `type:"structure"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService6TestShapeSingleStructure) SetFoo(v string) *OutputService6TestShapeSingleStructure { - s.Foo = &v - return s -} - -// OutputService7ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService7ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService7ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService7ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService7ProtocolTest client from just a session. -// svc := outputservice7protocoltest.New(mySession) -// -// // Create a OutputService7ProtocolTest client with additional configuration -// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest { - c := p.ClientConfig("outputservice7protocoltest", cfgs...) - return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService7ProtocolTest", - ServiceID: "OutputService7ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService7TestCaseOperation1 = "OperationName" - -// OutputService7TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService7TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService7TestCaseOperation1 for more information on using the OutputService7TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService7TestCaseOperation1Request method. -// req, resp := client.OutputService7TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService7TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} - } - - output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService7TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService7TestCaseOperation1 for usage and error information. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { - req, out := c.OutputService7TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService7TestCaseOperation1WithContext is the same as OutputService7TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService7TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1WithContext(ctx aws.Context, input *OutputService7TestShapeOutputService7TestCaseOperation1Input, opts ...request.Option) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { - req, out := c.OutputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*string `type:"map" flattened:"true"` -} - -// SetMap sets the Map field's value. -func (s *OutputService7TestShapeOutputService7TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService7TestShapeOutputService7TestCaseOperation1Output { - s.Map = v - return s -} - -// OutputService8ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService8ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService8ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService8ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService8ProtocolTest client from just a session. -// svc := outputservice8protocoltest.New(mySession) -// -// // Create a OutputService8ProtocolTest client with additional configuration -// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest { - c := p.ClientConfig("outputservice8protocoltest", cfgs...) - return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService8ProtocolTest", - ServiceID: "OutputService8ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService8TestCaseOperation1 = "OperationName" - -// OutputService8TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService8TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService8TestCaseOperation1 for more information on using the OutputService8TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService8TestCaseOperation1Request method. -// req, resp := client.OutputService8TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService8TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} - } - - output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService8TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService8TestCaseOperation1 for usage and error information. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { - req, out := c.OutputService8TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService8TestCaseOperation1WithContext is the same as OutputService8TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService8TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1WithContext(ctx aws.Context, input *OutputService8TestShapeOutputService8TestCaseOperation1Input, opts ...request.Option) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { - req, out := c.OutputService8TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map"` -} - -// SetMap sets the Map field's value. -func (s *OutputService8TestShapeOutputService8TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService8TestShapeOutputService8TestCaseOperation1Output { - s.Map = v - return s -} - -// OutputService9ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService9ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService9ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService9ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService9ProtocolTest client from just a session. -// svc := outputservice9protocoltest.New(mySession) -// -// // Create a OutputService9ProtocolTest client with additional configuration -// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest { - c := p.ClientConfig("outputservice9protocoltest", cfgs...) - return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService9ProtocolTest", - ServiceID: "OutputService9ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService9TestCaseOperation1 = "OperationName" - -// OutputService9TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService9TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService9TestCaseOperation1 for more information on using the OutputService9TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService9TestCaseOperation1Request method. -// req, resp := client.OutputService9TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService9TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{} - } - - output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService9TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService9TestCaseOperation1 for usage and error information. -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { - req, out := c.OutputService9TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService9TestCaseOperation1WithContext is the same as OutputService9TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService9TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1WithContext(ctx aws.Context, input *OutputService9TestShapeOutputService9TestCaseOperation1Input, opts ...request.Option) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { - req, out := c.OutputService9TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure" payload:"Data"` - - Data *OutputService9TestShapeSingleStructure `type:"structure"` - - Header *string `location:"header" locationName:"X-Foo" type:"string"` -} - -// SetData sets the Data field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetData(v *OutputService9TestShapeSingleStructure) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.Data = v - return s -} - -// SetHeader sets the Header field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetHeader(v string) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.Header = &v - return s -} - -type OutputService9TestShapeSingleStructure struct { - _ struct{} `type:"structure"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService9TestShapeSingleStructure) SetFoo(v string) *OutputService9TestShapeSingleStructure { - s.Foo = &v - return s -} - -// OutputService10ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService10ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService10ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService10ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService10ProtocolTest client from just a session. -// svc := outputservice10protocoltest.New(mySession) -// -// // Create a OutputService10ProtocolTest client with additional configuration -// svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest { - c := p.ClientConfig("outputservice10protocoltest", cfgs...) - return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest { - svc := &OutputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService10ProtocolTest", - ServiceID: "OutputService10ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService10ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService10TestCaseOperation1 = "OperationName" - -// OutputService10TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService10TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService10TestCaseOperation1 for more information on using the OutputService10TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService10TestCaseOperation1Request method. -// req, resp := client.OutputService10TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService10TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{} - } - - output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService10TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService10TestCaseOperation1 for usage and error information. -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { - req, out := c.OutputService10TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService10TestCaseOperation1WithContext is the same as OutputService10TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService10TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1WithContext(ctx aws.Context, input *OutputService10TestShapeOutputService10TestCaseOperation1Input, opts ...request.Option) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { - req, out := c.OutputService10TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure" payload:"Stream"` - - Stream []byte `type:"blob"` -} - -// SetStream sets the Stream field's value. -func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetStream(v []byte) *OutputService10TestShapeOutputService10TestCaseOperation1Output { - s.Stream = v - return s -} - -// OutputService11ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService11ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService11ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService11ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService11ProtocolTest client from just a session. -// svc := outputservice11protocoltest.New(mySession) -// -// // Create a OutputService11ProtocolTest client with additional configuration -// svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest { - c := p.ClientConfig("outputservice11protocoltest", cfgs...) - return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest { - svc := &OutputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService11ProtocolTest", - ServiceID: "OutputService11ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService11ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService11TestCaseOperation1 = "OperationName" - -// OutputService11TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService11TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService11TestCaseOperation1 for more information on using the OutputService11TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService11TestCaseOperation1Request method. -// req, resp := client.OutputService11TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService11TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{} - } - - output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService11TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService11TestCaseOperation1 for usage and error information. -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { - req, out := c.OutputService11TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService11TestCaseOperation1WithContext is the same as OutputService11TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService11TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1WithContext(ctx aws.Context, input *OutputService11TestShapeOutputService11TestCaseOperation1Input, opts ...request.Option) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { - req, out := c.OutputService11TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService11TestShapeOutputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Char *string `location:"header" locationName:"x-char" type:"character"` - - Double *float64 `location:"header" locationName:"x-double" type:"double"` - - FalseBool *bool `location:"header" locationName:"x-false-bool" type:"boolean"` - - Float *float64 `location:"header" locationName:"x-float" type:"float"` - - Integer *int64 `location:"header" locationName:"x-int" type:"integer"` - - Long *int64 `location:"header" locationName:"x-long" type:"long"` - - Str *string `location:"header" locationName:"x-str" type:"string"` - - Timestamp *time.Time `location:"header" locationName:"x-timestamp" type:"timestamp"` - - TrueBool *bool `location:"header" locationName:"x-true-bool" type:"boolean"` -} - -// SetChar sets the Char field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetChar(v string) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Char = &v - return s -} - -// SetDouble sets the Double field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetDouble(v float64) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Double = &v - return s -} - -// SetFalseBool sets the FalseBool field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetFalseBool(v bool) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.FalseBool = &v - return s -} - -// SetFloat sets the Float field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetFloat(v float64) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Float = &v - return s -} - -// SetInteger sets the Integer field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetInteger(v int64) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Integer = &v - return s -} - -// SetLong sets the Long field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetLong(v int64) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Long = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetStr(v string) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Str = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetTimestamp(v time.Time) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Timestamp = &v - return s -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetTrueBool(v bool) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -// OutputService12ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService12ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService12ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService12ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService12ProtocolTest client from just a session. -// svc := outputservice12protocoltest.New(mySession) -// -// // Create a OutputService12ProtocolTest client with additional configuration -// svc := outputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService12ProtocolTest { - c := p.ClientConfig("outputservice12protocoltest", cfgs...) - return newOutputService12ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService12ProtocolTest { - svc := &OutputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService12ProtocolTest", - ServiceID: "OutputService12ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService12ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService12TestCaseOperation1 = "OperationName" - -// OutputService12TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService12TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService12TestCaseOperation1 for more information on using the OutputService12TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService12TestCaseOperation1Request method. -// req, resp := client.OutputService12TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *request.Request, output *OutputService12TestShapeOutputService12TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService12TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService12TestShapeOutputService12TestCaseOperation1Input{} - } - - output = &OutputService12TestShapeOutputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService12TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService12TestCaseOperation1 for usage and error information. -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { - req, out := c.OutputService12TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService12TestCaseOperation1WithContext is the same as OutputService12TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService12TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1WithContext(ctx aws.Context, input *OutputService12TestShapeOutputService12TestCaseOperation1Input, opts ...request.Option) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { - req, out := c.OutputService12TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService12TestShapeOutputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService12TestShapeOutputService12TestCaseOperation1Output) SetFoo(v string) *OutputService12TestShapeOutputService12TestCaseOperation1Output { - s.Foo = &v - return s -} - -// OutputService13ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService13ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService13ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService13ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService13ProtocolTest client from just a session. -// svc := outputservice13protocoltest.New(mySession) -// -// // Create a OutputService13ProtocolTest client with additional configuration -// svc := outputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService13ProtocolTest { - c := p.ClientConfig("outputservice13protocoltest", cfgs...) - return newOutputService13ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService13ProtocolTest { - svc := &OutputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService13ProtocolTest", - ServiceID: "OutputService13ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService13ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService13TestCaseOperation1 = "OperationName" - -// OutputService13TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService13TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService13TestCaseOperation1 for more information on using the OutputService13TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService13TestCaseOperation1Request method. -// req, resp := client.OutputService13TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService13TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService13TestShapeOutputService13TestCaseOperation1Input{} - } - - output = &OutputService13TestShapeOutputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService13TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService13TestCaseOperation1 for usage and error information. -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { - req, out := c.OutputService13TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService13TestCaseOperation1WithContext is the same as OutputService13TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService13TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1WithContext(ctx aws.Context, input *OutputService13TestShapeOutputService13TestCaseOperation1Input, opts ...request.Option) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { - req, out := c.OutputService13TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService13TestShapeOutputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - StructMember *OutputService13TestShapeTimeContainer `type:"structure"` - - TimeArg *time.Time `type:"timestamp"` - - TimeArgInHeader *time.Time `location:"header" locationName:"x-amz-timearg" type:"timestamp"` - - TimeCustom *time.Time `type:"timestamp" timestampFormat:"rfc822"` - - TimeCustomInHeader *time.Time `location:"header" locationName:"x-amz-timecustom" type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeFormat *time.Time `type:"timestamp" timestampFormat:"unixTimestamp"` - - TimeFormatInHeader *time.Time `location:"header" locationName:"x-amz-timeformat" type:"timestamp" timestampFormat:"unixTimestamp"` -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetStructMember(v *OutputService13TestShapeTimeContainer) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.StructMember = v - return s -} - -// SetTimeArg sets the TimeArg field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeArg(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeArg = &v - return s -} - -// SetTimeArgInHeader sets the TimeArgInHeader field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeArgInHeader(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeArgInHeader = &v - return s -} - -// SetTimeCustom sets the TimeCustom field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeCustom(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeCustom = &v - return s -} - -// SetTimeCustomInHeader sets the TimeCustomInHeader field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeCustomInHeader(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeCustomInHeader = &v - return s -} - -// SetTimeFormat sets the TimeFormat field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeFormat(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeFormat = &v - return s -} - -// SetTimeFormatInHeader sets the TimeFormatInHeader field's value. -func (s *OutputService13TestShapeOutputService13TestCaseOperation1Output) SetTimeFormatInHeader(v time.Time) *OutputService13TestShapeOutputService13TestCaseOperation1Output { - s.TimeFormatInHeader = &v - return s -} - -type OutputService13TestShapeTimeContainer struct { - _ struct{} `type:"structure"` - - Bar *time.Time `locationName:"bar" type:"timestamp" timestampFormat:"unixTimestamp"` - - Foo *time.Time `locationName:"foo" type:"timestamp"` -} - -// SetBar sets the Bar field's value. -func (s *OutputService13TestShapeTimeContainer) SetBar(v time.Time) *OutputService13TestShapeTimeContainer { - s.Bar = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *OutputService13TestShapeTimeContainer) SetFoo(v time.Time) *OutputService13TestShapeTimeContainer { - s.Foo = &v - return s -} - -// OutputService14ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService14ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService14ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService14ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService14ProtocolTest client from just a session. -// svc := outputservice14protocoltest.New(mySession) -// -// // Create a OutputService14ProtocolTest client with additional configuration -// svc := outputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService14ProtocolTest { - c := p.ClientConfig("outputservice14protocoltest", cfgs...) - return newOutputService14ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService14ProtocolTest { - svc := &OutputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService14ProtocolTest", - ServiceID: "OutputService14ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService14ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService14TestCaseOperation1 = "OperationName" - -// OutputService14TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService14TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService14TestCaseOperation1 for more information on using the OutputService14TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService14TestCaseOperation1Request method. -// req, resp := client.OutputService14TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService14TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &OutputService14TestShapeOutputService14TestCaseOperation1Input{} - } - - output = &OutputService14TestShapeOutputService14TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService14TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService14TestCaseOperation1 for usage and error information. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { - req, out := c.OutputService14TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService14TestCaseOperation1WithContext is the same as OutputService14TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService14TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1WithContext(ctx aws.Context, input *OutputService14TestShapeOutputService14TestCaseOperation1Input, opts ...request.Option) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { - req, out := c.OutputService14TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opOutputService14TestCaseOperation2 = "OperationName" - -// OutputService14TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the OutputService14TestCaseOperation2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService14TestCaseOperation2 for more information on using the OutputService14TestCaseOperation2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService14TestCaseOperation2Request method. -// req, resp := client.OutputService14TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation2Request(input *OutputService14TestShapeOutputService14TestCaseOperation2Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation2Output) { - op := &request.Operation{ - Name: opOutputService14TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &OutputService14TestShapeOutputService14TestCaseOperation2Input{} - } - - output = &OutputService14TestShapeOutputService14TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// OutputService14TestCaseOperation2 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService14TestCaseOperation2 for usage and error information. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation2(input *OutputService14TestShapeOutputService14TestCaseOperation2Input) (*OutputService14TestShapeOutputService14TestCaseOperation2Output, error) { - req, out := c.OutputService14TestCaseOperation2Request(input) - return out, req.Send() -} - -// OutputService14TestCaseOperation2WithContext is the same as OutputService14TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService14TestCaseOperation2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation2WithContext(ctx aws.Context, input *OutputService14TestShapeOutputService14TestCaseOperation2Input, opts ...request.Option) (*OutputService14TestShapeOutputService14TestCaseOperation2Output, error) { - req, out := c.OutputService14TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService14TestShapeOutputService14TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService14TestShapeOutputService14TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - FooEnum *string `type:"string" enum:"OutputService14TestShapeRESTJSONEnumType"` - - HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"OutputService14TestShapeRESTJSONEnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation1Output) SetFooEnum(v string) *OutputService14TestShapeOutputService14TestCaseOperation1Output { - s.FooEnum = &v - return s -} - -// SetHeaderEnum sets the HeaderEnum field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation1Output) SetHeaderEnum(v string) *OutputService14TestShapeOutputService14TestCaseOperation1Output { - s.HeaderEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation1Output) SetListEnums(v []*string) *OutputService14TestShapeOutputService14TestCaseOperation1Output { - s.ListEnums = v - return s -} - -type OutputService14TestShapeOutputService14TestCaseOperation2Input struct { - _ struct{} `locationName:"OutputShape" type:"structure"` - - FooEnum *string `type:"string" enum:"OutputService14TestShapeRESTJSONEnumType"` - - HeaderEnum *string `location:"header" locationName:"x-amz-enum" type:"string" enum:"OutputService14TestShapeRESTJSONEnumType"` - - ListEnums []*string `type:"list"` -} - -// SetFooEnum sets the FooEnum field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation2Input) SetFooEnum(v string) *OutputService14TestShapeOutputService14TestCaseOperation2Input { - s.FooEnum = &v - return s -} - -// SetHeaderEnum sets the HeaderEnum field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation2Input) SetHeaderEnum(v string) *OutputService14TestShapeOutputService14TestCaseOperation2Input { - s.HeaderEnum = &v - return s -} - -// SetListEnums sets the ListEnums field's value. -func (s *OutputService14TestShapeOutputService14TestCaseOperation2Input) SetListEnums(v []*string) *OutputService14TestShapeOutputService14TestCaseOperation2Input { - s.ListEnums = v - return s -} - -type OutputService14TestShapeOutputService14TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -const ( - // RESTJSONEnumTypeFoo is a OutputService14TestShapeRESTJSONEnumType enum value - RESTJSONEnumTypeFoo = "foo" - - // RESTJSONEnumTypeBar is a OutputService14TestShapeRESTJSONEnumType enum value - RESTJSONEnumTypeBar = "bar" - - // RESTJSONEnumType0 is a OutputService14TestShapeRESTJSONEnumType enum value - RESTJSONEnumType0 = "0" - - // RESTJSONEnumType1 is a OutputService14TestShapeRESTJSONEnumType enum value - RESTJSONEnumType1 = "1" -) - -// OutputService15ProtocolTest provides the API operation methods for making requests to -// . See this package's package overview docs -// for details on the service. -// -// OutputService15ProtocolTest methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OutputService15ProtocolTest struct { - *client.Client -} - -// New creates a new instance of the OutputService15ProtocolTest client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// mySession := session.Must(session.NewSession()) -// -// // Create a OutputService15ProtocolTest client from just a session. -// svc := outputservice15protocoltest.New(mySession) -// -// // Create a OutputService15ProtocolTest client with additional configuration -// svc := outputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func NewOutputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService15ProtocolTest { - c := p.ClientConfig("outputservice15protocoltest", cfgs...) - return newOutputService15ProtocolTestClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OutputService15ProtocolTest { - svc := &OutputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "OutputService15ProtocolTest", - ServiceID: "OutputService15ProtocolTest", - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - return svc -} - -// newRequest creates a new request for a OutputService15ProtocolTest operation and runs any -// custom request initialization. -func (c *OutputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - return req -} - -const opOutputService15TestCaseOperation1 = "OperationName" - -// OutputService15TestCaseOperation1Request generates a "aws/request.Request" representing the -// client's request for the OutputService15TestCaseOperation1 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See OutputService15TestCaseOperation1 for more information on using the OutputService15TestCaseOperation1 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the OutputService15TestCaseOperation1Request method. -// req, resp := client.OutputService15TestCaseOperation1Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1Request(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (req *request.Request, output *OutputService15TestShapeOutputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opOutputService15TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &OutputService15TestShapeOutputService15TestCaseOperation1Input{} - } - - output = &OutputService15TestShapeOutputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService15TestCaseOperation1 API operation for . -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for 's -// API operation OutputService15TestCaseOperation1 for usage and error information. -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) { - req, out := c.OutputService15TestCaseOperation1Request(input) - return out, req.Send() -} - -// OutputService15TestCaseOperation1WithContext is the same as OutputService15TestCaseOperation1 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService15TestCaseOperation1 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1WithContext(ctx aws.Context, input *OutputService15TestShapeOutputService15TestCaseOperation1Input, opts ...request.Option) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) { - req, out := c.OutputService15TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService15TestShapeItemDetailShape struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - ID *string `type:"string"` - - // Type is a required field - Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"OutputService15TestShapeItemType"` -} - -// SetID sets the ID field's value. -func (s *OutputService15TestShapeItemDetailShape) SetID(v string) *OutputService15TestShapeItemDetailShape { - s.ID = &v - return s -} - -// SetType sets the Type field's value. -func (s *OutputService15TestShapeItemDetailShape) SetType(v string) *OutputService15TestShapeItemDetailShape { - s.Type = &v - return s -} - -type OutputService15TestShapeItemShape struct { - _ struct{} `type:"structure"` - - ItemDetail *OutputService15TestShapeItemDetailShape `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` -} - -// SetItemDetail sets the ItemDetail field's value. -func (s *OutputService15TestShapeItemShape) SetItemDetail(v *OutputService15TestShapeItemDetailShape) *OutputService15TestShapeItemShape { - s.ItemDetail = v - return s -} - -type OutputService15TestShapeOutputService15TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService15TestShapeOutputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - ListItems []*OutputService15TestShapeItemShape `locationName:"ItemsList" locationNameList:"Item" type:"list"` -} - -// SetListItems sets the ListItems field's value. -func (s *OutputService15TestShapeOutputService15TestCaseOperation1Output) SetListItems(v []*OutputService15TestShapeItemShape) *OutputService15TestShapeOutputService15TestCaseOperation1Output { - s.ListItems = v - return s -} - -const ( - // ItemTypeType1 is a OutputService15TestShapeItemType enum value - ItemTypeType1 = "Type1" - - // ItemTypeType2 is a OutputService15TestShapeItemType enum value - ItemTypeType2 = "Type2" - - // ItemTypeType3 is a OutputService15TestShapeItemType enum value - ItemTypeType3 = "Type3" -) - -// -// Tests begin here -// - -func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00ZaGVsbG8=")) - req, out := svc.OutputService1TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("BlobHeader", "aGVsbG8=") - req.HTTPResponse.Header.Set("ImaHeader", "test") - req.HTTPResponse.Header.Set("X-Foo", "abc") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "hello", string(out.Blob); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "hello", string(out.BlobHeader); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "a", *out.Char; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.3, *out.Double; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := false, *out.FalseBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.2, *out.Float; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "test", *out.ImaHeader; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "abc", *out.ImaHeaderLocation; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(200), *out.Long; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(123), *out.Num; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "myname", *out.Str; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := true, *out.TrueBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService1ProtocolTestScalarMembersCase2(t *testing.T) { - svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("123falsetrue1.21.3200a2015-01-25T08:00:00Z")) - req, out := svc.OutputService1TestCaseOperation2Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("ImaHeader", "test") - req.HTTPResponse.Header.Set("X-Foo", "abc") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "a", *out.Char; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.3, *out.Double; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := false, *out.FalseBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.2, *out.Float; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "test", *out.ImaHeader; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "abc", *out.ImaHeaderLocation; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(200), *out.Long; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(123), *out.Num; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "", *out.Str; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := true, *out.TrueBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { - svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("dmFsdWU=")) - req, out := svc.OutputService2TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "value", string(out.Blob); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService3ProtocolTestListsCase1(t *testing.T) { - svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123")) - req, out := svc.OutputService3TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { - svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123")) - req, out := svc.OutputService4TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { - svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123")) - req, out := svc.OutputService5TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.ListMember[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "123", *out.ListMember[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { - svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbam")) - req, out := svc.OutputService6TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"].Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { - svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbam")) - req, out := svc.OutputService7TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { - svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbam")) - req, out := svc.OutputService8TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "bam", *out.Map["baz"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "bar", *out.Map["qux"]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService9ProtocolTestXMLPayloadCase1(t *testing.T) { - svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc")) - req, out := svc.OutputService9TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("X-Foo", "baz") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", *out.Data.Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "baz", *out.Header; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService10ProtocolTestStreamingPayloadCase1(t *testing.T) { - svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc")) - req, out := svc.OutputService10TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "abc", string(out.Stream); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService11ProtocolTestScalarMembersInHeadersCase1(t *testing.T) { - svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("")) - req, out := svc.OutputService11TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("x-char", "a") - req.HTTPResponse.Header.Set("x-double", "1.5") - req.HTTPResponse.Header.Set("x-false-bool", "false") - req.HTTPResponse.Header.Set("x-float", "1.5") - req.HTTPResponse.Header.Set("x-int", "1") - req.HTTPResponse.Header.Set("x-long", "100") - req.HTTPResponse.Header.Set("x-str", "string") - req.HTTPResponse.Header.Set("x-timestamp", "Sun, 25 Jan 2015 08:00:00 GMT") - req.HTTPResponse.Header.Set("x-true-bool", "true") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "a", *out.Char; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.5, *out.Double; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := false, *out.FalseBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := 1.5, *out.Float; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(1), *out.Integer; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := int64(100), *out.Long; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "string", *out.Str; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := true, *out.TrueBool; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService12ProtocolTestEmptyStringCase1(t *testing.T) { - svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("requestid")) - req, out := svc.OutputService12TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "", *out.Foo; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService13ProtocolTestTimestampMembersCase1(t *testing.T) { - svc := NewOutputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("2014-04-29T18:30:38Z13987962382014-04-29T18:30:38ZTue, 29 Apr 2014 18:30:38 GMT1398796238requestid")) - req, out := svc.OutputService13TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("x-amz-timearg", "Tue, 29 Apr 2014 18:30:38 GMT") - req.HTTPResponse.Header.Set("x-amz-timecustom", "1398796238") - req.HTTPResponse.Header.Set("x-amz-timeformat", "1398796238") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Bar.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Foo.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeArg.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeArgInHeader.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeCustom.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeCustomInHeader.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeFormat.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeFormatInHeader.UTC().String(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService14ProtocolTestEnumCase1(t *testing.T) { - svc := NewOutputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("foo01")) - req, out := svc.OutputService14TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("x-amz-enum", "baz") - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "foo", *out.FooEnum; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "baz", *out.HeaderEnum; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "0", *out.ListEnums[0]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "1", *out.ListEnums[1]; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} - -func TestOutputService14ProtocolTestEnumCase2(t *testing.T) { - svc := NewOutputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("")) - req, out := svc.OutputService14TestCaseOperation2Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - -} - -func TestOutputService15ProtocolTestXMLAttributesCase1(t *testing.T) { - svc := NewOutputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("id1id2id3")) - req, out := svc.OutputService15TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - req.Handlers.UnmarshalMeta.Run(req) - req.Handlers.Unmarshal.Run(req) - if req.Error != nil { - t.Errorf("expect not error, got %v", req.Error) - } - - // assert response - if out == nil { - t.Errorf("expect not to be nil") - } - if e, a := "id1", *out.ListItems[0].ItemDetail.ID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "Type1", *out.ListItems[0].ItemDetail.Type; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "id2", *out.ListItems[1].ItemDetail.ID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "Type2", *out.ListItems[1].ItemDetail.Type; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "id3", *out.ListItems[2].ItemDetail.ID; e != a { - t.Errorf("expect %v, got %v", e, a) - } - if e, a := "Type3", *out.ListItems[2].ItemDetail.Type; e != a { - t.Errorf("expect %v, got %v", e, a) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp_test.go deleted file mode 100644 index 9211494..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// +build go1.7 - -package protocol - -import ( - "testing" - "time" -) - -func TestFormatTime(t *testing.T) { - cases := map[string]struct { - formatName string - expectedOutput string - input time.Time - }{ - "UnixTest1": { - formatName: UnixTimeFormatName, - expectedOutput: "946845296", - input: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "ISO8601Test1": { - formatName: ISO8601TimeFormatName, - expectedOutput: "2000-01-02T20:34:56Z", - input: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "RFC822Test1": { - formatName: RFC822TimeFormatName, - expectedOutput: "Sun, 02 Jan 2000 20:34:56 GMT", - input: time.Date(2000, time.January, 2, 20, 34, 56, 0, time.UTC), - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - if FormatTime(c.formatName, c.input) != c.expectedOutput { - t.Errorf("input and output time don't match for %s format ", c.formatName) - } - }) - } -} - -func TestParseTime(t *testing.T) { - //input and output times are considered equal if they are equal until three decimal places - cases := map[string]struct { - formatName, input string - expectedOutput time.Time - }{ - "UnixTest1": { - formatName: UnixTimeFormatName, - input: "946845296.123", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "UnixTest2": { - formatName: UnixTimeFormatName, - input: "946845296.12344", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "UnixTest3": { - formatName: UnixTimeFormatName, - input: "946845296.1229999", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "ISO8601Test1": { - formatName: ISO8601TimeFormatName, - input: "2000-01-02T20:34:56.123Z", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC), - }, - "ISO8601Test2": { - formatName: ISO8601TimeFormatName, - input: "2000-01-02T20:34:56.123456789Z", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, .123456789e9, time.UTC), - }, - "RFC822Test1": { - formatName: RFC822TimeFormatName, - input: "Sun, 2 Jan 2000 20:34:56 GMT", - expectedOutput: time.Date(2000, time.January, 2, 20, 34, 56, 0, time.UTC), - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - timeVal, err := ParseTime(c.formatName, c.input) - if err != nil { - t.Errorf("unable to parse time, %v", err) - } - if timeVal.UTC() != c.expectedOutput { - t.Errorf("input and output time don't match for %s format ", c.formatName) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_test.go deleted file mode 100644 index bd3e68f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_test.go +++ /dev/null @@ -1,165 +0,0 @@ -package protocol_test - -import ( - "io/ioutil" - "net/http" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/ec2query" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -type mockCloser struct { - *strings.Reader - Closed bool -} - -func (m *mockCloser) Close() error { - m.Closed = true - return nil -} - -func TestUnmarshalDrainBody(t *testing.T) { - b := &mockCloser{Reader: strings.NewReader("example body")} - r := &request.Request{HTTPResponse: &http.Response{ - Body: b, - }} - - protocol.UnmarshalDiscardBody(r) - if err := r.Error; err != nil { - t.Errorf("expect nil, %v", err) - } - if e, a := 0, b.Len(); e != a { - t.Errorf("expect %v, got %v", e, a) - } - if !b.Closed { - t.Errorf("expect true") - } -} - -func TestUnmarshalDrainBodyNoBody(t *testing.T) { - r := &request.Request{HTTPResponse: &http.Response{}} - - protocol.UnmarshalDiscardBody(r) - if err := r.Error; err != nil { - t.Errorf("expect nil, %v", err) - } -} - -func TestUnmarshalSeriaizationError(t *testing.T) { - - type testOutput struct { - _ struct{} - } - - cases := []struct { - name string - r request.Request - unmarshalFn func(*request.Request) - expectedError awserr.RequestFailure - }{ - { - name: "jsonrpc", - r: request.Request{ - Data: &testOutput{}, - HTTPResponse: &http.Response{ - StatusCode: 502, - Body: ioutil.NopCloser(strings.NewReader("invalid json")), - }, - }, - unmarshalFn: jsonrpc.Unmarshal, - expectedError: awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "", nil), - 502, - "", - ), - }, - { - name: "ec2query", - r: request.Request{ - Data: &testOutput{}, - HTTPResponse: &http.Response{ - StatusCode: 111, - Body: ioutil.NopCloser(strings.NewReader("<<>>>>>>")), - }, - }, - unmarshalFn: ec2query.Unmarshal, - expectedError: awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "", nil), - 111, - "", - ), - }, - { - name: "query", - r: request.Request{ - Operation: &request.Operation{ - Name: "Foo", - }, - Data: &testOutput{}, - HTTPResponse: &http.Response{ - StatusCode: 1, - Body: ioutil.NopCloser(strings.NewReader("<<>>>>>>")), - }, - }, - unmarshalFn: query.Unmarshal, - expectedError: awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "", nil), - 1, - "", - ), - }, - { - name: "restjson", - r: request.Request{ - Data: &testOutput{}, - HTTPResponse: &http.Response{ - StatusCode: 123, - Body: ioutil.NopCloser(strings.NewReader("invalid json")), - }, - }, - unmarshalFn: restjson.Unmarshal, - expectedError: awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "", nil), - 123, - "", - ), - }, - { - name: "restxml", - r: request.Request{ - Data: &testOutput{}, - HTTPResponse: &http.Response{ - StatusCode: 456, - Body: ioutil.NopCloser(strings.NewReader("<<>>>>>>")), - }, - }, - unmarshalFn: restxml.Unmarshal, - expectedError: awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "", nil), - 456, - "", - ), - }, - } - - for _, c := range cases { - c.unmarshalFn(&c.r) - - rfErr, ok := c.r.Error.(awserr.RequestFailure) - if !ok { - t.Errorf("%s: expected awserr.RequestFailure, but received %T", c.name, c.r.Error) - } - - if e, a := c.expectedError.StatusCode(), rfErr.StatusCode(); e != a { - t.Errorf("%s: expected %v, but received %v", c.name, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build_test.go deleted file mode 100644 index 0ab5b68..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build_test.go +++ /dev/null @@ -1,170 +0,0 @@ -// +build go1.7 - -package xmlutil - -import ( - "bytes" - "encoding/xml" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -type implicitPayload struct { - _ struct{} `type:"structure"` - - StrVal *string `type:"string"` - Second *nestedType `type:"structure"` - Third *nestedType `type:"structure"` -} - -type namedImplicitPayload struct { - _ struct{} `type:"structure" locationName:"namedPayload"` - - StrVal *string `type:"string"` - Second *nestedType `type:"structure"` - Third *nestedType `type:"structure"` -} - -type explicitPayload struct { - _ struct{} `type:"structure" payload:"Second"` - - Second *nestedType `type:"structure" locationName:"Second"` -} - -type useEmptyNested struct { - _ struct{} `type:"structure" locationName:"useEmptyNested"` - - StrVal *string `type:"string"` - Empty *emptyType `type:"structure"` -} - -type useIgnoreNested struct { - _ struct{} `type:"structure" locationName:"useIgnoreNested"` - StrVal *string `type:"string"` - Ignore *ignoreNested `type:"structure"` -} - -type skipNonPayload struct { - _ struct{} `type:"structure" locationName:"skipNonPayload"` - Field *string `type:"string" location:"header"` -} -type namedEmptyPayload struct { - _ struct{} `type:"structure" locationName:"namedEmptyPayload"` -} - -type nestedType struct { - _ struct{} `type:"structure"` - - IntVal *int64 `type:"integer"` - StrVal *string `type:"string"` -} - -type emptyType struct { - _ struct{} `type:"structure"` -} - -type ignoreNested struct { - _ struct{} `type:"structure"` - - IgnoreMe *string `type:"string" ignore:"true"` -} - -func TestBuildXML(t *testing.T) { - cases := map[string]struct { - Input interface{} - Expect string - }{ - "explicit payload": { - Input: &explicitPayload{ - Second: &nestedType{ - IntVal: aws.Int64(1234), - StrVal: aws.String("string value"), - }, - }, - Expect: `1234string value`, - }, - "implicit payload": { - Input: &implicitPayload{ - StrVal: aws.String("string value"), - Second: &nestedType{ - IntVal: aws.Int64(1111), - StrVal: aws.String("second string"), - }, - Third: &nestedType{ - IntVal: aws.Int64(2222), - StrVal: aws.String("third string"), - }, - }, - Expect: `1111second stringstring value2222third string`, - }, - "named implicit payload": { - Input: &namedImplicitPayload{ - StrVal: aws.String("string value"), - Second: &nestedType{ - IntVal: aws.Int64(1111), - StrVal: aws.String("second string"), - }, - Third: &nestedType{ - IntVal: aws.Int64(2222), - StrVal: aws.String("third string"), - }, - }, - Expect: `1111second stringstring value2222third string`, - }, - "empty with fields nested type": { - Input: &namedImplicitPayload{ - StrVal: aws.String("string value"), - Second: &nestedType{}, - Third: &nestedType{ - IntVal: aws.Int64(2222), - StrVal: aws.String("third string"), - }, - }, - Expect: `string value2222third string`, - }, - "empty no fields nested type": { - Input: &useEmptyNested{ - StrVal: aws.String("string value"), - Empty: &emptyType{}, - }, - Expect: `string value`, - }, - "ignored nested field": { - Input: &useIgnoreNested{ - StrVal: aws.String("string value"), - Ignore: &ignoreNested{ - IgnoreMe: aws.String("abc123"), - }, - }, - Expect: `string value`, - }, - "skip non payload root": { - Input: &skipNonPayload{ - Field: aws.String("value"), - }, - Expect: "", - }, - "skip empty root": { - Input: &emptyType{}, - Expect: "", - }, - "named empty payload": { - Input: &namedEmptyPayload{}, - Expect: "", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - var w bytes.Buffer - if err := buildXML(c.Input, xml.NewEncoder(&w), true); err != nil { - t.Fatalf("expect no error, %v", err) - } - - if e, a := c.Expect, w.String(); e != a { - t.Errorf("expect:\n%s\nactual:\n%s\n", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort_test.go deleted file mode 100644 index 91b87dd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package xmlutil - -import ( - "encoding/xml" - "reflect" - "sort" - "testing" -) - -func TestXmlAttrSlice(t *testing.T) { - tests := []struct { - input []xml.Attr - expected []xml.Attr - }{ - { - input: []xml.Attr{}, - expected: []xml.Attr{}, - }, - { - input: []xml.Attr{ - { - Name: xml.Name{ - Space: "foo", - Local: "bar", - }, - Value: "baz", - }, - { - Name: xml.Name{ - Space: "foo", - Local: "baz", - }, - Value: "bar", - }, - { - Name: xml.Name{ - Space: "foo", - Local: "bar", - }, - Value: "bar", - }, - { - Name: xml.Name{ - Space: "baz", - Local: "bar", - }, - Value: "foo", - }, - }, - expected: []xml.Attr{ - { - Name: xml.Name{ - Space: "baz", - Local: "bar", - }, - Value: "foo", - }, - { - Name: xml.Name{ - Space: "foo", - Local: "bar", - }, - Value: "bar", - }, - { - Name: xml.Name{ - Space: "foo", - Local: "bar", - }, - Value: "baz", - }, - { - Name: xml.Name{ - Space: "foo", - Local: "baz", - }, - Value: "bar", - }, - }, - }, - } - for i, tt := range tests { - sort.Sort(xmlAttrSlice(tt.input)) - if e, a := tt.expected, tt.input; !reflect.DeepEqual(e, a) { - t.Errorf("case %d expected %v, got %v", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal_test.go deleted file mode 100644 index 1185d23..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal_test.go +++ /dev/null @@ -1,142 +0,0 @@ -package xmlutil - -import ( - "encoding/xml" - "fmt" - "io" - "reflect" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" -) - -type mockBody struct { - DoneErr error - Body io.Reader -} - -func (m *mockBody) Read(p []byte) (int, error) { - n, err := m.Body.Read(p) - if (n == 0 || err == io.EOF) && m.DoneErr != nil { - return n, m.DoneErr - } - - return n, err -} - -type mockOutput struct { - _ struct{} `type:"structure"` - String *string `type:"string"` - Integer *int64 `type:"integer"` - Nested *mockNestedStruct `type:"structure"` - List []*mockListElem `locationName:"List" locationNameList:"Elem" type:"list"` - Closed *mockClosedTags `type:"structure"` -} -type mockNestedStruct struct { - _ struct{} `type:"structure"` - NestedString *string `type:"string"` - NestedInt *int64 `type:"integer"` -} -type mockClosedTags struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - Attr *string `locationName:"xsi:attrval" type:"string" xmlAttribute:"true"` -} -type mockListElem struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - String *string `type:"string"` - NestedElem *mockNestedListElem `type:"structure"` -} -type mockNestedListElem struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - String *string `type:"string"` - Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true"` -} - -func TestUnmarshal(t *testing.T) { - const xmlBodyStr = ` - - string value - 123 - - - nested string value - 321 - - - - - nested elem string value - - elem string value - - -` - - expect := mockOutput{ - String: aws.String("string value"), - Integer: aws.Int64(123), - Closed: &mockClosedTags{ - Attr: aws.String("attr value"), - }, - Nested: &mockNestedStruct{ - NestedString: aws.String("nested string value"), - NestedInt: aws.Int64(321), - }, - List: []*mockListElem{ - { - String: aws.String("elem string value"), - NestedElem: &mockNestedListElem{ - String: aws.String("nested elem string value"), - Type: aws.String("type"), - }, - }, - }, - } - - actual := mockOutput{} - decoder := xml.NewDecoder(strings.NewReader(xmlBodyStr)) - err := UnmarshalXML(&actual, decoder, "") - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if !reflect.DeepEqual(expect, actual) { - t.Errorf("expect unmarshal to match\nExpect: %s\nActual: %s", - awsutil.Prettify(expect), awsutil.Prettify(actual)) - } -} - -func TestUnmarshal_UnexpectedEOF(t *testing.T) { - const partialXMLBody = ` - first value - Second val` - - out := struct { - First *string `locationName:"First" type:"string"` - Second *string `locationName:"Second" type:"string"` - }{} - - expect := out - expect.First = aws.String("first") - expect.Second = aws.String("second") - - expectErr := fmt.Errorf("expected read error") - - body := &mockBody{ - DoneErr: expectErr, - Body: strings.NewReader(partialXMLBody), - } - - decoder := xml.NewDecoder(body) - err := UnmarshalXML(&out, decoder, "") - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := expectErr, err; e != a { - t.Errorf("expect %v error in %v, but was not", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/generate.go b/vendor/github.com/aws/aws-sdk-go/service/generate.go deleted file mode 100644 index 3ffc9fc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/generate.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package service contains automatically generated AWS clients. -package service - -//go:generate go run -tags codegen ../private/model/cli/gen-api/main.go -path=../service ../models/apis/*/*/api-2.json -//go:generate gofmt -s -w ../service diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index ea5dc6d..9859779 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -347,7 +347,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // encryption key. You can do this regardless of the form of server-side encryption // that was used to encrypt the source, or even if the source object was not // encrypted. For more information about server-side encryption, see Using Server-Side -// Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html). +// Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). // // A copy request might return an error when Amazon S3 receives the copy request // or while Amazon S3 is copying the files. If the error occurs before the copy @@ -429,13 +429,18 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // * To encrypt the target object using server-side encryption with an AWS // managed encryption key, provide the following request headers, as appropriate. // x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id -// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms -// but don't provide x-amz-server-side- encryption-aws-kms-key-id, Amazon -// S3 uses the AWS managed customer master key (CMK) in AWS KMS to protect -// the data. All GET and PUT requests for an object protected by AWS KMS -// fail if you don't make them with SSL or by using SigV4. For more information -// about server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see -// Protecting Data Using Server-Side Encryption with CMKs stored in KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests +// for an object protected by AWS KMS fail if you don't make them with SSL +// or by using SigV4. For more information about server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side +// Encryption with CMKs stored in KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). // // * To encrypt the target object using server-side encryption with an encryption // key that you provide, use the following headers. x-amz-server-side​-encryption​-customer-algorithm @@ -790,7 +795,7 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // manage the keys used to encrypt data, specify the following headers in // the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id // x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, -// but don't provide x-amz-server-side- encryption-aws-kms-key-id, Amazon +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon // S3 uses the AWS managed CMK in AWS KMS to protect the data. All GET and // PUT requests for an object protected by AWS KMS fail if you don't make // them with SSL or by using SigV4. For more information about server-side @@ -2026,7 +2031,7 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r // DeleteObjectTagging API operation for Amazon Simple Storage Service. // // Removes the entire tag set from the specified object. For more information -// about managing object tags, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete). +// about managing object tags, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). // // To use this operation, you must have permission to perform the s3:DeleteObjectTagging // action. @@ -6818,9 +6823,9 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r // This implementation of the PUT operation uses the encryption subresource // to set the default encryption state of an existing bucket. // -// This implementation of the PUT operation sets default encryption for a buckets +// This implementation of the PUT operation sets default encryption for a bucket // using server-side encryption with Amazon S3-managed keys SSE-S3 or AWS KMS -// customer master keys (CMKs) (SSE-KMS) bucket. +// customer master keys (CMKs) (SSE-KMS). // // This operation requires AWS Signature Version 4. For more information, see // Authenticating Requests (AWS Signature Version 4) (sig-v4-authenticating-requests.html). @@ -8454,19 +8459,24 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // manage the keys used to encrypt data, specify the following headers in // the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id // x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, -// but don't provide x-amz-server-side- encryption-aws-kms-key-id, Amazon -// S3 uses the AWS managed CMK in AWS KMS to protect the data. All GET and -// PUT requests for an object protected by AWS KMS fail if you don't make -// them with SSL or by using SigV4. For more information about server-side -// encryption with CMKs stored in AWS KMS (SSE-KMS), see Protecting Data -// Using Server-Side Encryption with CMKs stored in AWS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests +// for an object protected by AWS KMS fail if you don't make them with SSL +// or by using SigV4. For more information about server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side +// Encryption with CMKs stored in AWS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). // // * Use customer-provided encryption keys – If you want to manage your // own encryption keys, provide all the following headers in the request. // x-amz-server-side​-encryption​-customer-algorithm x-amz-server-side​-encryption​-customer-key // x-amz-server-side​-encryption​-customer-key-MD5 For more information // about server-side encryption with CMKs stored in KMS (SSE-KMS), see Protecting -// Data Using Server-Side Encryption with CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// Data Using Server-Side Encryption with CMKs stored in AWS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). // // Access-Control-List (ACL)-Specific Request Headers // @@ -8517,8 +8527,13 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // manage the keys used to encrypt data, specify the following headers in // the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id // x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, -// but don't provide x-amz-server-side- encryption-aws-kms-key-id, Amazon -// S3 uses the default AWS KMS CMK to protect the data. All GET and PUT requests +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests // for an object protected by AWS KMS fail if you don't make them with SSL // or by using SigV4. For more information about server-side encryption with // CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side @@ -9967,10 +9982,10 @@ type AbortMultipartUploadInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -11073,10 +11088,10 @@ type CompleteMultipartUploadInput struct { // The container for the multipart upload request information. MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -11201,7 +11216,8 @@ type CompleteMultipartUploadOutput struct { RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // If you specified server-side encryption either with an Amazon S3-managed @@ -11513,10 +11529,10 @@ type CopyObjectInput struct { // The date and time when you want the copied object's Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -11545,7 +11561,7 @@ type CopyObjectInput struct { // requests for an object protected by AWS KMS will fail if not made via SSL // or using SigV4. For information about configuring using any of the officially // supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request - // Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) // in the Amazon S3 Developer Guide. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -11895,7 +11911,8 @@ type CopyObjectOutput struct { SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -12275,10 +12292,10 @@ type CreateMultipartUploadInput struct { // Specifies the date and time when you want the Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -12303,11 +12320,11 @@ type CreateMultipartUploadInput struct { // encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT - // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. For information about configuring using any of the officially - // supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request - // Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // Specifies the ID of the symmetric customer managed AWS KMS CMK to use for + // object encryption. All GET and PUT requests for an object protected by AWS + // KMS will fail if not made via SSL or using SigV4. For information about configuring + // using any of the officially supported AWS SDKs and AWS CLI, see Specifying + // the Signature Version in Request Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) // in the Amazon S3 Developer Guide. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -12601,7 +12618,8 @@ type CreateMultipartUploadOutput struct { SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -13805,10 +13823,10 @@ type DeleteObjectInput struct { // delete enabled. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -14098,10 +14116,10 @@ type DeleteObjectsInput struct { // delete enabled. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` } @@ -14517,8 +14535,11 @@ type Encryption struct { // the encryption context for the restore results. KMSContext *string `type:"string"` - // If the encryption type is aws:kms, this optional value specifies the AWS - // KMS key ID to use for encryption of job results. + // If the encryption type is aws:kms, this optional value specifies the ID of + // the symmetric customer managed AWS KMS CMK to use for encryption of job results. + // Amazon S3 only supports symmetric CMKs. For more information, see Using Symmetric + // and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) + // in the AWS Key Management Service Developer Guide. KMSKeyId *string `type:"string" sensitive:"true"` } @@ -14568,8 +14589,12 @@ func (s *Encryption) SetKMSKeyId(v string) *Encryption { type EncryptionConfiguration struct { _ struct{} `type:"structure"` - // Specifies the AWS KMS Key ID (Key ARN or Alias ARN) for the destination bucket. - // Amazon S3 uses this key to encrypt replica objects. + // Specifies the ID (Key ARN or Alias ARN) of the customer managed customer + // master key (CMK) stored in AWS Key Management Service (KMS) for the destination + // bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only + // supports symmetric customer managed CMKs. For more information, see Using + // Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) + // in the AWS Key Management Service Developer Guide. ReplicaKmsKeyID *string `type:"string"` } @@ -16854,10 +16879,10 @@ type GetObjectAclInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -17029,10 +17054,10 @@ type GetObjectInput struct { // the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. Range *string `location:"header" locationName:"Range" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -17269,10 +17294,10 @@ type GetObjectLegalHoldInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -17562,7 +17587,8 @@ type GetObjectOutput struct { SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -17802,10 +17828,10 @@ type GetObjectRetentionInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -18056,10 +18082,10 @@ type GetObjectTorrentInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` } @@ -18532,10 +18558,10 @@ type HeadObjectInput struct { // the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. Range *string `location:"header" locationName:"Range" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -18828,7 +18854,8 @@ type HeadObjectOutput struct { SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // If the object is stored using server-side encryption either with an AWS KMS @@ -21676,10 +21703,10 @@ type ListPartsInput struct { // part numbers will be listed. PartNumberMarker *int64 `location:"querystring" locationName:"part-number-marker" type:"integer"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -25272,10 +25299,10 @@ type PutObjectAclInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -25522,10 +25549,10 @@ type PutObjectInput struct { // The date and time when you want this object's Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -25552,12 +25579,14 @@ type PutObjectInput struct { // If x-amz-server-side-encryption is present and has the value of aws:kms, // this header specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetrical customer managed customer master key (CMK) that was used for + // the object. // // If the value of x-amz-server-side-encryption is aws:kms, this header specifies - // the ID of the AWS KMS CMK that will be used for the object. If you specify - // x-amz-server-side-encryption:aws:kms, but do not providex-amz-server-side-encryption-aws-kms-key-id, - // Amazon S3 uses the AWS managed CMK in AWS to protect the data. + // the ID of the symmetric customer managed AWS KMS CMK that will be used for + // the object. If you specify x-amz-server-side-encryption:aws:kms, but do not + // providex-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the AWS + // managed CMK in AWS to protect the data. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -25858,10 +25887,10 @@ type PutObjectLegalHoldInput struct { // specified object. LegalHold *ObjectLockLegalHold `locationName:"LegalHold" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -25987,10 +26016,10 @@ type PutObjectLockConfigurationInput struct { // The Object Lock configuration that you want to apply to the specified bucket. ObjectLockConfiguration *ObjectLockConfiguration `locationName:"ObjectLockConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -26126,7 +26155,8 @@ type PutObjectOutput struct { // If x-amz-server-side-encryption is present and has the value of aws:kms, // this header specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // If you specified server-side encryption either with an AWS KMS customer master @@ -26228,10 +26258,10 @@ type PutObjectRetentionInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -27426,10 +27456,10 @@ type RestoreObjectInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -27849,8 +27879,8 @@ func (s *Rule) SetTransition(v *Transition) *Rule { type SSEKMS struct { _ struct{} `locationName:"SSE-KMS" type:"structure"` - // Specifies the ID of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use for encrypting inventory reports. + // Specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer + // managed customer master key (CMK) to use for encrypting inventory reports. // // KeyId is a required field KeyId *string `type:"string" required:"true" sensitive:"true"` @@ -29305,10 +29335,10 @@ type UploadPartCopyInput struct { // PartNumber is a required field PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -29538,7 +29568,8 @@ type UploadPartCopyOutput struct { SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -29629,10 +29660,10 @@ type UploadPartInput struct { // PartNumber is a required field PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -29812,7 +29843,7 @@ type UploadPartOutput struct { SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // If present, specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) was used for the object. + // symmetric customer managed customer master key (CMK) was used for the object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon @@ -30461,10 +30492,10 @@ const ( RequestChargedRequester = "requester" ) -// Confirms that the requester knows that she or he will be charged for the -// request. Bucket owners need not specify this parameter in their requests. -// For information about downloading objects from Requester Pays buckets, see -// Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) +// Confirms that the requester knows that they will be charged for the request. +// Bucket owners need not specify this parameter in their requests. For information +// about downloading objects from requester pays buckets, see Downloading Objects +// in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. const ( // RequestPayerRequester is a RequestPayer enum value diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bench_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bench_test.go deleted file mode 100644 index 890d3d7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/bench_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package s3 - -import ( - "bytes" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -func BenchmarkPresign_GetObject(b *testing.B) { - sess := unit.Session - svc := New(sess) - - for i := 0; i < b.N; i++ { - req, _ := svc.GetObjectRequest(&GetObjectInput{ - Bucket: aws.String("mock-bucket"), - Key: aws.String("mock-key"), - }) - - u, h, err := req.PresignRequest(15 * time.Minute) - if err != nil { - b.Fatalf("expect no error, got %v", err) - } - if len(u) == 0 { - b.Fatalf("expect url, got none") - } - if len(h) != 0 { - b.Fatalf("no signed headers, got %v", h) - } - } -} - -func BenchmarkPresign_PutObject(b *testing.B) { - sess := unit.Session - svc := New(sess) - - body := make([]byte, 1024*1024*20) - for i := 0; i < b.N; i++ { - req, _ := svc.PutObjectRequest(&PutObjectInput{ - Bucket: aws.String("mock-bucket"), - Key: aws.String("mock-key"), - Body: bytes.NewReader(body), - }) - - u, h, err := req.PresignRequest(15 * time.Minute) - if err != nil { - b.Fatalf("expect no error, got %v", err) - } - if len(u) == 0 { - b.Fatalf("expect url, got none") - } - if len(h) == 0 { - b.Fatalf("expect signed header, got none") - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash_test.go deleted file mode 100644 index cefdc6f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash_test.go +++ /dev/null @@ -1,523 +0,0 @@ -package s3 - -import ( - "bytes" - "crypto/md5" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -type errorReader struct{} - -func (errorReader) Read([]byte) (int, error) { - return 0, fmt.Errorf("errorReader error") -} -func (errorReader) Seek(int64, int) (int64, error) { - return 0, nil -} - -func TestComputeBodyHases(t *testing.T) { - bodyContent := []byte("bodyContent goes here") - - cases := []struct { - Req *request.Request - ExpectMD5 string - ExpectSHA256 string - Error string - DisableContentMD5 bool - Presigned bool - }{ - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "CqD6NNPvoNOBT/5pkjtzOw==", - ExpectSHA256: "3ff09c8b42a58a905e27835919ede45b61722e7cd400f30101bd9ed1a69a1825", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: func() http.Header { - h := http.Header{} - h.Set(contentMD5Header, "MD5AlreadySet") - return h - }(), - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "MD5AlreadySet", - ExpectSHA256: "3ff09c8b42a58a905e27835919ede45b61722e7cd400f30101bd9ed1a69a1825", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: func() http.Header { - h := http.Header{} - h.Set(contentSha256Header, "SHA256AlreadySet") - return h - }(), - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "CqD6NNPvoNOBT/5pkjtzOw==", - ExpectSHA256: "SHA256AlreadySet", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: func() http.Header { - h := http.Header{} - h.Set(contentMD5Header, "MD5AlreadySet") - h.Set(contentSha256Header, "SHA256AlreadySet") - return h - }(), - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "MD5AlreadySet", - ExpectSHA256: "SHA256AlreadySet", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - // Non-seekable reader - Body: aws.ReadSeekCloser(bytes.NewBuffer(bodyContent)), - }, - ExpectMD5: "", - ExpectSHA256: "", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - // Empty seekable body - Body: aws.ReadSeekCloser(bytes.NewReader(nil)), - }, - ExpectMD5: "1B2M2Y8AsgTpgAmY7PhCfg==", - ExpectSHA256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, - { - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - // failure while reading reader - Body: errorReader{}, - }, - ExpectMD5: "", - ExpectSHA256: "", - Error: "errorReader error", - }, - { - // Disabled ContentMD5 validation - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "", - ExpectSHA256: "", - DisableContentMD5: true, - }, - { - // Disabled ContentMD5 validation - Req: &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - Body: bytes.NewReader(bodyContent), - }, - ExpectMD5: "", - ExpectSHA256: "", - Presigned: true, - }, - } - - for i, c := range cases { - c.Req.Config.S3DisableContentMD5Validation = aws.Bool(c.DisableContentMD5) - - if c.Presigned { - c.Req.ExpireTime = 10 * time.Minute - } - computeBodyHashes(c.Req) - - if e, a := c.ExpectMD5, c.Req.HTTPRequest.Header.Get(contentMD5Header); e != a { - t.Errorf("%d, expect %v md5, got %v", i, e, a) - } - - if e, a := c.ExpectSHA256, c.Req.HTTPRequest.Header.Get(contentSha256Header); e != a { - t.Errorf("%d, expect %v sha256, got %v", i, e, a) - } - - if len(c.Error) != 0 { - if c.Req.Error == nil { - t.Fatalf("%d, expect error, got none", i) - } - if e, a := c.Error, c.Req.Error.Error(); !strings.Contains(a, e) { - t.Errorf("%d, expect %v error to be in %v", i, e, a) - } - - } else if c.Req.Error != nil { - t.Errorf("%d, expect no error, got %v", i, c.Req.Error) - } - } -} - -func BenchmarkComputeBodyHashes(b *testing.B) { - body := bytes.NewReader(make([]byte, 2*1024)) - req := &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - Body: body, - } - b.ResetTimer() - - for i := 0; i < b.N; i++ { - computeBodyHashes(req) - if req.Error != nil { - b.Fatalf("expect no error, got %v", req.Error) - } - - req.HTTPRequest.Header = http.Header{} - body.Seek(0, sdkio.SeekStart) - } -} - -func TestAskForTxEncodingAppendMD5(t *testing.T) { - cases := []struct { - DisableContentMD5 bool - Presigned bool - }{ - {DisableContentMD5: true}, - {DisableContentMD5: false}, - {Presigned: true}, - } - - for i, c := range cases { - req := &request.Request{ - HTTPRequest: &http.Request{ - Header: http.Header{}, - }, - Config: aws.Config{ - S3DisableContentMD5Validation: aws.Bool(c.DisableContentMD5), - }, - } - if c.Presigned { - req.ExpireTime = 10 * time.Minute - } - - askForTxEncodingAppendMD5(req) - - v := req.HTTPRequest.Header.Get(amzTeHeader) - - expectHeader := !(c.DisableContentMD5 || c.Presigned) - - if e, a := expectHeader, len(v) != 0; e != a { - t.Errorf("%d, expect %t disable content MD5, got %t, %s", i, e, a, v) - } - } -} - -func TestUseMD5ValidationReader(t *testing.T) { - body := []byte("create a really cool md5 checksum of me") - bodySum := md5.Sum(body) - bodyWithSum := append(body, bodySum[:]...) - - emptyBodySum := md5.Sum([]byte{}) - - cases := []struct { - Req *request.Request - Error string - Validate func(outupt interface{}) error - }{ - { - // Positive: Use Validation reader - Req: &request.Request{ - HTTPResponse: &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set(amzTxEncodingHeader, appendMD5TxEncoding) - return h - }(), - }, - Data: &GetObjectOutput{ - Body: ioutil.NopCloser(bytes.NewReader(bodyWithSum)), - ContentLength: aws.Int64(int64(len(bodyWithSum))), - }, - }, - Validate: func(output interface{}) error { - getObjOut := output.(*GetObjectOutput) - reader, ok := getObjOut.Body.(*md5ValidationReader) - if !ok { - return fmt.Errorf("expect %T updated body reader, got %T", - (*md5ValidationReader)(nil), getObjOut.Body) - } - - if reader.rawReader == nil { - return fmt.Errorf("expect rawReader not to be nil") - } - if reader.payload == nil { - return fmt.Errorf("expect payload not to be nil") - } - if e, a := int64(len(bodyWithSum)-md5.Size), reader.payloadLen; e != a { - return fmt.Errorf("expect %v payload len, got %v", e, a) - } - if reader.hash == nil { - return fmt.Errorf("expect hash not to be nil") - } - - return nil - }, - }, - { - // Positive: Use Validation reader, empty object - Req: &request.Request{ - HTTPResponse: &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set(amzTxEncodingHeader, appendMD5TxEncoding) - return h - }(), - }, - Data: &GetObjectOutput{ - Body: ioutil.NopCloser(bytes.NewReader(emptyBodySum[:])), - ContentLength: aws.Int64(int64(len(emptyBodySum[:]))), - }, - }, - Validate: func(output interface{}) error { - getObjOut := output.(*GetObjectOutput) - reader, ok := getObjOut.Body.(*md5ValidationReader) - if !ok { - return fmt.Errorf("expect %T updated body reader, got %T", - (*md5ValidationReader)(nil), getObjOut.Body) - } - - if reader.rawReader == nil { - return fmt.Errorf("expect rawReader not to be nil") - } - if reader.payload == nil { - return fmt.Errorf("expect payload not to be nil") - } - if e, a := int64(len(emptyBodySum)-md5.Size), reader.payloadLen; e != a { - return fmt.Errorf("expect %v payload len, got %v", e, a) - } - if reader.hash == nil { - return fmt.Errorf("expect hash not to be nil") - } - - return nil - }, - }, - { - // Negative: amzTxEncoding header not set - Req: &request.Request{ - HTTPResponse: &http.Response{ - Header: http.Header{}, - }, - Data: &GetObjectOutput{ - Body: ioutil.NopCloser(bytes.NewReader(body)), - ContentLength: aws.Int64(int64(len(body))), - }, - }, - Validate: func(output interface{}) error { - getObjOut := output.(*GetObjectOutput) - reader, ok := getObjOut.Body.(*md5ValidationReader) - if ok { - return fmt.Errorf("expect body reader not to be %T", - reader) - } - - return nil - }, - }, - { - // Negative: Not GetObjectOutput type. - Req: &request.Request{ - Operation: &request.Operation{ - Name: "PutObject", - }, - HTTPResponse: &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set(amzTxEncodingHeader, appendMD5TxEncoding) - return h - }(), - }, - Data: &PutObjectOutput{}, - }, - Error: "header received on unsupported API", - Validate: func(output interface{}) error { - _, ok := output.(*PutObjectOutput) - if !ok { - return fmt.Errorf("expect %T output not to change, got %T", - (*PutObjectOutput)(nil), output) - } - - return nil - }, - }, - { - // Negative: invalid content length. - Req: &request.Request{ - HTTPResponse: &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set(amzTxEncodingHeader, appendMD5TxEncoding) - return h - }(), - }, - Data: &GetObjectOutput{ - Body: ioutil.NopCloser(bytes.NewReader(bodyWithSum)), - ContentLength: aws.Int64(-1), - }, - }, - Error: "invalid Content-Length -1", - Validate: func(output interface{}) error { - getObjOut := output.(*GetObjectOutput) - reader, ok := getObjOut.Body.(*md5ValidationReader) - if ok { - return fmt.Errorf("expect body reader not to be %T", - reader) - } - return nil - }, - }, - { - // Negative: invalid content length, < md5.Size. - Req: &request.Request{ - HTTPResponse: &http.Response{ - Header: func() http.Header { - h := http.Header{} - h.Set(amzTxEncodingHeader, appendMD5TxEncoding) - return h - }(), - }, - Data: &GetObjectOutput{ - Body: ioutil.NopCloser(bytes.NewReader(make([]byte, 5))), - ContentLength: aws.Int64(5), - }, - }, - Error: "invalid Content-Length 5", - Validate: func(output interface{}) error { - getObjOut := output.(*GetObjectOutput) - reader, ok := getObjOut.Body.(*md5ValidationReader) - if ok { - return fmt.Errorf("expect body reader not to be %T", - reader) - } - return nil - }, - }, - } - - for i, c := range cases { - useMD5ValidationReader(c.Req) - if len(c.Error) != 0 { - if c.Req.Error == nil { - t.Fatalf("%d, expect error, got none", i) - } - if e, a := c.Error, c.Req.Error.Error(); !strings.Contains(a, e) { - t.Errorf("%d, expect %v error to be in %v", i, e, a) - } - } else if c.Req.Error != nil { - t.Errorf("%d, expect no error, got %v", i, c.Req.Error) - } - - if c.Validate != nil { - if err := c.Validate(c.Req.Data); err != nil { - t.Errorf("%d, expect Data to validate, got %v", i, err) - } - } - } -} - -func TestReaderMD5Validation(t *testing.T) { - body := []byte("create a really cool md5 checksum of me") - bodySum := md5.Sum(body) - bodyWithSum := append(body, bodySum[:]...) - emptyBodySum := md5.Sum([]byte{}) - badBodySum := append(body, emptyBodySum[:]...) - - cases := []struct { - Content []byte - ContentReader io.ReadCloser - PayloadLen int64 - Error string - }{ - { - Content: bodyWithSum, - PayloadLen: int64(len(body)), - }, - { - Content: emptyBodySum[:], - PayloadLen: 0, - }, - { - Content: badBodySum, - PayloadLen: int64(len(body)), - Error: "expected MD5 checksum", - }, - { - Content: emptyBodySum[:len(emptyBodySum)-2], - PayloadLen: 0, - Error: "unexpected EOF", - }, - { - Content: body, - PayloadLen: int64(len(body) * 2), - Error: "unexpected EOF", - }, - { - ContentReader: ioutil.NopCloser(errorReader{}), - PayloadLen: int64(len(body)), - Error: "errorReader error", - }, - } - - for i, c := range cases { - reader := c.ContentReader - if reader == nil { - reader = ioutil.NopCloser(bytes.NewReader(c.Content)) - } - v := newMD5ValidationReader(reader, c.PayloadLen) - - var actual bytes.Buffer - n, err := io.Copy(&actual, v) - if len(c.Error) != 0 { - if err == nil { - t.Errorf("%d, expect error, got none", i) - } - if e, a := c.Error, err.Error(); !strings.Contains(a, e) { - t.Errorf("%d, expect %v error to be in %v", i, e, a) - } - continue - } else if err != nil { - t.Errorf("%d, expect no error, got %v", i, err) - continue - } - if e, a := c.PayloadLen, n; e != a { - t.Errorf("%d, expect %v len, got %v", i, e, a) - } - - if e, a := c.Content[:c.PayloadLen], actual.Bytes(); !bytes.Equal(e, a) { - t.Errorf("%d, expect:\n%v\nactual:\n%v", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location_test.go deleted file mode 100644 index 92ef8f4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package s3_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -var s3LocationTests = []struct { - body string - loc string -}{ - {``, ``}, - {`EU`, `EU`}, -} - -func TestGetBucketLocation(t *testing.T) { - for _, test := range s3LocationTests { - s := s3.New(unit.Session) - s.Handlers.Send.Clear() - s.Handlers.Send.PushBack(func(r *request.Request) { - reader := ioutil.NopCloser(bytes.NewReader([]byte(test.body))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: reader} - }) - - resp, err := s.GetBucketLocation(&s3.GetBucketLocationInput{Bucket: aws.String("bucket")}) - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - if test.loc == "" { - if v := resp.LocationConstraint; v != nil { - t.Errorf("expect location constraint to be nil, got %s", *v) - } - } else { - if e, a := test.loc, *resp.LocationConstraint; e != a { - t.Errorf("expect %s location constraint, got %v", e, a) - } - } - } -} - -func TestNormalizeBucketLocation(t *testing.T) { - cases := []struct { - In, Out string - }{ - {"", "us-east-1"}, - {"EU", "eu-west-1"}, - {"us-east-1", "us-east-1"}, - {"something", "something"}, - } - - for i, c := range cases { - actual := s3.NormalizeBucketLocation(c.In) - if e, a := c.Out, actual; e != a { - t.Errorf("%d, expect %s bucket location, got %s", i, e, a) - } - } -} - -func TestWithNormalizeBucketLocation(t *testing.T) { - req := &request.Request{} - req.ApplyOptions(s3.WithNormalizeBucketLocation) - - cases := []struct { - In, Out string - }{ - {"", "us-east-1"}, - {"EU", "eu-west-1"}, - {"us-east-1", "us-east-1"}, - {"something", "something"}, - } - - for i, c := range cases { - req.Data = &s3.GetBucketLocationOutput{ - LocationConstraint: aws.String(c.In), - } - req.Handlers.Unmarshal.Run(req) - - v := req.Data.(*s3.GetBucketLocationOutput).LocationConstraint - if e, a := c.Out, aws.StringValue(v); e != a { - t.Errorf("%d, expect %s bucket location, got %s", i, e, a) - } - } -} - -func TestPopulateLocationConstraint(t *testing.T) { - s := s3.New(unit.Session) - in := &s3.CreateBucketInput{ - Bucket: aws.String("bucket"), - } - req, _ := s.CreateBucketRequest(in) - if err := req.Build(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - if e, a := "mock-region", *(v[0].(*string)); e != a { - t.Errorf("expect %s location constraint, got %s", e, a) - } - if v := in.CreateBucketConfiguration; v != nil { - // don't modify original params - t.Errorf("expect create bucket Configuration to be nil, got %s", *v) - } -} - -func TestNoPopulateLocationConstraintIfProvided(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.CreateBucketRequest(&s3.CreateBucketInput{ - Bucket: aws.String("bucket"), - CreateBucketConfiguration: &s3.CreateBucketConfiguration{}, - }) - if err := req.Build(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - if l := len(v); l != 0 { - t.Errorf("expect no values, got %d", l) - } -} - -func TestNoPopulateLocationConstraintIfClassic(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{Region: aws.String("us-east-1")}) - req, _ := s.CreateBucketRequest(&s3.CreateBucketInput{ - Bucket: aws.String("bucket"), - }) - if err := req.Build(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - if l := len(v); l != 0 { - t.Errorf("expect no values, got %d", l) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_endpoint_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_endpoint_test.go deleted file mode 100644 index f0c9f46..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_endpoint_test.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build integration - -package s3_test - -import ( - "testing" -) - -func TestInteg_AccessPoint_WriteToObject(t *testing.T) { - testWriteToObject(t, integMetadata.AccessPoints.Source.ARN) -} - -func TestInteg_AccessPoint_PresignedGetPut(t *testing.T) { - testPresignedGetPut(t, integMetadata.AccessPoints.Source.ARN) -} - -func TestInteg_AccessPoint_CopyObject(t *testing.T) { - t.Skip("API does not support access point") - testCopyObject(t, - integMetadata.AccessPoints.Source.ARN, - integMetadata.AccessPoints.Target.ARN) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_eventstream_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_eventstream_test.go deleted file mode 100644 index 40a5b70..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_eventstream_test.go +++ /dev/null @@ -1,267 +0,0 @@ -// +build integration - -package s3_test - -import ( - "bytes" - "encoding/csv" - "io" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/sdkio" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestInteg_SelectObjectContent(t *testing.T) { - keyName := "selectObject.csv" - - var header = []byte("A,B,C,D,E,F,G,H,I,J\n") - var recordRow = []byte("0,0,0.5,217.371,217.658,218.002,269.445,487.447,2.106,489.554\n") - - buf := make([]byte, 0, 6*sdkio.MebiByte) - buf = append(buf, []byte(header)...) - for i := 0; i < (cap(buf)/len(recordRow))-1; i++ { - buf = append(buf, recordRow...) - } - - // Put a mock CSV file to the S3 bucket so that its contents can be - // selected. - putTestContent(t, bytes.NewReader(buf), keyName) - - resp, err := s3Svc.SelectObjectContent(&s3.SelectObjectContentInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: &keyName, - Expression: aws.String("Select * from S3Object"), - ExpressionType: aws.String(s3.ExpressionTypeSql), - InputSerialization: &s3.InputSerialization{ - CSV: &s3.CSVInput{ - FieldDelimiter: aws.String(","), - FileHeaderInfo: aws.String(s3.FileHeaderInfoIgnore), - }, - }, - OutputSerialization: &s3.OutputSerialization{ - CSV: &s3.CSVOutput{ - FieldDelimiter: aws.String(","), - }, - }, - }) - if err != nil { - t.Fatalf("expect no error, %v", err) - } - defer resp.EventStream.Close() - - recReader, recWriter := io.Pipe() - - var sum int64 - var processed int64 - - var gotEndEvent bool - go func(w *io.PipeWriter, resp *s3.SelectObjectContentOutput) { - defer recWriter.Close() - var numRecordEvents int64 - for event := range resp.EventStream.Events() { - switch tv := event.(type) { - case *s3.RecordsEvent: - n, err := recWriter.Write(tv.Payload) - if err != nil { - t.Logf("failed to write to record writer, %v, %v", n, err) - } - sum += int64(n) - numRecordEvents++ - case *s3.StatsEvent: - processed = *tv.Details.BytesProcessed - case *s3.EndEvent: - gotEndEvent = true - t.Logf("s3.EndEvent received") - } - } - t.Logf("received %d record events", numRecordEvents) - }(recWriter, resp) - - type Record []string - - records := make(chan []Record) - go func(r io.Reader, records chan<- []Record, batchSize int) { - defer close(records) - - csvReader := csv.NewReader(r) - var count int64 - - batch := make([]Record, 0, batchSize) - for { - count++ - record, err := csvReader.Read() - if err != nil { - if _, ok := err.(*csv.ParseError); ok { - t.Logf("failed to decode record row, %v, %v", count, err) - continue - } - if err != io.EOF { - t.Logf("csv decode failed, %v", err) - } - err = nil - break - } - batch = append(batch, record) - if len(batch) >= batchSize { - records <- batch - batch = batch[0:0] - } - } - if len(batch) != 0 { - records <- batch - } - }(recReader, records, 10) - - var count int64 - for batch := range records { - // To simulate processing of a batch, add sleep delay. - count += int64(len(batch)) - - if err := resp.EventStream.Err(); err != nil { - t.Errorf("exect no error, got %v", err) - } - } - - if !gotEndEvent { - t.Errorf("expected EndEvent, did not receive") - } - - if e, a := int64(101474), count; e != a { - t.Errorf("expect %d records, got %d", e, a) - } - - if sum == 0 { - t.Errorf("expect selected content, got none") - } - - if processed == 0 { - t.Errorf("expect selected status bytes processed, got none") - } - - if err := resp.EventStream.Err(); err != nil { - t.Fatalf("expect no error, got %v", err) - } -} - -func TestInteg_SelectObjectContent_Error(t *testing.T) { - keyName := "negativeSelect.csv" - - buf := make([]byte, 0, 6*sdkio.MebiByte) - buf = append(buf, []byte("name,number\n")...) - line := []byte("jj,0\n") - for i := 0; i < (cap(buf)/len(line))-2; i++ { - buf = append(buf, line...) - } - buf = append(buf, []byte("gg,NaN\n")...) - - putTestContent(t, bytes.NewReader(buf), keyName) - - resp, err := s3Svc.SelectObjectContent(&s3.SelectObjectContentInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: &keyName, - Expression: aws.String("SELECT name FROM S3Object WHERE cast(number as int) < 1"), - ExpressionType: aws.String(s3.ExpressionTypeSql), - InputSerialization: &s3.InputSerialization{ - CSV: &s3.CSVInput{ - FileHeaderInfo: aws.String(s3.FileHeaderInfoUse), - }, - }, - OutputSerialization: &s3.OutputSerialization{ - CSV: &s3.CSVOutput{ - FieldDelimiter: aws.String(","), - }, - }, - }) - if err != nil { - t.Fatalf("expect no error, %v", err) - } - defer resp.EventStream.Close() - - var sum int64 - for event := range resp.EventStream.Events() { - switch tv := event.(type) { - case *s3.RecordsEvent: - sum += int64(len(tv.Payload)) - } - } - - if sum == 0 { - t.Errorf("expect selected content") - } - - err = resp.EventStream.Err() - if err == nil { - t.Fatalf("exepct error") - } - - aerr := err.(awserr.Error) - if a := aerr.Code(); len(a) == 0 { - t.Errorf("expect, error code") - } - if a := aerr.Message(); len(a) == 0 { - t.Errorf("expect, error message") - } -} - -func TestInteg_SelectObjectContent_Stream(t *testing.T) { - keyName := "selectGopher.csv" - - buf := `name,number -gopher,0 -ᵷodɥǝɹ,1 -` - // Put a mock CSV file to the S3 bucket so that its contents can be - // selected. - putTestContent(t, strings.NewReader(buf), keyName) - - // Make the Select Object Content API request using the object uploaded. - resp, err := s3Svc.SelectObjectContent(&s3.SelectObjectContentInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: &keyName, - Expression: aws.String("SELECT name FROM S3Object WHERE cast(number as int) < 1"), - ExpressionType: aws.String(s3.ExpressionTypeSql), - InputSerialization: &s3.InputSerialization{ - CSV: &s3.CSVInput{ - FileHeaderInfo: aws.String(s3.FileHeaderInfoUse), - }, - }, - OutputSerialization: &s3.OutputSerialization{ - CSV: &s3.CSVOutput{}, - }, - }) - if err != nil { - t.Fatalf("failed making API request, %v\n", err) - } - defer resp.EventStream.Close() - - results, resultWriter := io.Pipe() - go func() { - defer resultWriter.Close() - for event := range resp.EventStream.Events() { - switch e := event.(type) { - case *s3.RecordsEvent: - resultWriter.Write(e.Payload) - case *s3.StatsEvent: - t.Logf("Processed %d bytes\n", *e.Details.BytesProcessed) - } - } - }() - - // Printout the results - resReader := csv.NewReader(results) - for { - record, err := resReader.Read() - if err == io.EOF { - break - } - t.Log(record) - } - - if err := resp.EventStream.Err(); err != nil { - t.Fatalf("reading from event stream failed, %v\n", err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_object_checksum_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_object_checksum_test.go deleted file mode 100644 index 290bc9c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_object_checksum_test.go +++ /dev/null @@ -1,102 +0,0 @@ -// +build integration - -package s3_test - -import ( - "bytes" - "crypto/md5" - "encoding/base64" - "fmt" - "io" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" -) - -func base64Sum(content []byte) string { - sum := md5.Sum(content) - return base64.StdEncoding.EncodeToString(sum[:]) -} - -func SkipTestContentMD5Validate(t *testing.T) { - body := []byte("really cool body content") - - cases := []struct { - Name string - Body []byte - Sum64 string - RangeGet []int64 - }{ - { - Body: body, - Sum64: base64Sum(body), - Name: "contentMD5validation.pop", - }, - { - Body: []byte{}, - Sum64: base64Sum([]byte{}), - Name: "contentMD5validation.empty", - }, - { - Body: body, - Sum64: base64Sum(body), - RangeGet: []int64{0, 9}, - Name: "contentMD5validation.range", - }, - } - - for i, c := range cases { - keyName := aws.String(c.Name) - req, _ := s3Svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: keyName, - Body: bytes.NewReader(c.Body), - }) - - req.Build() - if e, a := c.Sum64, req.HTTPRequest.Header.Get("Content-Md5"); e != a { - t.Errorf("%d, expect %v sum, got %v", i, e, a) - } - - if err := req.Send(); err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - getObjIn := &s3.GetObjectInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: keyName, - } - - expectBody := c.Body - if c.RangeGet != nil { - getObjIn.Range = aws.String(fmt.Sprintf("bytes=%d-%d", c.RangeGet[0], c.RangeGet[1]-1)) - expectBody = c.Body[c.RangeGet[0]:c.RangeGet[1]] - } - - getReq, getOut := s3Svc.GetObjectRequest(getObjIn) - - getReq.Build() - if e, a := "append-md5", getReq.HTTPRequest.Header.Get("X-Amz-Te"); e != a { - t.Errorf("%d, expect %v encoding, got %v", i, e, a) - } - if err := getReq.Send(); err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - defer getOut.Body.Close() - - if e, a := "append-md5", getReq.HTTPResponse.Header.Get("X-Amz-Transfer-Encoding"); e != a { - t.Fatalf("%d, expect response tx encoding header %v, got %v", i, e, a) - } - - var readBody bytes.Buffer - _, err := io.Copy(&readBody, getOut.Body) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - - if e, a := expectBody, readBody.Bytes(); !bytes.Equal(e, a) { - t.Errorf("%d, expect %v body, got %v", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_shared_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_shared_test.go deleted file mode 100644 index adf34f6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_shared_test.go +++ /dev/null @@ -1,432 +0,0 @@ -// +build integration - -package s3_test - -import ( - "bytes" - "context" - "crypto/tls" - "flag" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "reflect" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/integration" - "github.com/aws/aws-sdk-go/awstesting/integration/s3integ" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3control" - "github.com/aws/aws-sdk-go/service/sts" -) - -const integBucketPrefix = "aws-sdk-go-integration" - -var integMetadata = struct { - AccountID string - Region string - Buckets struct { - Source struct { - Name string - ARN string - } - Target struct { - Name string - ARN string - } - } - - AccessPoints struct { - Source struct { - Name string - ARN string - } - Target struct { - Name string - ARN string - } - } -}{} - -var s3Svc *s3.S3 -var s3ControlSvc *s3control.S3Control -var stsSvc *sts.STS -var httpClient *http.Client - -// TODO: (Westeros) Remove Custom Resolver Usage Before Launch -type customS3Resolver struct { - endpoint string - withTLS bool - region string -} - -func (r customS3Resolver) EndpointFor(service, _ string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - switch strings.ToLower(service) { - case "s3-control": - case "s3": - default: - return endpoints.ResolvedEndpoint{}, fmt.Errorf("unsupported in custom resolver") - } - - return endpoints.ResolvedEndpoint{ - PartitionID: "aws", - SigningRegion: r.region, - SigningName: "s3", - SigningMethod: "s3v4", - URL: endpoints.AddScheme(r.endpoint, r.withTLS), - }, nil -} - -func TestMain(m *testing.M) { - var result int - defer func() { - if r := recover(); r != nil { - fmt.Fprintln(os.Stderr, "S3 integration tests paniced,", r) - result = 1 - } - os.Exit(result) - }() - - var verifyTLS bool - var s3Endpoint, s3ControlEndpoint string - var s3EnableTLS, s3ControlEnableTLS bool - - flag.StringVar(&s3Endpoint, "s3-endpoint", "", "integration endpoint for S3") - flag.BoolVar(&s3EnableTLS, "s3-tls", true, "enable TLS for S3 endpoint") - - flag.StringVar(&s3ControlEndpoint, "s3-control-endpoint", "", "integration endpoint for S3") - flag.BoolVar(&s3ControlEnableTLS, "s3-control-tls", true, "enable TLS for S3 control endpoint") - - flag.StringVar(&integMetadata.AccountID, "account", "", "integration account id") - flag.BoolVar(&verifyTLS, "verify-tls", true, "verify server TLS certificate") - flag.Parse() - - httpClient = &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: verifyTLS}, - }} - - sess := integration.SessionWithDefaultRegion("us-west-2").Copy(&aws.Config{ - HTTPClient: httpClient, - }) - - var s3EndpointResolver endpoints.Resolver - if len(s3Endpoint) != 0 { - s3EndpointResolver = customS3Resolver{ - endpoint: s3Endpoint, - withTLS: s3EnableTLS, - region: aws.StringValue(sess.Config.Region), - } - } - s3Svc = s3.New(sess, &aws.Config{ - DisableSSL: aws.Bool(!s3EnableTLS), - EndpointResolver: s3EndpointResolver, - }) - - var s3ControlEndpointResolver endpoints.Resolver - if len(s3Endpoint) != 0 { - s3ControlEndpointResolver = customS3Resolver{ - endpoint: s3ControlEndpoint, - withTLS: s3ControlEnableTLS, - region: aws.StringValue(sess.Config.Region), - } - } - s3ControlSvc = s3control.New(sess, &aws.Config{ - DisableSSL: aws.Bool(!s3ControlEnableTLS), - EndpointResolver: s3ControlEndpointResolver, - }) - stsSvc = sts.New(sess) - - var err error - integMetadata.AccountID, err = getAccountID() - if err != nil { - fmt.Fprintf(os.Stderr, "failed to get integration aws account id: %v\n", err) - result = 1 - return - } - - bucketCleanup, err := setupBuckets() - defer bucketCleanup() - if err != nil { - fmt.Fprintf(os.Stderr, "failed to setup integration test buckets: %v\n", err) - result = 1 - return - } - - accessPointsCleanup, err := setupAccessPoints() - defer accessPointsCleanup() - if err != nil { - fmt.Fprintf(os.Stderr, "failed to setup integration test access points: %v\n", err) - result = 1 - return - } - - result = m.Run() -} - -func getAccountID() (string, error) { - if len(integMetadata.AccountID) != 0 { - return integMetadata.AccountID, nil - } - - output, err := stsSvc.GetCallerIdentity(nil) - if err != nil { - return "", fmt.Errorf("faield to get sts caller identity") - } - - return *output.Account, nil -} - -func setupBuckets() (func(), error) { - var cleanups []func() - - cleanup := func() { - for i := range cleanups { - cleanups[i]() - } - } - - bucketCreates := []struct { - name *string - arn *string - }{ - {name: &integMetadata.Buckets.Source.Name, arn: &integMetadata.Buckets.Source.ARN}, - {name: &integMetadata.Buckets.Target.Name, arn: &integMetadata.Buckets.Target.ARN}, - } - - for _, bucket := range bucketCreates { - *bucket.name = s3integ.GenerateBucketName() - - if err := s3integ.SetupBucket(s3Svc, *bucket.name); err != nil { - return cleanup, err - } - - // Compute ARN - bARN := arn.ARN{ - Partition: "aws", - Service: "s3", - Region: s3Svc.SigningRegion, - AccountID: integMetadata.AccountID, - Resource: fmt.Sprintf("bucket_name:%s", *bucket.name), - }.String() - - *bucket.arn = bARN - - bucketName := *bucket.name - cleanups = append(cleanups, func() { - if err := s3integ.CleanupBucket(s3Svc, bucketName); err != nil { - fmt.Fprintln(os.Stderr, err) - } - }) - } - - return cleanup, nil -} - -func setupAccessPoints() (func(), error) { - var cleanups []func() - - cleanup := func() { - for i := range cleanups { - cleanups[i]() - } - } - - creates := []struct { - bucket string - name *string - arn *string - }{ - {bucket: integMetadata.Buckets.Source.Name, name: &integMetadata.AccessPoints.Source.Name, arn: &integMetadata.AccessPoints.Source.ARN}, - {bucket: integMetadata.Buckets.Target.Name, name: &integMetadata.AccessPoints.Target.Name, arn: &integMetadata.AccessPoints.Target.ARN}, - } - - for _, ap := range creates { - *ap.name = integration.UniqueID() - - err := s3integ.SetupAccessPoint(s3ControlSvc, integMetadata.AccountID, ap.bucket, *ap.name) - if err != nil { - return cleanup, err - } - - // Compute ARN - apARN := arn.ARN{ - Partition: "aws", - Service: "s3", - Region: s3ControlSvc.SigningRegion, - AccountID: integMetadata.AccountID, - Resource: fmt.Sprintf("accesspoint:%s", *ap.name), - }.String() - - *ap.arn = apARN - - apName := *ap.name - cleanups = append(cleanups, func() { - err := s3integ.CleanupAccessPoint(s3ControlSvc, integMetadata.AccountID, apName) - if err != nil { - fmt.Fprintln(os.Stderr, err) - } - }) - } - - return cleanup, nil -} - -func putTestFile(t *testing.T, filename, key string, opts ...request.Option) { - f, err := os.Open(filename) - if err != nil { - t.Fatalf("failed to open testfile, %v", err) - } - defer f.Close() - - putTestContent(t, f, key, opts...) -} - -func putTestContent(t *testing.T, reader io.ReadSeeker, key string, opts ...request.Option) { - t.Logf("uploading test file %s/%s", integMetadata.Buckets.Source.Name, key) - _, err := s3Svc.PutObjectWithContext(context.Background(), - &s3.PutObjectInput{ - Bucket: &integMetadata.Buckets.Source.Name, - Key: aws.String(key), - Body: reader, - }, opts...) - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} - -func testWriteToObject(t *testing.T, bucket string, opts ...request.Option) { - key := integration.UniqueID() - - _, err := s3Svc.PutObjectWithContext(context.Background(), - &s3.PutObjectInput{ - Bucket: &bucket, - Key: &key, - Body: bytes.NewReader([]byte("hello world")), - }, opts...) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - resp, err := s3Svc.GetObjectWithContext(context.Background(), - &s3.GetObjectInput{ - Bucket: &bucket, - Key: &key, - }, opts...) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - b, _ := ioutil.ReadAll(resp.Body) - if e, a := []byte("hello world"), b; !bytes.Equal(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} - -func testPresignedGetPut(t *testing.T, bucket string, opts ...request.Option) { - key := integration.UniqueID() - - putreq, _ := s3Svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: &bucket, - Key: &key, - }) - putreq.ApplyOptions(opts...) - var err error - - // Presign a PUT request - var puturl string - puturl, err = putreq.Presign(5 * time.Minute) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - // PUT to the presigned URL with a body - var puthttpreq *http.Request - buf := bytes.NewReader([]byte("hello world")) - puthttpreq, err = http.NewRequest("PUT", puturl, buf) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - var putresp *http.Response - putresp, err = httpClient.Do(puthttpreq) - if err != nil { - t.Errorf("expect put with presign url no error, got %v", err) - } - if e, a := 200, putresp.StatusCode; e != a { - t.Fatalf("expect %v, got %v", e, a) - } - - // Presign a GET on the same URL - getreq, _ := s3Svc.GetObjectRequest(&s3.GetObjectInput{ - Bucket: &bucket, - Key: &key, - }) - getreq.ApplyOptions(opts...) - - var geturl string - geturl, err = getreq.Presign(300 * time.Second) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - // Get the body - var getresp *http.Response - getresp, err = httpClient.Get(geturl) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - var b []byte - defer getresp.Body.Close() - b, err = ioutil.ReadAll(getresp.Body) - if e, a := "hello world", string(b); e != a { - t.Fatalf("expect %v, got %v", e, a) - } -} - -func testCopyObject(t *testing.T, sourceBucket string, targetBucket string, opts ...request.Option) { - key := integration.UniqueID() - - _, err := s3Svc.PutObjectWithContext(context.Background(), - &s3.PutObjectInput{ - Bucket: &sourceBucket, - Key: &key, - Body: bytes.NewReader([]byte("hello world")), - }, opts...) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - _, err = s3Svc.CopyObjectWithContext(context.Background(), - &s3.CopyObjectInput{ - Bucket: &targetBucket, - CopySource: aws.String("/" + sourceBucket + "/" + key), - Key: &key, - }, opts...) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - resp, err := s3Svc.GetObjectWithContext(context.Background(), - &s3.GetObjectInput{ - Bucket: &targetBucket, - Key: &key, - }, opts...) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - b, _ := ioutil.ReadAll(resp.Body) - if e, a := []byte("hello world"), b; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_test.go deleted file mode 100644 index f4598a9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/cust_integ_test.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build integration - -package s3_test - -import ( - "testing" -) - -func TestInteg_WriteToObject(t *testing.T) { - testWriteToObject(t, integMetadata.Buckets.Source.Name) -} - -func TestInteg_PresignedGetPut(t *testing.T) { - testPresignedGetPut(t, integMetadata.Buckets.Source.Name) -} - -func TestInteg_CopyObject(t *testing.T) { - testCopyObject(t, integMetadata.Buckets.Source.Name, integMetadata.Buckets.Target.Name) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations_test.go deleted file mode 100644 index 6272961..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations_test.go +++ /dev/null @@ -1,175 +0,0 @@ -package s3_test - -import ( - "crypto/md5" - "encoding/base64" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func assertMD5(t *testing.T, req *request.Request) { - err := req.Build() - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - b, _ := ioutil.ReadAll(req.HTTPRequest.Body) - out := md5.Sum(b) - if len(b) == 0 { - t.Error("expected non-empty value") - } - if e, a := base64.StdEncoding.EncodeToString(out[:]), req.HTTPRequest.Header.Get("Content-MD5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestMD5InPutBucketCors(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.PutBucketCorsRequest(&s3.PutBucketCorsInput{ - Bucket: aws.String("bucketname"), - CORSConfiguration: &s3.CORSConfiguration{ - CORSRules: []*s3.CORSRule{ - { - AllowedMethods: []*string{aws.String("GET")}, - AllowedOrigins: []*string{aws.String("*")}, - }, - }, - }, - }) - assertMD5(t, req) -} - -func TestMD5InPutBucketLifecycle(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.PutBucketLifecycleRequest(&s3.PutBucketLifecycleInput{ - Bucket: aws.String("bucketname"), - LifecycleConfiguration: &s3.LifecycleConfiguration{ - Rules: []*s3.Rule{ - { - ID: aws.String("ID"), - Prefix: aws.String("Prefix"), - Status: aws.String("Enabled"), - }, - }, - }, - }) - assertMD5(t, req) -} - -func TestMD5InPutBucketPolicy(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.PutBucketPolicyRequest(&s3.PutBucketPolicyInput{ - Bucket: aws.String("bucketname"), - Policy: aws.String("{}"), - }) - assertMD5(t, req) -} - -func TestMD5InPutBucketTagging(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.PutBucketTaggingRequest(&s3.PutBucketTaggingInput{ - Bucket: aws.String("bucketname"), - Tagging: &s3.Tagging{ - TagSet: []*s3.Tag{ - {Key: aws.String("KEY"), Value: aws.String("VALUE")}, - }, - }, - }) - assertMD5(t, req) -} - -func TestMD5InDeleteObjects(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.DeleteObjectsRequest(&s3.DeleteObjectsInput{ - Bucket: aws.String("bucketname"), - Delete: &s3.Delete{ - Objects: []*s3.ObjectIdentifier{ - {Key: aws.String("key")}, - }, - }, - }) - assertMD5(t, req) -} - -func TestMD5InPutBucketLifecycleConfiguration(t *testing.T) { - svc := s3.New(unit.Session) - req, _ := svc.PutBucketLifecycleConfigurationRequest(&s3.PutBucketLifecycleConfigurationInput{ - Bucket: aws.String("bucketname"), - LifecycleConfiguration: &s3.BucketLifecycleConfiguration{ - Rules: []*s3.LifecycleRule{ - {Prefix: aws.String("prefix"), Status: aws.String(s3.ExpirationStatusEnabled)}, - }, - }, - }) - assertMD5(t, req) -} - -const ( - metaKeyPrefix = `X-Amz-Meta-` - utf8KeySuffix = `My-Info` - utf8Value = "hello-世界\u0444" -) - -func TestPutObjectMetadataWithUnicode(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if e, a := utf8Value, r.Header.Get(metaKeyPrefix+utf8KeySuffix); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - })) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }) - - _, err := svc.PutObject(&s3.PutObjectInput{ - Bucket: aws.String("my_bucket"), - Key: aws.String("my_key"), - Body: strings.NewReader(""), - Metadata: func() map[string]*string { - v := map[string]*string{} - v[utf8KeySuffix] = aws.String(utf8Value) - return v - }(), - }) - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } -} - -func TestGetObjectMetadataWithUnicode(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(metaKeyPrefix+utf8KeySuffix, utf8Value) - })) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }) - - resp, err := svc.GetObject(&s3.GetObjectInput{ - Bucket: aws.String("my_bucket"), - Key: aws.String("my_key"), - }) - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - resp.Body.Close() - - if e, a := utf8Value, *resp.Metadata[utf8KeySuffix]; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_test.go deleted file mode 100644 index e37a2a8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_test.go +++ /dev/null @@ -1,232 +0,0 @@ -// +build go1.7 - -package s3 - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" -) - -func TestEndpointARN(t *testing.T) { - cases := map[string]struct { - bucket string - config *aws.Config - expectedEndpoint string - expectedSigningName string - expectedSigningRegion string - expectedErr string - }{ - "AccessPoint": { - bucket: "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.us-west-2.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-west-2", - }, - "AccessPoint other partition": { - bucket: "arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("cn-north-1"), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.cn-north-1.amazonaws.com.cn", - expectedSigningName: "s3", - expectedSigningRegion: "cn-north-1", - }, - "AccessPoint Cross-Region Disabled": { - bucket: "arn:aws:s3:ap-south-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - }, - expectedErr: "client region does not match provided ARN region", - }, - "AccessPoint Cross-Region Enabled": { - bucket: "arn:aws:s3:ap-south-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - S3UseARNRegion: aws.Bool(true), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.ap-south-1.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "ap-south-1", - }, - "AccessPoint us-east-1": { - bucket: "arn:aws:s3:us-east-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-east-1"), - S3UseARNRegion: aws.Bool(true), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.us-east-1.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-east-1", - }, - "AccessPoint us-east-1 cross region": { - bucket: "arn:aws:s3:us-east-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - S3UseARNRegion: aws.Bool(true), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.us-east-1.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-east-1", - }, - "AccessPoint Cross-Partition not supported": { - bucket: "arn:aws-cn:s3:cn-north-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - UseDualStack: aws.Bool(true), - S3UseARNRegion: aws.Bool(true), - }, - expectedErr: "client partition does not match provided ARN partition", - }, - "AccessPoint DualStack": { - bucket: "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - UseDualStack: aws.Bool(true), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint.dualstack.us-west-2.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-west-2", - }, - "AccessPoint FIPS same region with cross region disabled": { - bucket: "arn:aws-us-gov:s3:us-gov-west-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("fips-us-gov-west-1"), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint-fips-us-gov-west-1.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-gov-west-1", - }, - "AccessPoint FIPS same region with cross region enabled": { - bucket: "arn:aws-us-gov:s3:us-gov-west-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("fips-us-gov-west-1"), - S3UseARNRegion: aws.Bool(true), - }, - expectedEndpoint: "https://myendpoint-123456789012.s3-accesspoint-fips-us-gov-west-1.amazonaws.com", - expectedSigningName: "s3", - expectedSigningRegion: "us-gov-west-1", - }, - "AccessPoint FIPS cross region not supported": { - bucket: "arn:aws-us-gov:s3:us-gov-east-1:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("fips-us-gov-west-1"), - S3UseARNRegion: aws.Bool(true), - }, - expectedErr: "client configured for FIPS", - }, - "AccessPoint Accelerate not supported": { - bucket: "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - S3UseAccelerate: aws.Bool(true), - }, - expectedErr: "client configured for S3 Accelerate", - }, - "Custom Resolver Without PartitionID in ClientInfo": { - bucket: "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-west-2"), - EndpointResolver: endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - switch region { - case "us-west-2": - return endpoints.ResolvedEndpoint{ - URL: "s3.us-west-2.amazonaws.com", - SigningRegion: "us-west-2", - SigningName: service, - SigningMethod: "s3v4", - }, nil - } - return endpoints.ResolvedEndpoint{}, nil - }), - }, - expectedErr: "client partition does not match provided ARN partition", - }, - "Custom Resolver Without PartitionID in Cross-Region Target": { - bucket: "arn:aws:s3:us-west-2:123456789012:accesspoint:myendpoint", - config: &aws.Config{ - Region: aws.String("us-east-1"), - S3UseARNRegion: aws.Bool(true), - EndpointResolver: endpoints.ResolverFunc( - func(service, region string, opts ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { - switch region { - case "us-west-2": - return endpoints.ResolvedEndpoint{ - URL: "s3.us-west-2.amazonaws.com", - PartitionID: "aws", - SigningRegion: "us-west-2", - SigningName: service, - SigningMethod: "s3v4", - }, nil - case "us-east-1": - return endpoints.ResolvedEndpoint{ - URL: "s3.us-east-1.amazonaws.com", - SigningRegion: "us-east-1", - SigningName: service, - SigningMethod: "s3v4", - }, nil - } - - return endpoints.ResolvedEndpoint{}, nil - }), - }, - expectedErr: "client partition does not match provided ARN partition", - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - sess := unit.Session.Copy(c.config) - - svc := New(sess) - req, _ := svc.GetObjectRequest(&GetObjectInput{ - Bucket: &c.bucket, - Key: aws.String("testkey"), - }) - req.Handlers.Send.Clear() - req.Handlers.Send.PushBack(func(r *request.Request) { - defer func() { - r.HTTPResponse = &http.Response{ - StatusCode: 200, - ContentLength: 0, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - } - }() - if len(c.expectedErr) != 0 { - return - } - - endpoint := fmt.Sprintf("%s://%s", r.HTTPRequest.URL.Scheme, r.HTTPRequest.URL.Host) - if e, a := c.expectedEndpoint, endpoint; e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := c.expectedSigningName, r.ClientInfo.SigningName; e != a { - t.Errorf("expected %v, got %v", e, a) - } - if e, a := c.expectedSigningRegion, r.ClientInfo.SigningRegion; e != a { - t.Errorf("expected %v, got %v", e, a) - } - }) - err := req.Send() - if len(c.expectedErr) == 0 && err != nil { - t.Errorf("expected no error but got: %v", err) - } else if len(c.expectedErr) != 0 && err == nil { - t.Errorf("expected err %q, but got nil", c.expectedErr) - } else if len(c.expectedErr) != 0 && err != nil && !strings.Contains(err.Error(), c.expectedErr) { - t.Errorf("expected %v, got %v", c.expectedErr, err.Error()) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_example_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_example_test.go deleted file mode 100644 index 498c76e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_example_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package s3 - -import ( - "encoding/csv" - "fmt" - "io" - "os" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" -) - -func ExampleS3_SelectObjectContent() { - sess := session.Must(session.NewSession()) - svc := New(sess) - - /* - Example myObjectKey CSV content: - - name,number - gopher,0 - ᵷodɥǝɹ,1 - */ - - // Make the Select Object Content API request using the object uploaded. - resp, err := svc.SelectObjectContent(&SelectObjectContentInput{ - Bucket: aws.String("myBucket"), - Key: aws.String("myObjectKey"), - Expression: aws.String("SELECT name FROM S3Object WHERE cast(number as int) < 1"), - ExpressionType: aws.String(ExpressionTypeSql), - InputSerialization: &InputSerialization{ - CSV: &CSVInput{ - FileHeaderInfo: aws.String(FileHeaderInfoUse), - }, - }, - OutputSerialization: &OutputSerialization{ - CSV: &CSVOutput{}, - }, - }) - if err != nil { - fmt.Fprintf(os.Stderr, "failed making API request, %v\n", err) - return - } - defer resp.EventStream.Close() - - results, resultWriter := io.Pipe() - go func() { - defer resultWriter.Close() - for event := range resp.EventStream.Events() { - switch e := event.(type) { - case *RecordsEvent: - resultWriter.Write(e.Payload) - case *StatsEvent: - fmt.Printf("Processed %d bytes\n", *e.Details.BytesProcessed) - } - } - }() - - // Printout the results - resReader := csv.NewReader(results) - for { - record, err := resReader.Read() - if err == io.EOF { - break - } - fmt.Println(record) - } - - if err := resp.EventStream.Err(); err != nil { - fmt.Fprintf(os.Stderr, "reading from event stream failed, %v\n", err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_test.go deleted file mode 100644 index 35f3056..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/eventstream_test.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// +build go1.6 - -package s3 - -import ( - "bytes" - "io/ioutil" - "net/http" - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" - "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" - "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamtest" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -var _ time.Time -var _ awserr.Error - -func TestSelectObjectContent_Read(t *testing.T) { - expectEvents, eventMsgs := mockSelectObjectContentReadEvents() - sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, - eventstreamtest.ServeEventStream{ - T: t, - Events: eventMsgs, - }, - true, - ) - if err != nil { - t.Fatalf("expect no error, %v", err) - } - defer cleanupFn() - - svc := New(sess) - resp, err := svc.SelectObjectContent(nil) - if err != nil { - t.Fatalf("expect no error got, %v", err) - } - defer resp.EventStream.Close() - - var i int - for event := range resp.EventStream.Events() { - if event == nil { - t.Errorf("%d, expect event, got nil", i) - } - if e, a := expectEvents[i], event; !reflect.DeepEqual(e, a) { - t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a) - } - i++ - } - - if err := resp.EventStream.Err(); err != nil { - t.Errorf("expect no error, %v", err) - } -} - -func TestSelectObjectContent_ReadClose(t *testing.T) { - _, eventMsgs := mockSelectObjectContentReadEvents() - sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, - eventstreamtest.ServeEventStream{ - T: t, - Events: eventMsgs, - }, - true, - ) - if err != nil { - t.Fatalf("expect no error, %v", err) - } - defer cleanupFn() - - svc := New(sess) - resp, err := svc.SelectObjectContent(nil) - if err != nil { - t.Fatalf("expect no error got, %v", err) - } - - // Assert calling Err before close does not close the stream. - resp.EventStream.Err() - select { - case _, ok := <-resp.EventStream.Events(): - if !ok { - t.Fatalf("expect stream not to be closed, but was") - } - default: - } - - resp.EventStream.Close() - <-resp.EventStream.Events() - - if err := resp.EventStream.Err(); err != nil { - t.Errorf("expect no error, %v", err) - } -} - -func BenchmarkSelectObjectContent_Read(b *testing.B) { - _, eventMsgs := mockSelectObjectContentReadEvents() - var buf bytes.Buffer - encoder := eventstream.NewEncoder(&buf) - for _, msg := range eventMsgs { - if err := encoder.Encode(msg); err != nil { - b.Fatalf("failed to encode message, %v", err) - } - } - stream := &loopReader{source: bytes.NewReader(buf.Bytes())} - - sess := unit.Session - svc := New(sess, &aws.Config{ - Endpoint: aws.String("https://example.com"), - DisableParamValidation: aws.Bool(true), - }) - svc.Handlers.Send.Swap(corehandlers.SendHandler.Name, - request.NamedHandler{Name: "mockSend", - Fn: func(r *request.Request) { - r.HTTPResponse = &http.Response{ - Status: "200 OK", - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(stream), - } - }, - }, - ) - - resp, err := svc.SelectObjectContent(nil) - if err != nil { - b.Fatalf("failed to create request, %v", err) - } - defer resp.EventStream.Close() - b.ResetTimer() - - for i := 0; i < b.N; i++ { - if err = resp.EventStream.Err(); err != nil { - b.Fatalf("expect no error, got %v", err) - } - event := <-resp.EventStream.Events() - if event == nil { - b.Fatalf("expect event, got nil, %v, %d", resp.EventStream.Err(), i) - } - } -} - -func mockSelectObjectContentReadEvents() ( - []SelectObjectContentEventStreamEvent, - []eventstream.Message, -) { - expectEvents := []SelectObjectContentEventStreamEvent{ - &ContinuationEvent{}, - &EndEvent{}, - &ProgressEvent{ - Details: &Progress{ - BytesProcessed: aws.Int64(1234), - BytesReturned: aws.Int64(1234), - BytesScanned: aws.Int64(1234), - }, - }, - &RecordsEvent{ - Payload: []byte("blob value goes here"), - }, - &StatsEvent{ - Details: &Stats{ - BytesProcessed: aws.Int64(1234), - BytesReturned: aws.Int64(1234), - BytesScanned: aws.Int64(1234), - }, - }, - } - - var marshalers request.HandlerList - marshalers.PushBackNamed(restxml.BuildHandler) - payloadMarshaler := protocol.HandlerPayloadMarshal{ - Marshalers: marshalers, - } - _ = payloadMarshaler - - eventMsgs := []eventstream.Message{ - { - Headers: eventstream.Headers{ - eventstreamtest.EventMessageTypeHeader, - { - Name: eventstreamapi.EventTypeHeader, - Value: eventstream.StringValue("Cont"), - }, - }, - }, - { - Headers: eventstream.Headers{ - eventstreamtest.EventMessageTypeHeader, - { - Name: eventstreamapi.EventTypeHeader, - Value: eventstream.StringValue("End"), - }, - }, - }, - { - Headers: eventstream.Headers{ - eventstreamtest.EventMessageTypeHeader, - { - Name: eventstreamapi.EventTypeHeader, - Value: eventstream.StringValue("Progress"), - }, - }, - Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[2]), - }, - { - Headers: eventstream.Headers{ - eventstreamtest.EventMessageTypeHeader, - { - Name: eventstreamapi.EventTypeHeader, - Value: eventstream.StringValue("Records"), - }, - }, - Payload: expectEvents[3].(*RecordsEvent).Payload, - }, - { - Headers: eventstream.Headers{ - eventstreamtest.EventMessageTypeHeader, - { - Name: eventstreamapi.EventTypeHeader, - Value: eventstream.StringValue("Stats"), - }, - }, - Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[4]), - }, - } - - return expectEvents, eventMsgs -} - -type loopReader struct { - source *bytes.Reader -} - -func (c *loopReader) Read(p []byte) (int, error) { - if c.source.Len() == 0 { - c.source.Seek(0, 0) - } - - return c.source.Read(p) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go deleted file mode 100644 index b06c045..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go +++ /dev/null @@ -1,2237 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3_test - -import ( - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -var _ time.Duration -var _ strings.Reader -var _ aws.Config - -func parseTime(layout, value string) *time.Time { - t, err := time.Parse(layout, value) - if err != nil { - panic(err) - } - return &t -} - -// To abort a multipart upload -// -// The following example aborts a multipart upload. -func ExampleS3_AbortMultipartUpload_shared00() { - svc := s3.New(session.New()) - input := &s3.AbortMultipartUploadInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("bigobject"), - UploadId: aws.String("xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--"), - } - - result, err := svc.AbortMultipartUpload(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchUpload: - fmt.Println(s3.ErrCodeNoSuchUpload, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To complete multipart upload -// -// The following example completes a multipart upload. -func ExampleS3_CompleteMultipartUpload_shared00() { - svc := s3.New(session.New()) - input := &s3.CompleteMultipartUploadInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("bigobject"), - MultipartUpload: &s3.CompletedMultipartUpload{ - Parts: []*s3.CompletedPart{ - { - ETag: aws.String("\"d8c2eafd90c266e19ab9dcacc479f8af\""), - PartNumber: aws.Int64(1), - }, - { - ETag: aws.String("\"d8c2eafd90c266e19ab9dcacc479f8af\""), - PartNumber: aws.Int64(2), - }, - }, - }, - UploadId: aws.String("7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--"), - } - - result, err := svc.CompleteMultipartUpload(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To copy an object -// -// The following example copies an object from one bucket to another. -func ExampleS3_CopyObject_shared00() { - svc := s3.New(session.New()) - input := &s3.CopyObjectInput{ - Bucket: aws.String("destinationbucket"), - CopySource: aws.String("/sourcebucket/HappyFacejpg"), - Key: aws.String("HappyFaceCopyjpg"), - } - - result, err := svc.CopyObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeObjectNotInActiveTierError: - fmt.Println(s3.ErrCodeObjectNotInActiveTierError, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To create a bucket -// -// The following example creates a bucket. -func ExampleS3_CreateBucket_shared00() { - svc := s3.New(session.New()) - input := &s3.CreateBucketInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.CreateBucket(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeBucketAlreadyExists: - fmt.Println(s3.ErrCodeBucketAlreadyExists, aerr.Error()) - case s3.ErrCodeBucketAlreadyOwnedByYou: - fmt.Println(s3.ErrCodeBucketAlreadyOwnedByYou, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To create a bucket in a specific region -// -// The following example creates a bucket. The request specifies an AWS region where -// to create the bucket. -func ExampleS3_CreateBucket_shared01() { - svc := s3.New(session.New()) - input := &s3.CreateBucketInput{ - Bucket: aws.String("examplebucket"), - CreateBucketConfiguration: &s3.CreateBucketConfiguration{ - LocationConstraint: aws.String("eu-west-1"), - }, - } - - result, err := svc.CreateBucket(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeBucketAlreadyExists: - fmt.Println(s3.ErrCodeBucketAlreadyExists, aerr.Error()) - case s3.ErrCodeBucketAlreadyOwnedByYou: - fmt.Println(s3.ErrCodeBucketAlreadyOwnedByYou, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To initiate a multipart upload -// -// The following example initiates a multipart upload. -func ExampleS3_CreateMultipartUpload_shared00() { - svc := s3.New(session.New()) - input := &s3.CreateMultipartUploadInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("largeobject"), - } - - result, err := svc.CreateMultipartUpload(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete a bucket -// -// The following example deletes the specified bucket. -func ExampleS3_DeleteBucket_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketInput{ - Bucket: aws.String("forrandall2"), - } - - result, err := svc.DeleteBucket(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete cors configuration on a bucket. -// -// The following example deletes CORS configuration on a bucket. -func ExampleS3_DeleteBucketCors_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketCorsInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.DeleteBucketCors(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete lifecycle configuration on a bucket. -// -// The following example deletes lifecycle configuration on a bucket. -func ExampleS3_DeleteBucketLifecycle_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketLifecycleInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.DeleteBucketLifecycle(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete bucket policy -// -// The following example deletes bucket policy on the specified bucket. -func ExampleS3_DeleteBucketPolicy_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketPolicyInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.DeleteBucketPolicy(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete bucket replication configuration -// -// The following example deletes replication configuration set on bucket. -func ExampleS3_DeleteBucketReplication_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketReplicationInput{ - Bucket: aws.String("example"), - } - - result, err := svc.DeleteBucketReplication(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete bucket tags -// -// The following example deletes bucket tags. -func ExampleS3_DeleteBucketTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketTaggingInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.DeleteBucketTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete bucket website configuration -// -// The following example deletes bucket website configuration. -func ExampleS3_DeleteBucketWebsite_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteBucketWebsiteInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.DeleteBucketWebsite(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete an object (from a non-versioned bucket) -// -// The following example deletes an object from a non-versioned bucket. -func ExampleS3_DeleteObject_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectInput{ - Bucket: aws.String("ExampleBucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.DeleteObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete an object -// -// The following example deletes an object from an S3 bucket. -func ExampleS3_DeleteObject_shared01() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("objectkey.jpg"), - } - - result, err := svc.DeleteObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To remove tag set from an object version -// -// The following example removes tag set associated with the specified object version. -// The request specifies both the object key and object version. -func ExampleS3_DeleteObjectTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectTaggingInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - VersionId: aws.String("ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"), - } - - result, err := svc.DeleteObjectTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To remove tag set from an object -// -// The following example removes tag set associated with the specified object. If the -// bucket is versioning enabled, the operation removes tag set from the latest object -// version. -func ExampleS3_DeleteObjectTagging_shared01() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectTaggingInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.DeleteObjectTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete multiple objects from a versioned bucket -// -// The following example deletes objects from a bucket. The bucket is versioned, and -// the request does not specify the object version to delete. In this case, all versions -// remain in the bucket and S3 adds a delete marker. -func ExampleS3_DeleteObjects_shared00() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectsInput{ - Bucket: aws.String("examplebucket"), - Delete: &s3.Delete{ - Objects: []*s3.ObjectIdentifier{ - { - Key: aws.String("objectkey1"), - }, - { - Key: aws.String("objectkey2"), - }, - }, - Quiet: aws.Bool(false), - }, - } - - result, err := svc.DeleteObjects(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To delete multiple object versions from a versioned bucket -// -// The following example deletes objects from a bucket. The request specifies object -// versions. S3 deletes specific object versions and returns the key and versions of -// deleted objects in the response. -func ExampleS3_DeleteObjects_shared01() { - svc := s3.New(session.New()) - input := &s3.DeleteObjectsInput{ - Bucket: aws.String("examplebucket"), - Delete: &s3.Delete{ - Objects: []*s3.ObjectIdentifier{ - { - Key: aws.String("HappyFace.jpg"), - VersionId: aws.String("2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b"), - }, - { - Key: aws.String("HappyFace.jpg"), - VersionId: aws.String("yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd"), - }, - }, - Quiet: aws.Bool(false), - }, - } - - result, err := svc.DeleteObjects(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get cors configuration set on a bucket -// -// The following example returns cross-origin resource sharing (CORS) configuration -// set on a bucket. -func ExampleS3_GetBucketCors_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketCorsInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketCors(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get a bucket acl -// -// The following example gets ACL on the specified bucket. -func ExampleS3_GetBucketLifecycle_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketLifecycleInput{ - Bucket: aws.String("acl1"), - } - - result, err := svc.GetBucketLifecycle(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get lifecycle configuration on a bucket -// -// The following example retrieves lifecycle configuration on set on a bucket. -func ExampleS3_GetBucketLifecycleConfiguration_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketLifecycleConfigurationInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketLifecycleConfiguration(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get bucket location -// -// The following example returns bucket location. -func ExampleS3_GetBucketLocation_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketLocationInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketLocation(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get notification configuration set on a bucket -// -// The following example returns notification configuration set on a bucket. -func ExampleS3_GetBucketNotification_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketNotificationConfigurationRequest{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketNotification(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get notification configuration set on a bucket -// -// The following example returns notification configuration set on a bucket. -func ExampleS3_GetBucketNotification_shared01() { - svc := s3.New(session.New()) - input := &s3.GetBucketNotificationConfigurationRequest{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketNotification(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get bucket policy -// -// The following example returns bucket policy associated with a bucket. -func ExampleS3_GetBucketPolicy_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketPolicyInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketPolicy(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get replication configuration set on a bucket -// -// The following example returns replication configuration set on a bucket. -func ExampleS3_GetBucketReplication_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketReplicationInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketReplication(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get bucket versioning configuration -// -// The following example retrieves bucket versioning configuration. -func ExampleS3_GetBucketRequestPayment_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketRequestPaymentInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketRequestPayment(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get tag set associated with a bucket -// -// The following example returns tag set associated with a bucket -func ExampleS3_GetBucketTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketTaggingInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get bucket versioning configuration -// -// The following example retrieves bucket versioning configuration. -func ExampleS3_GetBucketVersioning_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketVersioningInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketVersioning(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get bucket website configuration -// -// The following example retrieves website configuration of a bucket. -func ExampleS3_GetBucketWebsite_shared00() { - svc := s3.New(session.New()) - input := &s3.GetBucketWebsiteInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.GetBucketWebsite(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve a byte range of an object -// -// The following example retrieves an object for an S3 bucket. The request specifies -// the range header to retrieve a specific byte range. -func ExampleS3_GetObject_shared00() { - svc := s3.New(session.New()) - input := &s3.GetObjectInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("SampleFile.txt"), - Range: aws.String("bytes=0-9"), - } - - result, err := svc.GetObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchKey: - fmt.Println(s3.ErrCodeNoSuchKey, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve an object -// -// The following example retrieves an object for an S3 bucket. -func ExampleS3_GetObject_shared01() { - svc := s3.New(session.New()) - input := &s3.GetObjectInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.GetObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchKey: - fmt.Println(s3.ErrCodeNoSuchKey, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve object ACL -// -// The following example retrieves access control list (ACL) of an object. -func ExampleS3_GetObjectAcl_shared00() { - svc := s3.New(session.New()) - input := &s3.GetObjectAclInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.GetObjectAcl(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchKey: - fmt.Println(s3.ErrCodeNoSuchKey, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve tag set of an object -// -// The following example retrieves tag set of an object. -func ExampleS3_GetObjectTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.GetObjectTaggingInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.GetObjectTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve tag set of a specific object version -// -// The following example retrieves tag set of an object. The request specifies object -// version. -func ExampleS3_GetObjectTagging_shared01() { - svc := s3.New(session.New()) - input := &s3.GetObjectTaggingInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("exampleobject"), - VersionId: aws.String("ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI"), - } - - result, err := svc.GetObjectTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve torrent files for an object -// -// The following example retrieves torrent files of an object. -func ExampleS3_GetObjectTorrent_shared00() { - svc := s3.New(session.New()) - input := &s3.GetObjectTorrentInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.GetObjectTorrent(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To determine if bucket exists -// -// This operation checks to see if a bucket exists. -func ExampleS3_HeadBucket_shared00() { - svc := s3.New(session.New()) - input := &s3.HeadBucketInput{ - Bucket: aws.String("acl1"), - } - - result, err := svc.HeadBucket(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchBucket: - fmt.Println(s3.ErrCodeNoSuchBucket, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To retrieve metadata of an object without returning the object itself -// -// The following example retrieves an object metadata. -func ExampleS3_HeadObject_shared00() { - svc := s3.New(session.New()) - input := &s3.HeadObjectInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.HeadObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To list object versions -// -// The following example return versions of an object with specific key name prefix. -// The request limits the number of items returned to two. If there are are more than -// two object version, S3 returns NextToken in the response. You can specify this token -// value in your next request to fetch next set of object versions. -func ExampleS3_ListBuckets_shared00() { - svc := s3.New(session.New()) - input := &s3.ListBucketsInput{} - - result, err := svc.ListBuckets(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// List next set of multipart uploads when previous result is truncated -// -// The following example specifies the upload-id-marker and key-marker from previous -// truncated response to retrieve next setup of multipart uploads. -func ExampleS3_ListMultipartUploads_shared00() { - svc := s3.New(session.New()) - input := &s3.ListMultipartUploadsInput{ - Bucket: aws.String("examplebucket"), - KeyMarker: aws.String("nextkeyfrompreviousresponse"), - MaxUploads: aws.Int64(2), - UploadIdMarker: aws.String("valuefrompreviousresponse"), - } - - result, err := svc.ListMultipartUploads(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To list in-progress multipart uploads on a bucket -// -// The following example lists in-progress multipart uploads on a specific bucket. -func ExampleS3_ListMultipartUploads_shared01() { - svc := s3.New(session.New()) - input := &s3.ListMultipartUploadsInput{ - Bucket: aws.String("examplebucket"), - } - - result, err := svc.ListMultipartUploads(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To list object versions -// -// The following example return versions of an object with specific key name prefix. -// The request limits the number of items returned to two. If there are are more than -// two object version, S3 returns NextToken in the response. You can specify this token -// value in your next request to fetch next set of object versions. -func ExampleS3_ListObjectVersions_shared00() { - svc := s3.New(session.New()) - input := &s3.ListObjectVersionsInput{ - Bucket: aws.String("examplebucket"), - Prefix: aws.String("HappyFace.jpg"), - } - - result, err := svc.ListObjectVersions(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To list objects in a bucket -// -// The following example list two objects in a bucket. -func ExampleS3_ListObjects_shared00() { - svc := s3.New(session.New()) - input := &s3.ListObjectsInput{ - Bucket: aws.String("examplebucket"), - MaxKeys: aws.Int64(2), - } - - result, err := svc.ListObjects(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchBucket: - fmt.Println(s3.ErrCodeNoSuchBucket, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get object list -// -// The following example retrieves object list. The request specifies max keys to limit -// response to include only 2 object keys. -func ExampleS3_ListObjectsV2_shared00() { - svc := s3.New(session.New()) - input := &s3.ListObjectsV2Input{ - Bucket: aws.String("examplebucket"), - MaxKeys: aws.Int64(2), - } - - result, err := svc.ListObjectsV2(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchBucket: - fmt.Println(s3.ErrCodeNoSuchBucket, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To list parts of a multipart upload. -// -// The following example lists parts uploaded for a specific multipart upload. -func ExampleS3_ListParts_shared00() { - svc := s3.New(session.New()) - input := &s3.ListPartsInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("bigobject"), - UploadId: aws.String("example7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--"), - } - - result, err := svc.ListParts(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Put bucket acl -// -// The following example replaces existing ACL on a bucket. The ACL grants the bucket -// owner (specified using the owner ID) and write permission to the LogDelivery group. -// Because this is a replace operation, you must specify all the grants in your request. -// To incrementally add or remove ACL grants, you might use the console. -func ExampleS3_PutBucketAcl_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketAclInput{ - Bucket: aws.String("examplebucket"), - GrantFullControl: aws.String("id=examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484"), - GrantWrite: aws.String("uri=http://acs.amazonaws.com/groups/s3/LogDelivery"), - } - - result, err := svc.PutBucketAcl(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To set cors configuration on a bucket. -// -// The following example enables PUT, POST, and DELETE requests from www.example.com, -// and enables GET requests from any domain. -func ExampleS3_PutBucketCors_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketCorsInput{ - Bucket: aws.String(""), - CORSConfiguration: &s3.CORSConfiguration{ - CORSRules: []*s3.CORSRule{ - { - AllowedHeaders: []*string{ - aws.String("*"), - }, - AllowedMethods: []*string{ - aws.String("PUT"), - aws.String("POST"), - aws.String("DELETE"), - }, - AllowedOrigins: []*string{ - aws.String("http://www.example.com"), - }, - ExposeHeaders: []*string{ - aws.String("x-amz-server-side-encryption"), - }, - MaxAgeSeconds: aws.Int64(3000), - }, - { - AllowedHeaders: []*string{ - aws.String("Authorization"), - }, - AllowedMethods: []*string{ - aws.String("GET"), - }, - AllowedOrigins: []*string{ - aws.String("*"), - }, - MaxAgeSeconds: aws.Int64(3000), - }, - }, - }, - } - - result, err := svc.PutBucketCors(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Put bucket lifecycle -// -// The following example replaces existing lifecycle configuration, if any, on the specified -// bucket. -func ExampleS3_PutBucketLifecycleConfiguration_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketLifecycleConfigurationInput{ - Bucket: aws.String("examplebucket"), - LifecycleConfiguration: &s3.BucketLifecycleConfiguration{ - Rules: []*s3.LifecycleRule{ - { - Expiration: &s3.LifecycleExpiration{ - Days: aws.Int64(3650), - }, - Filter: &s3.LifecycleRuleFilter{ - Prefix: aws.String("documents/"), - }, - ID: aws.String("TestOnly"), - Status: aws.String("Enabled"), - Transitions: []*s3.Transition{ - { - Days: aws.Int64(365), - StorageClass: aws.String("GLACIER"), - }, - }, - }, - }, - }, - } - - result, err := svc.PutBucketLifecycleConfiguration(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set logging configuration for a bucket -// -// The following example sets logging policy on a bucket. For the Log Delivery group -// to deliver logs to the destination bucket, it needs permission for the READ_ACP action -// which the policy grants. -func ExampleS3_PutBucketLogging_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketLoggingInput{ - Bucket: aws.String("sourcebucket"), - BucketLoggingStatus: &s3.BucketLoggingStatus{ - LoggingEnabled: &s3.LoggingEnabled{ - TargetBucket: aws.String("targetbucket"), - TargetGrants: []*s3.TargetGrant{ - { - Grantee: &s3.Grantee{ - Type: aws.String("Group"), - URI: aws.String("http://acs.amazonaws.com/groups/global/AllUsers"), - }, - Permission: aws.String("READ"), - }, - }, - TargetPrefix: aws.String("MyBucketLogs/"), - }, - }, - } - - result, err := svc.PutBucketLogging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set notification configuration for a bucket -// -// The following example sets notification configuration on a bucket to publish the -// object created events to an SNS topic. -func ExampleS3_PutBucketNotificationConfiguration_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketNotificationConfigurationInput{ - Bucket: aws.String("examplebucket"), - NotificationConfiguration: &s3.NotificationConfiguration{ - TopicConfigurations: []*s3.TopicConfiguration{ - { - Events: []*string{ - aws.String("s3:ObjectCreated:*"), - }, - TopicArn: aws.String("arn:aws:sns:us-west-2:123456789012:s3-notification-topic"), - }, - }, - }, - } - - result, err := svc.PutBucketNotificationConfiguration(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set bucket policy -// -// The following example sets a permission policy on a bucket. -func ExampleS3_PutBucketPolicy_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketPolicyInput{ - Bucket: aws.String("examplebucket"), - Policy: aws.String("{\"Version\": \"2012-10-17\", \"Statement\": [{ \"Sid\": \"id-1\",\"Effect\": \"Allow\",\"Principal\": {\"AWS\": \"arn:aws:iam::123456789012:root\"}, \"Action\": [ \"s3:PutObject\",\"s3:PutObjectAcl\"], \"Resource\": [\"arn:aws:s3:::acl3/*\" ] } ]}"), - } - - result, err := svc.PutBucketPolicy(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set replication configuration on a bucket -// -// The following example sets replication configuration on a bucket. -func ExampleS3_PutBucketReplication_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketReplicationInput{ - Bucket: aws.String("examplebucket"), - ReplicationConfiguration: &s3.ReplicationConfiguration{ - Role: aws.String("arn:aws:iam::123456789012:role/examplerole"), - Rules: []*s3.ReplicationRule{ - { - Destination: &s3.Destination{ - Bucket: aws.String("arn:aws:s3:::destinationbucket"), - StorageClass: aws.String("STANDARD"), - }, - Prefix: aws.String(""), - Status: aws.String("Enabled"), - }, - }, - }, - } - - result, err := svc.PutBucketReplication(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set request payment configuration on a bucket. -// -// The following example sets request payment configuration on a bucket so that person -// requesting the download is charged. -func ExampleS3_PutBucketRequestPayment_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketRequestPaymentInput{ - Bucket: aws.String("examplebucket"), - RequestPaymentConfiguration: &s3.RequestPaymentConfiguration{ - Payer: aws.String("Requester"), - }, - } - - result, err := svc.PutBucketRequestPayment(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set tags on a bucket -// -// The following example sets tags on a bucket. Any existing tags are replaced. -func ExampleS3_PutBucketTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketTaggingInput{ - Bucket: aws.String("examplebucket"), - Tagging: &s3.Tagging{ - TagSet: []*s3.Tag{ - { - Key: aws.String("Key1"), - Value: aws.String("Value1"), - }, - { - Key: aws.String("Key2"), - Value: aws.String("Value2"), - }, - }, - }, - } - - result, err := svc.PutBucketTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set versioning configuration on a bucket -// -// The following example sets versioning configuration on bucket. The configuration -// enables versioning on the bucket. -func ExampleS3_PutBucketVersioning_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketVersioningInput{ - Bucket: aws.String("examplebucket"), - VersioningConfiguration: &s3.VersioningConfiguration{ - MFADelete: aws.String("Disabled"), - Status: aws.String("Enabled"), - }, - } - - result, err := svc.PutBucketVersioning(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// Set website configuration on a bucket -// -// The following example adds website configuration to a bucket. -func ExampleS3_PutBucketWebsite_shared00() { - svc := s3.New(session.New()) - input := &s3.PutBucketWebsiteInput{ - Bucket: aws.String("examplebucket"), - WebsiteConfiguration: &s3.WebsiteConfiguration{ - ErrorDocument: &s3.ErrorDocument{ - Key: aws.String("error.html"), - }, - IndexDocument: &s3.IndexDocument{ - Suffix: aws.String("index.html"), - }, - }, - } - - result, err := svc.PutBucketWebsite(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload an object (specify optional headers) -// -// The following example uploads an object. The request specifies optional request headers -// to directs S3 to use specific storage class and use server-side encryption. -func ExampleS3_PutObject_shared00() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("HappyFace.jpg")), - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - ServerSideEncryption: aws.String("AES256"), - StorageClass: aws.String("STANDARD_IA"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload an object and specify optional tags -// -// The following example uploads an object. The request specifies optional object tags. -// The bucket is versioned, therefore S3 returns version ID of the newly created object. -func ExampleS3_PutObject_shared01() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("c:\\HappyFace.jpg")), - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - Tagging: aws.String("key1=value1&key2=value2"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload object and specify user-defined metadata -// -// The following example creates an object. The request also specifies optional metadata. -// If the bucket is versioning enabled, S3 returns version ID in response. -func ExampleS3_PutObject_shared02() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("filetoupload")), - Bucket: aws.String("examplebucket"), - Key: aws.String("exampleobject"), - Metadata: map[string]*string{ - "metadata1": aws.String("value1"), - "metadata2": aws.String("value2"), - }, - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To create an object. -// -// The following example creates an object. If the bucket is versioning enabled, S3 -// returns version ID in response. -func ExampleS3_PutObject_shared03() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("filetoupload")), - Bucket: aws.String("examplebucket"), - Key: aws.String("objectkey"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload an object -// -// The following example uploads an object to a versioning-enabled bucket. The source -// file is specified using Windows file syntax. S3 returns VersionId of the newly created -// object. -func ExampleS3_PutObject_shared04() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("HappyFace.jpg")), - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload an object and specify canned ACL. -// -// The following example uploads and object. The request specifies optional canned ACL -// (access control list) to all READ access to authenticated users. If the bucket is -// versioning enabled, S3 returns version ID in response. -func ExampleS3_PutObject_shared05() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - ACL: aws.String("authenticated-read"), - Body: aws.ReadSeekCloser(strings.NewReader("filetoupload")), - Bucket: aws.String("examplebucket"), - Key: aws.String("exampleobject"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload an object and specify server-side encryption and object tags -// -// The following example uploads and object. The request specifies the optional server-side -// encryption option. The request also specifies optional object tags. If the bucket -// is versioning enabled, S3 returns version ID in response. -func ExampleS3_PutObject_shared06() { - svc := s3.New(session.New()) - input := &s3.PutObjectInput{ - Body: aws.ReadSeekCloser(strings.NewReader("filetoupload")), - Bucket: aws.String("examplebucket"), - Key: aws.String("exampleobject"), - ServerSideEncryption: aws.String("AES256"), - Tagging: aws.String("key1=value1&key2=value2"), - } - - result, err := svc.PutObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To grant permissions using object ACL -// -// The following example adds grants to an object ACL. The first permission grants user1 -// and user2 FULL_CONTROL and the AllUsers group READ permission. -func ExampleS3_PutObjectAcl_shared00() { - svc := s3.New(session.New()) - input := &s3.PutObjectAclInput{ - AccessControlPolicy: &s3.AccessControlPolicy{}, - Bucket: aws.String("examplebucket"), - GrantFullControl: aws.String("emailaddress=user1@example.com,emailaddress=user2@example.com"), - GrantRead: aws.String("uri=http://acs.amazonaws.com/groups/global/AllUsers"), - Key: aws.String("HappyFace.jpg"), - } - - result, err := svc.PutObjectAcl(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeNoSuchKey: - fmt.Println(s3.ErrCodeNoSuchKey, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To add tags to an existing object -// -// The following example adds tags to an existing object. -func ExampleS3_PutObjectTagging_shared00() { - svc := s3.New(session.New()) - input := &s3.PutObjectTaggingInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("HappyFace.jpg"), - Tagging: &s3.Tagging{ - TagSet: []*s3.Tag{ - { - Key: aws.String("Key3"), - Value: aws.String("Value3"), - }, - { - Key: aws.String("Key4"), - Value: aws.String("Value4"), - }, - }, - }, - } - - result, err := svc.PutObjectTagging(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To restore an archived object -// -// The following example restores for one day an archived copy of an object back into -// Amazon S3 bucket. -func ExampleS3_RestoreObject_shared00() { - svc := s3.New(session.New()) - input := &s3.RestoreObjectInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("archivedobjectkey"), - RestoreRequest: &s3.RestoreRequest{ - Days: aws.Int64(1), - GlacierJobParameters: &s3.GlacierJobParameters{ - Tier: aws.String("Expedited"), - }, - }, - } - - result, err := svc.RestoreObject(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case s3.ErrCodeObjectAlreadyInActiveTierError: - fmt.Println(s3.ErrCodeObjectAlreadyInActiveTierError, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload a part -// -// The following example uploads part 1 of a multipart upload. The example specifies -// a file name for the part data. The Upload ID is same that is returned by the initiate -// multipart upload. -func ExampleS3_UploadPart_shared00() { - svc := s3.New(session.New()) - input := &s3.UploadPartInput{ - Body: aws.ReadSeekCloser(strings.NewReader("fileToUpload")), - Bucket: aws.String("examplebucket"), - Key: aws.String("examplelargeobject"), - PartNumber: aws.Int64(1), - UploadId: aws.String("xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--"), - } - - result, err := svc.UploadPart(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload a part by copying byte range from an existing object as data source -// -// The following example uploads a part of a multipart upload by copying a specified -// byte range from an existing object as data source. -func ExampleS3_UploadPartCopy_shared00() { - svc := s3.New(session.New()) - input := &s3.UploadPartCopyInput{ - Bucket: aws.String("examplebucket"), - CopySource: aws.String("/bucketname/sourceobjectkey"), - CopySourceRange: aws.String("bytes=1-100000"), - Key: aws.String("examplelargeobject"), - PartNumber: aws.Int64(2), - UploadId: aws.String("exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--"), - } - - result, err := svc.UploadPartCopy(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To upload a part by copying data from an existing object as data source -// -// The following example uploads a part of a multipart upload by copying data from an -// existing object as data source. -func ExampleS3_UploadPartCopy_shared01() { - svc := s3.New(session.New()) - input := &s3.UploadPartCopyInput{ - Bucket: aws.String("examplebucket"), - CopySource: aws.String("/bucketname/sourceobjectkey"), - Key: aws.String("examplelargeobject"), - PartNumber: aws.Int64(1), - UploadId: aws.String("exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--"), - } - - result, err := svc.UploadPartCopy(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket_test.go deleted file mode 100644 index f80c33c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket_test.go +++ /dev/null @@ -1,191 +0,0 @@ -package s3_test - -import ( - "encoding/json" - "net/url" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -type s3BucketTest struct { - bucket string - url string - errCode string -} - -var ( - sslTests = []s3BucketTest{ - {"abc", "https://abc.s3.mock-region.amazonaws.com/", ""}, - {"a$b$c", "https://s3.mock-region.amazonaws.com/a%24b%24c", ""}, - {"a.b.c", "https://s3.mock-region.amazonaws.com/a.b.c", ""}, - {"a..bc", "https://s3.mock-region.amazonaws.com/a..bc", ""}, - } - - nosslTests = []s3BucketTest{ - {"a.b.c", "http://a.b.c.s3.mock-region.amazonaws.com/", ""}, - {"a..bc", "http://s3.mock-region.amazonaws.com/a..bc", ""}, - } - - forcepathTests = []s3BucketTest{ - {"abc", "https://s3.mock-region.amazonaws.com/abc", ""}, - {"a$b$c", "https://s3.mock-region.amazonaws.com/a%24b%24c", ""}, - {"a.b.c", "https://s3.mock-region.amazonaws.com/a.b.c", ""}, - {"a..bc", "https://s3.mock-region.amazonaws.com/a..bc", ""}, - } - - accelerateTests = []s3BucketTest{ - {"abc", "https://abc.s3-accelerate.amazonaws.com/", ""}, - {"a.b.c", "https://s3.mock-region.amazonaws.com/%7BBucket%7D", "InvalidParameterException"}, - {"a$b$c", "https://s3.mock-region.amazonaws.com/%7BBucket%7D", "InvalidParameterException"}, - } - - accelerateNoSSLTests = []s3BucketTest{ - {"abc", "http://abc.s3-accelerate.amazonaws.com/", ""}, - {"a.b.c", "http://a.b.c.s3-accelerate.amazonaws.com/", ""}, - {"a$b$c", "http://s3.mock-region.amazonaws.com/%7BBucket%7D", "InvalidParameterException"}, - } - - accelerateDualstack = []s3BucketTest{ - {"abc", "https://abc.s3-accelerate.dualstack.amazonaws.com/", ""}, - {"a.b.c", "https://s3.dualstack.mock-region.amazonaws.com/%7BBucket%7D", "InvalidParameterException"}, - {"a$b$c", "https://s3.dualstack.mock-region.amazonaws.com/%7BBucket%7D", "InvalidParameterException"}, - } -) - -func runTests(t *testing.T, svc *s3.S3, tests []s3BucketTest) { - for i, test := range tests { - req, _ := svc.ListObjectsRequest(&s3.ListObjectsInput{Bucket: &test.bucket}) - req.Build() - if e, a := test.url, req.HTTPRequest.URL.String(); e != a { - t.Errorf("%d, expect url %s, got %s", i, e, a) - } - if test.errCode != "" { - if err := req.Error; err == nil { - t.Fatalf("%d, expect no error", i) - } - if a, e := req.Error.(awserr.Error).Code(), test.errCode; !strings.Contains(a, e) { - t.Errorf("%d, expect error code to contain %q, got %q", i, e, a) - } - } - } -} - -func TestAccelerateBucketBuild(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{S3UseAccelerate: aws.Bool(true)}) - runTests(t, s, accelerateTests) -} - -func TestAccelerateNoSSLBucketBuild(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{S3UseAccelerate: aws.Bool(true), DisableSSL: aws.Bool(true)}) - runTests(t, s, accelerateNoSSLTests) -} - -func TestAccelerateDualstackBucketBuild(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{ - S3UseAccelerate: aws.Bool(true), - UseDualStack: aws.Bool(true), - }) - runTests(t, s, accelerateDualstack) -} - -func TestHostStyleBucketBuild(t *testing.T) { - s := s3.New(unit.Session) - runTests(t, s, sslTests) -} - -func TestHostStyleBucketBuildNoSSL(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{DisableSSL: aws.Bool(true)}) - runTests(t, s, nosslTests) -} - -func TestPathStyleBucketBuild(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{S3ForcePathStyle: aws.Bool(true)}) - runTests(t, s, forcepathTests) -} - -func TestHostStyleBucketGetBucketLocation(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.GetBucketLocationRequest(&s3.GetBucketLocationInput{ - Bucket: aws.String("bucket"), - }) - - req.Build() - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } - u, _ := url.Parse(req.HTTPRequest.URL.String()) - if e, a := "bucket", u.Host; strings.Contains(a, e) { - t.Errorf("expect %s to not be in %s", e, a) - } - if e, a := "bucket", u.Path; !strings.Contains(a, e) { - t.Errorf("expect %s to be in %s", e, a) - } -} - -func TestVirtualHostStyleSuite(t *testing.T) { - f, err := os.Open(filepath.Join("testdata", "virtual_host.json")) - if err != nil { - t.Fatalf("expect no error, %v", err) - } - - cases := []struct { - Bucket string - Region string - UseDualStack bool - UseS3Accelerate bool - S3UsEast1RegionalEndpoint string - ConfiguredAddressingStyle string - - ExpectedURI string - }{} - - decoder := json.NewDecoder(f) - if err := decoder.Decode(&cases); err != nil { - t.Fatalf("expect no error, %v", err) - } - - const testPathStyle = "path" - for i, c := range cases { - svc := s3.New(unit.Session, &aws.Config{ - Region: &c.Region, - UseDualStack: &c.UseDualStack, - S3UseAccelerate: &c.UseS3Accelerate, - S3ForcePathStyle: aws.Bool(c.ConfiguredAddressingStyle == testPathStyle), - S3UsEast1RegionalEndpoint: func() endpoints.S3UsEast1RegionalEndpoint { - if len(c.S3UsEast1RegionalEndpoint) == 0 { - return endpoints.UnsetS3UsEast1Endpoint - } - v, err := endpoints.GetS3UsEast1RegionalEndpoint(c.S3UsEast1RegionalEndpoint) - if err != nil { - t.Fatalf("unexpected error, %v", err) - } - return v - }(), - }) - - req, _ := svc.HeadBucketRequest(&s3.HeadBucketInput{ - Bucket: &c.Bucket, - }) - req.Build() - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } - - // Trim trailing '/' that are added by the SDK but not in the tests. - actualURI := strings.TrimRightFunc( - req.HTTPRequest.URL.String(), - func(r rune) bool { return r == '/' }, - ) - if e, a := c.ExpectedURI, actualURI; e != a { - t.Errorf("%d URLs do not match\nexpect: %s\nactual: %s", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/integ_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/integ_test.go deleted file mode 100644 index 6c453a9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/integ_test.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// +build go1.10,integration - -package s3_test - -import ( - "context" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/integration" - "github.com/aws/aws-sdk-go/service/s3" -) - -var _ aws.Config -var _ awserr.Error -var _ request.Request - -func TestInteg_00_ListBuckets(t *testing.T) { - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - - sess := integration.SessionWithDefaultRegion("us-west-2") - svc := s3.New(sess) - params := &s3.ListBucketsInput{} - _, err := svc.ListBucketsWithContext(ctx, params, func(r *request.Request) { - r.Handlers.Validate.RemoveByName("core.ValidateParametersHandler") - }) - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn_test.go deleted file mode 100644 index 604a93e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// +build go1.7 - -package arn - -import ( - "reflect" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -func TestParseAccessPointResource(t *testing.T) { - cases := map[string]struct { - ARN arn.ARN - ExpectErr string - ExpectARN AccessPointARN - }{ - "region not set": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - AccountID: "012345678901", - Resource: "accesspoint/myendpoint", - }, - ExpectErr: "region not set", - }, - "account-id not set": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - Resource: "accesspoint/myendpoint", - }, - ExpectErr: "account-id not set", - }, - "resource-id not set": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint", - }, - ExpectErr: "resource-id not set", - }, - "resource-id empty": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint:", - }, - ExpectErr: "resource-id not set", - }, - "resource not supported": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint/endpoint/object/key", - }, - ExpectErr: "sub resource not supported", - }, - "valid resource-id": { - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint/endpoint", - }, - ExpectARN: AccessPointARN{ - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint/endpoint", - }, - AccessPointName: "endpoint", - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - resParts := SplitResource(c.ARN.Resource) - a, err := ParseAccessPointResource(c.ARN, resParts[1:]) - - if len(c.ExpectErr) == 0 && err != nil { - t.Fatalf("expect no error but got %v", err) - } else if len(c.ExpectErr) != 0 && err == nil { - t.Fatalf("expect error %q, but got nil", c.ExpectErr) - } else if len(c.ExpectErr) != 0 && err != nil { - if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect error %q, got %q", e, a) - } - return - } - - if e, a := c.ExpectARN, a; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn_test.go deleted file mode 100644 index 8662b63..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn_test.go +++ /dev/null @@ -1,168 +0,0 @@ -// +build go1.7 - -package arn - -import ( - "reflect" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -func TestParseResource(t *testing.T) { - cases := map[string]struct { - Input string - MappedResources map[string]func(arn.ARN, []string) (Resource, error) - Expect Resource - ExpectErr string - }{ - "Empty ARN": { - Input: "", - ExpectErr: "arn: invalid prefix", - }, - "No Partition": { - Input: "arn::sqs:us-west-2:012345678901:accesspoint", - ExpectErr: "partition not set", - }, - "Not S3 ARN": { - Input: "arn:aws:sqs:us-west-2:012345678901:accesspoint", - ExpectErr: "service is not S3", - }, - "No Resource": { - Input: "arn:aws:s3:us-west-2:012345678901:", - ExpectErr: "resource not set", - }, - "Unknown Resource Type": { - Input: "arn:aws:s3:us-west-2:012345678901:myresource", - ExpectErr: "unknown resource type", - }, - "Unknown BucketARN Resource Type": { - Input: "arn:aws:s3:us-west-2:012345678901:bucket_name:mybucket", - ExpectErr: "unknown resource type", - }, - "Unknown Resource Type with Resource and Sub-Resource": { - Input: "arn:aws:s3:us-west-2:012345678901:somethingnew:myresource/subresource", - ExpectErr: "unknown resource type", - }, - "Access Point with sub resource": { - Input: "arn:aws:s3:us-west-2:012345678901:accesspoint:myresource/subresource", - MappedResources: map[string]func(arn.ARN, []string) (Resource, error){ - "accesspoint": func(a arn.ARN, parts []string) (Resource, error) { - return ParseAccessPointResource(a, parts) - }, - }, - ExpectErr: "resource not supported", - }, - "AccessPoint Resource Type": { - Input: "arn:aws:s3:us-west-2:012345678901:accesspoint:myendpoint", - MappedResources: map[string]func(arn.ARN, []string) (Resource, error){ - "accesspoint": func(a arn.ARN, parts []string) (Resource, error) { - return ParseAccessPointResource(a, parts) - }, - }, - Expect: AccessPointARN{ - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint:myendpoint", - }, - AccessPointName: "myendpoint", - }, - }, - "AccessPoint Resource Type With Path Syntax": { - Input: "arn:aws:s3:us-west-2:012345678901:accesspoint/myendpoint", - MappedResources: map[string]func(arn.ARN, []string) (Resource, error){ - "accesspoint": func(a arn.ARN, parts []string) (Resource, error) { - return ParseAccessPointResource(a, parts) - }, - }, - Expect: AccessPointARN{ - ARN: arn.ARN{ - Partition: "aws", - Service: "s3", - Region: "us-west-2", - AccountID: "012345678901", - Resource: "accesspoint/myendpoint", - }, - AccessPointName: "myendpoint", - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - parsed, err := ParseResource(c.Input, mappedResourceParser(c.MappedResources)) - - if len(c.ExpectErr) == 0 && err != nil { - t.Fatalf("expect no error but got %v", err) - } else if len(c.ExpectErr) != 0 && err == nil { - t.Fatalf("expect error but got nil") - } else if len(c.ExpectErr) != 0 && err != nil { - if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { - t.Fatalf("expect error %q, got %q", e, a) - } - return - } - - if e, a := c.Expect, parsed; !reflect.DeepEqual(e, a) { - t.Errorf("Expect %v, got %v", e, a) - } - }) - } -} - -func mappedResourceParser(kinds map[string]func(arn.ARN, []string) (Resource, error)) ResourceParser { - return func(a arn.ARN) (Resource, error) { - parts := SplitResource(a.Resource) - - fn, ok := kinds[parts[0]] - if !ok { - return nil, InvalidARNError{a, "unknown resource type"} - } - return fn(a, parts[1:]) - } -} - -func TestSplitResource(t *testing.T) { - cases := []struct { - Input string - Expect []string - }{ - { - Input: "accesspoint:myendpoint", - Expect: []string{"accesspoint", "myendpoint"}, - }, - { - Input: "accesspoint/myendpoint", - Expect: []string{"accesspoint", "myendpoint"}, - }, - { - Input: "accesspoint", - Expect: []string{"accesspoint"}, - }, - { - Input: "accesspoint:", - Expect: []string{"accesspoint", ""}, - }, - { - Input: "accesspoint: ", - Expect: []string{"accesspoint", " "}, - }, - { - Input: "accesspoint:endpoint/object/key", - Expect: []string{"accesspoint", "endpoint", "object", "key"}, - }, - } - - for _, c := range cases { - t.Run(c.Input, func(t *testing.T) { - parts := SplitResource(c.Input) - if e, a := c.Expect, parts; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) - } - }) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6_test.go deleted file mode 100644 index 0675537..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// +build go1.6 - -package s3_test - -import ( - "bytes" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestAdd100Continue_Added(t *testing.T) { - svc := s3.New(unit.Session) - r, _ := svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("dest"), - Body: bytes.NewReader(make([]byte, 1024*1024*5)), - }) - - err := r.Sign() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := "100-Continue", r.HTTPRequest.Header.Get("Expect"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestAdd100Continue_SkipDisabled(t *testing.T) { - svc := s3.New(unit.Session, aws.NewConfig().WithS3Disable100Continue(true)) - r, _ := svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("dest"), - Body: bytes.NewReader(make([]byte, 1024*1024*5)), - }) - - err := r.Sign() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if r.HTTPRequest.Header.Get("Expect") != "" { - t.Errorf("expected empty value, but received %s", r.HTTPRequest.Header.Get("Expect")) - } -} - -func TestAdd100Continue_SkipNonPUT(t *testing.T) { - svc := s3.New(unit.Session) - r, _ := svc.GetObjectRequest(&s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("dest"), - }) - - err := r.Sign() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if r.HTTPRequest.Header.Get("Expect") != "" { - t.Errorf("expected empty value, but received %s", r.HTTPRequest.Header.Get("Expect")) - } -} - -func TestAdd100Continue_SkipTooSmall(t *testing.T) { - svc := s3.New(unit.Session) - r, _ := svc.PutObjectRequest(&s3.PutObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("dest"), - Body: bytes.NewReader(make([]byte, 1024*1024*1)), - }) - - err := r.Sign() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if r.HTTPRequest.Header.Get("Expect") != "" { - t.Errorf("expected empty value, but received %s", r.HTTPRequest.Header.Get("Expect")) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_1_7_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_1_7_test.go deleted file mode 100644 index a839c6b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_1_7_test.go +++ /dev/null @@ -1,117 +0,0 @@ -// +build go1.7 - -package s3manager - -import ( - "context" - "fmt" - "net/http" - "net/http/httptest" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" -) - -// #1790 bug -func TestBatchDeleteContext(t *testing.T) { - cases := []struct { - objects []BatchDeleteObject - size int - expected int - ctx aws.Context - closeAt int - errCheck func(error) (string, bool) - }{ - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket2"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket4"), - }, - }, - }, - 1, - 0, - aws.BackgroundContext(), - 0, - func(err error) (string, bool) { - batchErr, ok := err.(*BatchError) - if !ok { - return "not BatchError type", false - } - - errs := batchErr.Errors - if len(errs) != 4 { - return fmt.Sprintf("expected 1, but received %d", len(errs)), false - } - - for _, tempErr := range errs { - aerr, ok := tempErr.OrigErr.(awserr.Error) - if !ok { - return "not awserr.Error type", false - } - - if code := aerr.Code(); code != request.CanceledErrorCode { - return fmt.Sprintf("expected %q, but received %q", request.CanceledErrorCode, code), false - } - } - return "", true - }, - }, - } - - count := 0 - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - count++ - })) - defer server.Close() - - svc := &mockS3Client{S3: buildS3SvcClient(server.URL)} - for i, c := range cases { - ctx, done := context.WithCancel(c.ctx) - defer done() - if i == c.closeAt { - done() - } - - batcher := BatchDelete{ - Client: svc, - BatchSize: c.size, - } - - err := batcher.Delete(ctx, &DeleteObjectsIterator{Objects: c.objects}) - - if msg, ok := c.errCheck(err); !ok { - t.Error(msg) - } - - if count != c.expected { - t.Errorf("Case %d: expected %d, but received %d", i, c.expected, count) - } - - count = 0 - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_test.go deleted file mode 100644 index 3c91286..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/batch_test.go +++ /dev/null @@ -1,1115 +0,0 @@ -package s3manager - -import ( - "bytes" - "errors" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3iface" -) - -func TestHasParity(t *testing.T) { - cases := []struct { - o1 *s3.DeleteObjectsInput - o2 BatchDeleteObject - expected bool - }{ - { - &s3.DeleteObjectsInput{}, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{}, - }, - true, - }, - { - &s3.DeleteObjectsInput{ - Bucket: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - Bucket: aws.String("bar"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{}, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - Bucket: aws.String("foo"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{ - Bucket: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{}, - }, - false, - }, - { - &s3.DeleteObjectsInput{ - MFA: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - MFA: aws.String("bar"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{}, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - MFA: aws.String("foo"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{ - MFA: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{}, - }, - false, - }, - { - &s3.DeleteObjectsInput{ - RequestPayer: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - RequestPayer: aws.String("bar"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{}, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - RequestPayer: aws.String("foo"), - }, - }, - false, - }, - { - &s3.DeleteObjectsInput{ - RequestPayer: aws.String("foo"), - }, - BatchDeleteObject{ - Object: &s3.DeleteObjectInput{}, - }, - false, - }, - } - - for i, c := range cases { - if result := hasParity(c.o1, c.o2); result != c.expected { - t.Errorf("Case %d: expected %t, but received %t\n", i, c.expected, result) - } - } -} - -func TestBatchDelete(t *testing.T) { - cases := []struct { - objects []BatchDeleteObject - size int - expected int - }{ - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket2"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket4"), - }, - }, - }, - 1, - 4, - }, - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket3"), - }, - }, - }, - 1, - 4, - }, - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket3"), - }, - }, - }, - 4, - 2, - }, - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket3"), - }, - }, - }, - 10, - 2, - }, - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket1"), - }, - }, - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket3"), - }, - }, - }, - 2, - 3, - }, - } - - count := 0 - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - count++ - })) - defer server.Close() - - svc := &mockS3Client{S3: buildS3SvcClient(server.URL)} - for i, c := range cases { - batcher := BatchDelete{ - Client: svc, - BatchSize: c.size, - } - - if err := batcher.Delete(aws.BackgroundContext(), &DeleteObjectsIterator{Objects: c.objects}); err != nil { - panic(err) - } - - if count != c.expected { - t.Errorf("Case %d: expected %d, but received %d", i, c.expected, count) - } - - count = 0 - } -} - -func TestBatchDeleteError(t *testing.T) { - cases := []struct { - objects []BatchDeleteObject - output s3.DeleteObjectsOutput - size int - expectedErrCode string - expectedErrMessage string - }{ - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - }, - s3.DeleteObjectsOutput{ - Errors: []*s3.Error{ - { - Code: aws.String("foo code"), - Message: aws.String("foo error"), - }, - }, - }, - 1, - "foo code", - "foo error", - }, - { - []BatchDeleteObject{ - { - Object: &s3.DeleteObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - }, - }, - s3.DeleteObjectsOutput{ - Errors: []*s3.Error{ - {}, - }, - }, - 1, - ErrDeleteBatchFailCode, - errDefaultDeleteBatchMessage, - }, - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - })) - defer server.Close() - - index := 0 - svc := &mockS3Client{ - S3: buildS3SvcClient(server.URL), - deleteObjects: func(input *s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) { - output := &cases[index].output - index++ - return output, nil - }, - } - for _, c := range cases { - batcher := BatchDelete{ - Client: svc, - BatchSize: c.size, - } - - err := batcher.Delete(aws.BackgroundContext(), &DeleteObjectsIterator{Objects: c.objects}) - if err == nil { - t.Errorf("expected error, but received none") - } - - berr := err.(*BatchError) - - if len(berr.Errors) != 1 { - t.Errorf("expected 1 error, but received %d", len(berr.Errors)) - } - - aerr := berr.Errors[0].OrigErr.(awserr.Error) - if e, a := c.expectedErrCode, aerr.Code(); e != a { - t.Errorf("expected %q, but received %q", e, a) - } - - if e, a := c.expectedErrMessage, aerr.Message(); e != a { - t.Errorf("expected %q, but received %q", e, a) - } - } -} - -type mockS3Client struct { - *s3.S3 - index int - objects []*s3.ListObjectsOutput - deleteObjects func(*s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) -} - -func (client *mockS3Client) ListObjects(input *s3.ListObjectsInput) (*s3.ListObjectsOutput, error) { - object := client.objects[client.index] - client.index++ - return object, nil -} - -func (client *mockS3Client) DeleteObjects(input *s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) { - if client.deleteObjects == nil { - return client.S3.DeleteObjectsWithContext(aws.BackgroundContext(), input) - } - - return client.deleteObjects(input) -} - -func (client *mockS3Client) DeleteObjectsWithContext(ctx aws.Context, input *s3.DeleteObjectsInput, opt ...request.Option) (*s3.DeleteObjectsOutput, error) { - if client.deleteObjects == nil { - return client.S3.DeleteObjectsWithContext(ctx, input) - } - - return client.deleteObjects(input) -} - -func TestNilOrigError(t *testing.T) { - err := Error{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - } - errStr := err.Error() - const expected1 = `failed to perform batch operation on "key" to "bucket"` - if errStr != expected1 { - t.Errorf("Expected %s, but received %s", expected1, errStr) - } - - err = Error{ - OrigErr: errors.New("foo"), - Bucket: aws.String("bucket"), - Key: aws.String("key"), - } - errStr = err.Error() - const expected2 = "failed to perform batch operation on \"key\" to \"bucket\":\nfoo" - if errStr != expected2 { - t.Errorf("Expected %s, but received %s", expected2, errStr) - } - -} - -func TestBatchDeleteList(t *testing.T) { - count := 0 - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - count++ - })) - defer server.Close() - - objects := []*s3.ListObjectsOutput{ - { - Contents: []*s3.Object{ - { - Key: aws.String("1"), - }, - }, - NextMarker: aws.String("marker"), - IsTruncated: aws.Bool(true), - }, - { - Contents: []*s3.Object{ - { - Key: aws.String("2"), - }, - }, - NextMarker: aws.String("marker"), - IsTruncated: aws.Bool(true), - }, - { - Contents: []*s3.Object{ - { - Key: aws.String("3"), - }, - }, - IsTruncated: aws.Bool(false), - }, - } - - svc := &mockS3Client{S3: buildS3SvcClient(server.URL), objects: objects} - batcher := BatchDelete{ - Client: svc, - BatchSize: 1, - } - - input := &s3.ListObjectsInput{ - Bucket: aws.String("bucket"), - } - iter := &DeleteListIterator{ - Bucket: input.Bucket, - Paginator: request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *s3.ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := svc.ListObjectsRequest(inCpy) - req.Handlers.Clear() - output, _ := svc.ListObjects(inCpy) - req.Data = output - return req, nil - }, - }, - } - - if err := batcher.Delete(aws.BackgroundContext(), iter); err != nil { - t.Error(err) - } - - if count != len(objects) { - t.Errorf("Expected %d, but received %d", len(objects), count) - } -} - -func buildS3SvcClient(u string) *s3.S3 { - return s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(u), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), - }) - -} - -func TestBatchDeleteList_EmptyListObjects(t *testing.T) { - count := 0 - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusNoContent) - count++ - })) - defer server.Close() - - svc := &mockS3Client{S3: buildS3SvcClient(server.URL)} - batcher := BatchDelete{ - Client: svc, - } - - input := &s3.ListObjectsInput{ - Bucket: aws.String("bucket"), - } - - // Test DeleteListIterator in the case when the ListObjectsRequest responds - // with an empty listing. - - // We need a new iterator with a fresh Pagination since - // Pagination.HasNextPage() is always true the first time Pagination.Next() - // called on it - iter := &DeleteListIterator{ - Bucket: input.Bucket, - Paginator: request.Pagination{ - NewRequest: func() (*request.Request, error) { - req, _ := svc.ListObjectsRequest(input) - // Simulate empty listing - req.Data = &s3.ListObjectsOutput{Contents: []*s3.Object{}} - return req, nil - }, - }, - } - - if err := batcher.Delete(aws.BackgroundContext(), iter); err != nil { - t.Error(err) - } - if count != 1 { - t.Errorf("expect count to be 1, got %d", count) - } -} - -func TestBatchDownload(t *testing.T) { - count := 0 - expected := []struct { - bucket, key string - }{ - { - key: "1", - bucket: "bucket1", - }, - { - key: "2", - bucket: "bucket2", - }, - { - key: "3", - bucket: "bucket3", - }, - { - key: "4", - bucket: "bucket4", - }, - } - - received := []struct { - bucket, key string - }{} - - payload := []string{ - "1", - "2", - "3", - "4", - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - urlParts := strings.Split(r.URL.String(), "/") - received = append(received, struct{ bucket, key string }{urlParts[1], urlParts[2]}) - w.Write([]byte(payload[count])) - count++ - })) - defer server.Close() - - svc := NewDownloaderWithClient(buildS3SvcClient(server.URL)) - - objects := []BatchDownloadObject{ - { - Object: &s3.GetObjectInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - }, - Writer: aws.NewWriteAtBuffer(make([]byte, 128)), - }, - { - Object: &s3.GetObjectInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket2"), - }, - Writer: aws.NewWriteAtBuffer(make([]byte, 128)), - }, - { - Object: &s3.GetObjectInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - }, - Writer: aws.NewWriteAtBuffer(make([]byte, 128)), - }, - { - Object: &s3.GetObjectInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket4"), - }, - Writer: aws.NewWriteAtBuffer(make([]byte, 128)), - }, - } - - iter := &DownloadObjectsIterator{Objects: objects} - if err := svc.DownloadWithIterator(aws.BackgroundContext(), iter); err != nil { - panic(err) - } - - if count != len(objects) { - t.Errorf("Expected %d, but received %d", len(objects), count) - } - - if len(expected) != len(received) { - t.Errorf("Expected %d, but received %d", len(expected), len(received)) - } - - for i := 0; i < len(expected); i++ { - if expected[i].key != received[i].key { - t.Errorf("Expected %q, but received %q", expected[i].key, received[i].key) - } - - if expected[i].bucket != received[i].bucket { - t.Errorf("Expected %q, but received %q", expected[i].bucket, received[i].bucket) - } - } - - for i, p := range payload { - b := iter.Objects[i].Writer.(*aws.WriteAtBuffer).Bytes() - b = bytes.Trim(b, "\x00") - - if string(b) != p { - t.Errorf("Expected %q, but received %q", p, b) - } - } -} - -func TestBatchUpload(t *testing.T) { - count := 0 - expected := []struct { - bucket, key string - reqBody string - }{ - { - key: "1", - bucket: "bucket1", - reqBody: "1", - }, - { - key: "2", - bucket: "bucket2", - reqBody: "2", - }, - { - key: "3", - bucket: "bucket3", - reqBody: "3", - }, - { - key: "4", - bucket: "bucket4", - reqBody: "4", - }, - } - - received := []struct { - bucket, key, reqBody string - }{} - - payload := []string{ - "a", - "b", - "c", - "d", - } - - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - urlParts := strings.Split(r.URL.String(), "/") - - b, err := ioutil.ReadAll(r.Body) - if err != nil { - t.Error(err) - } - - received = append(received, struct{ bucket, key, reqBody string }{urlParts[1], urlParts[2], string(b)}) - w.Write([]byte(payload[count])) - - count++ - })) - defer server.Close() - - svc := NewUploaderWithClient(buildS3SvcClient(server.URL)) - - objects := []BatchUploadObject{ - { - Object: &UploadInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - Body: bytes.NewBuffer([]byte("1")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket2"), - Body: bytes.NewBuffer([]byte("2")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - Body: bytes.NewBuffer([]byte("3")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket4"), - Body: bytes.NewBuffer([]byte("4")), - }, - }, - } - - iter := &UploadObjectsIterator{Objects: objects} - if err := svc.UploadWithIterator(aws.BackgroundContext(), iter); err != nil { - panic(err) - } - - if count != len(objects) { - t.Errorf("Expected %d, but received %d", len(objects), count) - } - - if len(expected) != len(received) { - t.Errorf("Expected %d, but received %d", len(expected), len(received)) - } - - for i := 0; i < len(expected); i++ { - if expected[i].key != received[i].key { - t.Errorf("Expected %q, but received %q", expected[i].key, received[i].key) - } - - if expected[i].bucket != received[i].bucket { - t.Errorf("Expected %q, but received %q", expected[i].bucket, received[i].bucket) - } - - if expected[i].reqBody != received[i].reqBody { - t.Errorf("Expected %q, but received %q", expected[i].reqBody, received[i].reqBody) - } - } -} - -type mockClient struct { - s3iface.S3API - Put func() (*s3.PutObjectOutput, error) - Get func() (*s3.GetObjectOutput, error) - List func() (*s3.ListObjectsOutput, error) - responses []response -} - -type response struct { - out interface{} - err error -} - -func (client *mockClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { - return client.Put() -} - -func (client *mockClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { - req, _ := client.S3API.PutObjectRequest(input) - req.Handlers.Clear() - req.Data, req.Error = client.Put() - return req, req.Data.(*s3.PutObjectOutput) -} - -func (client *mockClient) ListObjects(input *s3.ListObjectsInput) (*s3.ListObjectsOutput, error) { - return client.List() -} - -func (client *mockClient) ListObjectsRequest(input *s3.ListObjectsInput) (*request.Request, *s3.ListObjectsOutput) { - req, _ := client.S3API.ListObjectsRequest(input) - req.Handlers.Clear() - req.Data, req.Error = client.List() - return req, req.Data.(*s3.ListObjectsOutput) -} - -func TestBatchError(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - })) - defer server.Close() - - index := 0 - responses := []response{ - { - &s3.PutObjectOutput{}, - errors.New("Foo"), - }, - { - &s3.PutObjectOutput{}, - nil, - }, - { - &s3.PutObjectOutput{}, - nil, - }, - { - &s3.PutObjectOutput{}, - errors.New("Bar"), - }, - } - - svc := &mockClient{ - S3API: buildS3SvcClient(server.URL), - Put: func() (*s3.PutObjectOutput, error) { - resp := responses[index] - index++ - return resp.out.(*s3.PutObjectOutput), resp.err - }, - List: func() (*s3.ListObjectsOutput, error) { - resp := responses[index] - index++ - return resp.out.(*s3.ListObjectsOutput), resp.err - }, - } - uploader := NewUploaderWithClient(svc) - - objects := []BatchUploadObject{ - { - Object: &UploadInput{ - Key: aws.String("1"), - Bucket: aws.String("bucket1"), - Body: bytes.NewBuffer([]byte("1")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("2"), - Bucket: aws.String("bucket2"), - Body: bytes.NewBuffer([]byte("2")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("3"), - Bucket: aws.String("bucket3"), - Body: bytes.NewBuffer([]byte("3")), - }, - }, - { - Object: &UploadInput{ - Key: aws.String("4"), - Bucket: aws.String("bucket4"), - Body: bytes.NewBuffer([]byte("4")), - }, - }, - } - - iter := &UploadObjectsIterator{Objects: objects} - if err := uploader.UploadWithIterator(aws.BackgroundContext(), iter); err != nil { - if bErr, ok := err.(*BatchError); !ok { - t.Error("Expected BatchError, but received other") - } else { - if len(bErr.Errors) != 2 { - t.Errorf("Expected 2 errors, but received %d", len(bErr.Errors)) - } - - expected := []struct { - bucket, key string - }{ - { - "bucket1", - "1", - }, - { - "bucket4", - "4", - }, - } - for i, expect := range expected { - if *bErr.Errors[i].Bucket != expect.bucket { - t.Errorf("Case %d: Invalid bucket expected %s, but received %s", i, expect.bucket, *bErr.Errors[i].Bucket) - } - - if *bErr.Errors[i].Key != expect.key { - t.Errorf("Case %d: Invalid key expected %s, but received %s", i, expect.key, *bErr.Errors[i].Key) - } - } - } - } else { - t.Error("Expected error, but received nil") - } - - if index != len(objects) { - t.Errorf("Expected %d, but received %d", len(objects), index) - } - -} - -type testAfterDeleteIter struct { - afterDelete bool - afterDownload bool - afterUpload bool - next bool -} - -func (iter *testAfterDeleteIter) Next() bool { - next := !iter.next - iter.next = !iter.next - return next -} - -func (iter *testAfterDeleteIter) Err() error { - return nil -} - -func (iter *testAfterDeleteIter) DeleteObject() BatchDeleteObject { - return BatchDeleteObject{ - Object: &s3.DeleteObjectInput{ - Bucket: aws.String("foo"), - Key: aws.String("foo"), - }, - After: func() error { - iter.afterDelete = true - return nil - }, - } -} - -type testAfterDownloadIter struct { - afterDownload bool - afterUpload bool - next bool -} - -func (iter *testAfterDownloadIter) Next() bool { - next := !iter.next - iter.next = !iter.next - return next -} - -func (iter *testAfterDownloadIter) Err() error { - return nil -} - -func (iter *testAfterDownloadIter) DownloadObject() BatchDownloadObject { - return BatchDownloadObject{ - Object: &s3.GetObjectInput{ - Bucket: aws.String("foo"), - Key: aws.String("foo"), - }, - Writer: aws.NewWriteAtBuffer([]byte{}), - After: func() error { - iter.afterDownload = true - return nil - }, - } -} - -type testAfterUploadIter struct { - afterUpload bool - next bool -} - -func (iter *testAfterUploadIter) Next() bool { - next := !iter.next - iter.next = !iter.next - return next -} - -func (iter *testAfterUploadIter) Err() error { - return nil -} - -func (iter *testAfterUploadIter) UploadObject() BatchUploadObject { - return BatchUploadObject{ - Object: &UploadInput{ - Bucket: aws.String("foo"), - Key: aws.String("foo"), - Body: strings.NewReader("bar"), - }, - After: func() error { - iter.afterUpload = true - return nil - }, - } -} - -func TestAfter(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - })) - defer server.Close() - - index := 0 - responses := []response{ - { - &s3.PutObjectOutput{}, - nil, - }, - { - &s3.GetObjectOutput{}, - nil, - }, - { - &s3.DeleteObjectOutput{}, - nil, - }, - } - - svc := &mockClient{ - S3API: buildS3SvcClient(server.URL), - Put: func() (*s3.PutObjectOutput, error) { - resp := responses[index] - index++ - return resp.out.(*s3.PutObjectOutput), resp.err - }, - Get: func() (*s3.GetObjectOutput, error) { - resp := responses[index] - index++ - return resp.out.(*s3.GetObjectOutput), resp.err - }, - List: func() (*s3.ListObjectsOutput, error) { - resp := responses[index] - index++ - return resp.out.(*s3.ListObjectsOutput), resp.err - }, - } - uploader := NewUploaderWithClient(svc) - downloader := NewDownloaderWithClient(svc) - deleter := NewBatchDeleteWithClient(svc) - - deleteIter := &testAfterDeleteIter{} - downloadIter := &testAfterDownloadIter{} - uploadIter := &testAfterUploadIter{} - - if err := uploader.UploadWithIterator(aws.BackgroundContext(), uploadIter); err != nil { - t.Error(err) - } - - if err := downloader.DownloadWithIterator(aws.BackgroundContext(), downloadIter); err != nil { - t.Error(err) - } - - if err := deleter.Delete(aws.BackgroundContext(), deleteIter); err != nil { - t.Error(err) - } - - if !deleteIter.afterDelete { - t.Error("Expected 'afterDelete' to be true, but received false") - } - - if !downloadIter.afterDownload { - t.Error("Expected 'afterDownload' to be true, but received false") - } - - if !uploadIter.afterUpload { - t.Error("Expected 'afterUpload' to be true, but received false") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region_test.go deleted file mode 100644 index fec76a9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/bucket_region_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package s3manager - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func testSetupGetBucketRegionServer(region string, statusCode int, incHeader bool) *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if incHeader { - w.Header().Set(bucketRegionHeader, region) - } - w.WriteHeader(statusCode) - })) -} - -var testGetBucketRegionCases = []struct { - RespRegion string - StatusCode int - HintRegion string - ExpectReqRegion string -}{ - {"bucket-region", 301, "hint-region", ""}, - {"bucket-region", 403, "hint-region", ""}, - {"bucket-region", 200, "hint-region", ""}, - {"bucket-region", 200, "", "default-region"}, -} - -func TestGetBucketRegion_Exists(t *testing.T) { - for i, c := range testGetBucketRegionCases { - server := testSetupGetBucketRegionServer(c.RespRegion, c.StatusCode, true) - defer server.Close() - - sess := unit.Session.Copy() - sess.Config.Region = aws.String("default-region") - sess.Config.Endpoint = aws.String(server.URL) - sess.Config.DisableSSL = aws.Bool(true) - - ctx := aws.BackgroundContext() - region, err := GetBucketRegion(ctx, sess, "bucket", c.HintRegion) - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - if e, a := c.RespRegion, region; e != a { - t.Errorf("%d, expect %q region, got %q", i, e, a) - } - } -} - -func TestGetBucketRegion_NotExists(t *testing.T) { - server := testSetupGetBucketRegionServer("ignore-region", 404, false) - defer server.Close() - - sess := unit.Session.Copy() - sess.Config.Endpoint = aws.String(server.URL) - sess.Config.DisableSSL = aws.Bool(true) - - ctx := aws.BackgroundContext() - region, err := GetBucketRegion(ctx, sess, "bucket", "hint-region") - if err == nil { - t.Fatalf("expect error, but did not get one") - } - aerr := err.(awserr.Error) - if e, a := "NotFound", aerr.Code(); e != a { - t.Errorf("expect %s error code, got %s", e, a) - } - if len(region) != 0 { - t.Errorf("expect region not to be set, got %q", region) - } -} - -func TestGetBucketRegionWithClient(t *testing.T) { - for i, c := range testGetBucketRegionCases { - server := testSetupGetBucketRegionServer(c.RespRegion, c.StatusCode, true) - defer server.Close() - - svc := s3.New(unit.Session, &aws.Config{ - Region: aws.String("hint-region"), - Endpoint: aws.String(server.URL), - DisableSSL: aws.Bool(true), - }) - - ctx := aws.BackgroundContext() - - region, err := GetBucketRegionWithClient(ctx, svc, "bucket") - if err != nil { - t.Fatalf("%d, expect no error, got %v", i, err) - } - if e, a := c.RespRegion, region; e != a { - t.Errorf("%d, expect %q region, got %q", i, e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/buffered_read_seeker_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/buffered_read_seeker_test.go deleted file mode 100644 index 0ffd02d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/buffered_read_seeker_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package s3manager - -import ( - "bytes" - "io" - "testing" - - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -func TestBufferedReadSeekerRead(t *testing.T) { - expected := []byte("testData") - - readSeeker := NewBufferedReadSeeker(bytes.NewReader(expected), make([]byte, 4)) - - var ( - actual []byte - buffer = make([]byte, 2) - ) - - for { - n, err := readSeeker.Read(buffer) - actual = append(actual, buffer[:n]...) - if err != nil && err == io.EOF { - break - } else if err != nil { - t.Fatalf("failed to read from reader: %v", err) - } - } - - if !bytes.Equal(expected, actual) { - t.Errorf("expected %v, got %v", expected, actual) - } -} - -func TestBufferedReadSeekerSeek(t *testing.T) { - content := []byte("testData") - - readSeeker := NewBufferedReadSeeker(bytes.NewReader(content), make([]byte, 4)) - - _, err := readSeeker.Seek(4, sdkio.SeekStart) - if err != nil { - t.Fatalf("failed to seek reader: %v", err) - } - - var ( - actual []byte - buffer = make([]byte, 4) - ) - - for { - n, err := readSeeker.Read(buffer) - actual = append(actual, buffer[:n]...) - if err != nil && err == io.EOF { - break - } else if err != nil { - t.Fatalf("failed to read from reader: %v", err) - } - } - - if e := []byte("Data"); !bytes.Equal(e, actual) { - t.Errorf("expected %v, got %v", e, actual) - } -} - -func TestBufferedReadSeekerReadAt(t *testing.T) { - content := []byte("testData") - - readSeeker := NewBufferedReadSeeker(bytes.NewReader(content), make([]byte, 2)) - - buffer := make([]byte, 4) - - _, err := readSeeker.ReadAt(buffer, 0) - if err != nil { - t.Fatalf("failed to seek reader: %v", err) - } - - if e := content[:4]; !bytes.Equal(e, buffer) { - t.Errorf("expected %v, got %v", e, buffer) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download_test.go deleted file mode 100644 index a1700d8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/download_test.go +++ /dev/null @@ -1,842 +0,0 @@ -package s3manager_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "math/rand" - "net/http" - "reflect" - "regexp" - "strconv" - "strings" - "sync" - "sync/atomic" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/internal/sdkio" - "github.com/aws/aws-sdk-go/internal/sdkrand" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -func dlLoggingSvc(data []byte) (*s3.S3, *[]string, *[]string) { - var m sync.Mutex - names := []string{} - ranges := []string{} - - svc := s3.New(unit.Session) - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - names = append(names, r.Operation.Name) - ranges = append(ranges, *r.Params.(*s3.GetObjectInput).Range) - - rerng := regexp.MustCompile(`bytes=(\d+)-(\d+)`) - rng := rerng.FindStringSubmatch(r.HTTPRequest.Header.Get("Range")) - start, _ := strconv.ParseInt(rng[1], 10, 64) - fin, _ := strconv.ParseInt(rng[2], 10, 64) - fin++ - - if fin > int64(len(data)) { - fin = int64(len(data)) - } - - bodyBytes := data[start:fin] - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader(bodyBytes)), - Header: http.Header{}, - } - r.HTTPResponse.Header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", - start, fin-1, len(data))) - r.HTTPResponse.Header.Set("Content-Length", fmt.Sprintf("%d", len(bodyBytes))) - }) - - return svc, &names, &ranges -} - -func dlLoggingSvcNoChunk(data []byte) (*s3.S3, *[]string) { - var m sync.Mutex - names := []string{} - - svc := s3.New(unit.Session) - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - names = append(names, r.Operation.Name) - - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader(data[:])), - Header: http.Header{}, - } - r.HTTPResponse.Header.Set("Content-Length", fmt.Sprintf("%d", len(data))) - }) - - return svc, &names -} - -func dlLoggingSvcNoContentRangeLength(data []byte, states []int) (*s3.S3, *[]string) { - var m sync.Mutex - names := []string{} - var index int - - svc := s3.New(unit.Session) - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - names = append(names, r.Operation.Name) - - r.HTTPResponse = &http.Response{ - StatusCode: states[index], - Body: ioutil.NopCloser(bytes.NewReader(data[:])), - Header: http.Header{}, - } - index++ - }) - - return svc, &names -} - -func dlLoggingSvcContentRangeTotalAny(data []byte, states []int) (*s3.S3, *[]string) { - var m sync.Mutex - names := []string{} - ranges := []string{} - var index int - - svc := s3.New(unit.Session) - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - names = append(names, r.Operation.Name) - ranges = append(ranges, *r.Params.(*s3.GetObjectInput).Range) - - rerng := regexp.MustCompile(`bytes=(\d+)-(\d+)`) - rng := rerng.FindStringSubmatch(r.HTTPRequest.Header.Get("Range")) - start, _ := strconv.ParseInt(rng[1], 10, 64) - fin, _ := strconv.ParseInt(rng[2], 10, 64) - fin++ - - if fin >= int64(len(data)) { - fin = int64(len(data)) - } - - // Setting start and finish to 0 because this state of 1 is suppose to - // be an error state of 416 - if index == len(states)-1 { - start = 0 - fin = 0 - } - - bodyBytes := data[start:fin] - - r.HTTPResponse = &http.Response{ - StatusCode: states[index], - Body: ioutil.NopCloser(bytes.NewReader(bodyBytes)), - Header: http.Header{}, - } - r.HTTPResponse.Header.Set("Content-Range", fmt.Sprintf("bytes %d-%d/*", - start, fin-1)) - index++ - }) - - return svc, &names -} - -func dlLoggingSvcWithErrReader(cases []testErrReader) (*s3.S3, *[]string) { - var m sync.Mutex - names := []string{} - var index int - - svc := s3.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(len(cases) - 1), - }) - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - names = append(names, r.Operation.Name) - - c := cases[index] - - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusOK, - Body: ioutil.NopCloser(&c), - Header: http.Header{}, - } - r.HTTPResponse.Header.Set("Content-Range", - fmt.Sprintf("bytes %d-%d/%d", 0, c.Len-1, c.Len)) - r.HTTPResponse.Header.Set("Content-Length", fmt.Sprintf("%d", c.Len)) - index++ - }) - - return svc, &names -} - -func TestDownloadOrder(t *testing.T) { - s, names, ranges := dlLoggingSvc(buf12MB) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - - w := aws.NewWriteAtBuffer(make([]byte, len(buf12MB))) - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(len(buf12MB)), n; e != a { - t.Errorf("expect %d buffer length, got %d", e, a) - } - - expectCalls := []string{"GetObject", "GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - - expectRngs := []string{"bytes=0-5242879", "bytes=5242880-10485759", "bytes=10485760-15728639"} - if e, a := expectRngs, *ranges; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v ranges, got %v", e, a) - } -} - -func TestDownloadZero(t *testing.T) { - s, names, ranges := dlLoggingSvc([]byte{}) - - d := s3manager.NewDownloaderWithClient(s) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if n != 0 { - t.Errorf("expect 0 bytes read, got %d", n) - } - expectCalls := []string{"GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - - expectRngs := []string{"bytes=0-5242879"} - if e, a := expectRngs, *ranges; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v ranges, got %v", e, a) - } -} - -func TestDownloadSetPartSize(t *testing.T) { - s, names, ranges := dlLoggingSvc([]byte{1, 2, 3}) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - d.PartSize = 1 - }) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(3), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject", "GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - expectRngs := []string{"bytes=0-0", "bytes=1-1", "bytes=2-2"} - if e, a := expectRngs, *ranges; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v ranges, got %v", e, a) - } - expectBytes := []byte{1, 2, 3} - if e, a := expectBytes, w.Bytes(); !reflect.DeepEqual(e, a) { - t.Errorf("expect %v bytes, got %v", e, a) - } -} - -func TestDownloadError(t *testing.T) { - s, names, _ := dlLoggingSvc([]byte{1, 2, 3}) - - num := 0 - s.Handlers.Send.PushBack(func(r *request.Request) { - num++ - if num > 1 { - r.HTTPResponse.StatusCode = 400 - r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) - } - }) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - d.PartSize = 1 - }) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err == nil { - t.Fatalf("expect error, got none") - } - aerr := err.(awserr.Error) - if e, a := "BadRequest", aerr.Code(); e != a { - t.Errorf("expect %s error code, got %s", e, a) - } - if e, a := int64(1), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - expectBytes := []byte{1} - if e, a := expectBytes, w.Bytes(); !reflect.DeepEqual(e, a) { - t.Errorf("expect %v bytes, got %v", e, a) - } -} - -func TestDownloadNonChunk(t *testing.T) { - s, names := dlLoggingSvcNoChunk(buf2MB) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(len(buf2MB)), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - - count := 0 - for _, b := range w.Bytes() { - count += int(b) - } - if count != 0 { - t.Errorf("expect 0 count, got %d", count) - } -} - -func TestDownloadNoContentRangeLength(t *testing.T) { - s, names := dlLoggingSvcNoContentRangeLength(buf2MB, []int{200, 416}) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(len(buf2MB)), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - - count := 0 - for _, b := range w.Bytes() { - count += int(b) - } - if count != 0 { - t.Errorf("expect 0 count, got %d", count) - } -} - -func TestDownloadContentRangeTotalAny(t *testing.T) { - s, names := dlLoggingSvcContentRangeTotalAny(buf2MB, []int{200, 416}) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(len(buf2MB)), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - - count := 0 - for _, b := range w.Bytes() { - count += int(b) - } - if count != 0 { - t.Errorf("expect 0 count, got %d", count) - } -} - -func TestDownloadPartBodyRetry_SuccessRetry(t *testing.T) { - s, names := dlLoggingSvcWithErrReader([]testErrReader{ - {Buf: []byte("ab"), Len: 3, Err: io.ErrUnexpectedEOF}, - {Buf: []byte("123"), Len: 3, Err: io.EOF}, - }) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(3), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject", "GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - if e, a := "123", string(w.Bytes()); e != a { - t.Errorf("expect %q response, got %q", e, a) - } -} - -func TestDownloadPartBodyRetry_SuccessNoRetry(t *testing.T) { - s, names := dlLoggingSvcWithErrReader([]testErrReader{ - {Buf: []byte("abc"), Len: 3, Err: io.EOF}, - }) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(3), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - if e, a := "abc", string(w.Bytes()); e != a { - t.Errorf("expect %q response, got %q", e, a) - } -} - -func TestDownloadPartBodyRetry_FailRetry(t *testing.T) { - s, names := dlLoggingSvcWithErrReader([]testErrReader{ - {Buf: []byte("ab"), Len: 3, Err: io.ErrUnexpectedEOF}, - }) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 1 - }) - - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "unexpected EOF", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %q error message to be in %q", e, a) - } - if e, a := int64(2), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - if e, a := "ab", string(w.Bytes()); e != a { - t.Errorf("expect %q response, got %q", e, a) - } -} - -func TestDownloadWithContextCanceled(t *testing.T) { - d := s3manager.NewDownloader(unit.Session) - - params := s3.GetObjectInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - } - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - ctx.Error = fmt.Errorf("context canceled") - close(ctx.DoneCh) - - w := &aws.WriteAtBuffer{} - - _, err := d.DownloadWithContext(ctx, w, ¶ms) - if err == nil { - t.Fatalf("expected error, did not get one") - } - aerr := err.(awserr.Error) - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expected error code %q, got %q", e, a) - } - if e, a := "canceled", aerr.Message(); !strings.Contains(a, e) { - t.Errorf("expected error message to contain %q, but did not %q", e, a) - } -} - -func TestDownload_WithRange(t *testing.T) { - s, names, ranges := dlLoggingSvc([]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) - - d := s3manager.NewDownloaderWithClient(s, func(d *s3manager.Downloader) { - d.Concurrency = 10 // should be ignored - d.PartSize = 1 // should be ignored - }) - - w := &aws.WriteAtBuffer{} - n, err := d.Download(w, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - Range: aws.String("bytes=2-6"), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := int64(5), n; e != a { - t.Errorf("expect %d bytes read, got %d", e, a) - } - expectCalls := []string{"GetObject"} - if e, a := expectCalls, *names; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v API calls, got %v", e, a) - } - expectRngs := []string{"bytes=2-6"} - if e, a := expectRngs, *ranges; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v ranges, got %v", e, a) - } - expectBytes := []byte{2, 3, 4, 5, 6} - if e, a := expectBytes, w.Bytes(); !reflect.DeepEqual(e, a) { - t.Errorf("expect %v bytes, got %v", e, a) - } -} - -func TestDownload_WithFailure(t *testing.T) { - svc := s3.New(unit.Session) - svc.Handlers.Send.Clear() - - reqCount := int64(0) - startingByte := 0 - svc.Handlers.Send.PushBack(func(r *request.Request) { - switch atomic.LoadInt64(&reqCount) { - case 1: - // Give a chance for the multipart chunks to be queued up - time.Sleep(1 * time.Second) - - r.HTTPResponse = &http.Response{ - Header: http.Header{}, - Body: ioutil.NopCloser(&bytes.Buffer{}), - } - r.Error = awserr.New("ConnectionError", "some connection error", nil) - r.Retryable = aws.Bool(false) - - default: - body := bytes.NewReader(make([]byte, s3manager.DefaultDownloadPartSize)) - r.HTTPResponse = &http.Response{ - StatusCode: http.StatusOK, - Status: http.StatusText(http.StatusOK), - ContentLength: int64(body.Len()), - Body: ioutil.NopCloser(body), - Header: http.Header{}, - } - r.HTTPResponse.Header.Set("Content-Length", strconv.Itoa(body.Len())) - r.HTTPResponse.Header.Set("Content-Range", - fmt.Sprintf("bytes %d-%d/%d", startingByte, body.Len()-1, body.Len()*10)) - - startingByte += body.Len() - if reqCount > 0 { - // sleep here to ensure context switching between goroutines - time.Sleep(25 * time.Millisecond) - } - } - - atomic.AddInt64(&reqCount, 1) - }) - - d := s3manager.NewDownloaderWithClient(svc, func(d *s3manager.Downloader) { - d.Concurrency = 2 - }) - - w := &aws.WriteAtBuffer{} - params := s3.GetObjectInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - } - - // Expect this request to exit quickly after failure - _, err := d.Download(w, ¶ms) - if err == nil { - t.Fatalf("expect error, got none") - } - - if atomic.LoadInt64(&reqCount) > 3 { - t.Errorf("expect no more than 3 requests, but received %d", reqCount) - } -} - -func TestDownloadBufferStrategy(t *testing.T) { - cases := map[string]struct { - partSize int64 - strategy *recordedWriterReadFromProvider - expectedSize int64 - }{ - "no strategy": { - partSize: s3manager.DefaultDownloadPartSize, - expectedSize: 10 * sdkio.MebiByte, - }, - "partSize modulo bufferSize == 0": { - partSize: 5 * sdkio.MebiByte, - strategy: &recordedWriterReadFromProvider{ - WriterReadFromProvider: s3manager.NewPooledBufferedWriterReadFromProvider(int(sdkio.MebiByte)), // 1 MiB - }, - expectedSize: 10 * sdkio.MebiByte, // 10 MiB - }, - "partSize modulo bufferSize > 0": { - partSize: 5 * 1024 * 1204, // 5 MiB - strategy: &recordedWriterReadFromProvider{ - WriterReadFromProvider: s3manager.NewPooledBufferedWriterReadFromProvider(2 * int(sdkio.MebiByte)), // 2 MiB - }, - expectedSize: 10 * sdkio.MebiByte, // 10 MiB - }, - } - - for name, tCase := range cases { - t.Logf("starting case: %v", name) - - expected := getTestBytes(int(tCase.expectedSize)) - - svc, _, _ := dlLoggingSvc(expected) - - d := s3manager.NewDownloaderWithClient(svc, func(d *s3manager.Downloader) { - d.PartSize = tCase.partSize - if tCase.strategy != nil { - d.BufferProvider = tCase.strategy - } - }) - - buffer := aws.NewWriteAtBuffer(make([]byte, len(expected))) - - n, err := d.Download(buffer, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - if err != nil { - t.Errorf("failed to download: %v", err) - } - - if e, a := len(expected), int(n); e != a { - t.Errorf("expected %v, got %v downloaded bytes", e, a) - } - - if e, a := expected, buffer.Bytes(); !bytes.Equal(e, a) { - t.Errorf("downloaded bytes did not match expected") - } - - if tCase.strategy != nil { - if e, a := tCase.strategy.callbacksVended, tCase.strategy.callbacksExecuted; e != a { - t.Errorf("expected %v, got %v", e, a) - } - } - } -} - -var randBytes = func() []byte { - rr := rand.New(rand.NewSource(0)) - b := make([]byte, 10*sdkio.MebiByte) - - if _, err := sdkrand.Read(rr, b); err != nil { - panic(fmt.Sprintf("failed to read random bytes, %v", err)) - } - return b -}() - -func getTestBytes(size int) []byte { - if len(randBytes) >= size { - return randBytes[:size] - } - - b := append(randBytes, getTestBytes(size-len(randBytes))...) - return b -} - -type testErrReader struct { - Buf []byte - Err error - Len int64 - - off int -} - -func (r *testErrReader) Read(p []byte) (int, error) { - to := len(r.Buf) - r.off - - n := copy(p, r.Buf[r.off:to]) - r.off += n - - if n < len(p) { - return n, r.Err - - } - - return n, nil -} - -func TestDownloadBufferStrategy_Errors(t *testing.T) { - expected := getTestBytes(int(10 * sdkio.MebiByte)) - - svc, _, _ := dlLoggingSvc(expected) - strat := &recordedWriterReadFromProvider{ - WriterReadFromProvider: s3manager.NewPooledBufferedWriterReadFromProvider(int(2 * sdkio.MebiByte)), - } - - d := s3manager.NewDownloaderWithClient(svc, func(d *s3manager.Downloader) { - d.PartSize = 5 * sdkio.MebiByte - d.BufferProvider = strat - d.Concurrency = 1 - }) - - seenOps := make(map[string]struct{}) - svc.Handlers.Send.PushFront(func(*request.Request) {}) - svc.Handlers.Send.AfterEachFn = func(item request.HandlerListRunItem) bool { - r := item.Request - - if r.Operation.Name != "GetObject" { - return true - } - - input := r.Params.(*s3.GetObjectInput) - - fingerPrint := fmt.Sprintf("%s/%s/%s/%s", r.Operation.Name, *input.Bucket, *input.Key, *input.Range) - if _, ok := seenOps[fingerPrint]; ok { - return true - } - seenOps[fingerPrint] = struct{}{} - - regex := regexp.MustCompile(`bytes=(\d+)-(\d+)`) - rng := regex.FindStringSubmatch(*input.Range) - start, _ := strconv.ParseInt(rng[1], 10, 64) - fin, _ := strconv.ParseInt(rng[2], 10, 64) - - _, _ = io.Copy(ioutil.Discard, r.Body) - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: aws.ReadSeekCloser(&badReader{err: io.ErrUnexpectedEOF}), - ContentLength: fin - start, - } - - return false - } - - buffer := aws.NewWriteAtBuffer(make([]byte, len(expected))) - - n, err := d.Download(buffer, &s3.GetObjectInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - }) - if err != nil { - t.Errorf("failed to download: %v", err) - } - - if e, a := len(expected), int(n); e != a { - t.Errorf("expected %v, got %v downloaded bytes", e, a) - } - - if e, a := expected, buffer.Bytes(); !bytes.Equal(e, a) { - t.Errorf("downloaded bytes did not match expected") - } - - if e, a := strat.callbacksVended, strat.callbacksExecuted; e != a { - t.Errorf("expected %v, got %v", e, a) - } -} - -type recordedWriterReadFromProvider struct { - callbacksVended uint32 - callbacksExecuted uint32 - s3manager.WriterReadFromProvider -} - -func (r *recordedWriterReadFromProvider) GetReadFrom(writer io.Writer) (s3manager.WriterReadFrom, func()) { - w, cleanup := r.WriterReadFromProvider.GetReadFrom(writer) - - atomic.AddUint32(&r.callbacksVended, 1) - return w, func() { - atomic.AddUint32(&r.callbacksExecuted, 1) - cleanup() - } -} - -type badReader struct { - err error -} - -func (b *badReader) Read(p []byte) (int, error) { - tb := getTestBytes(len(p)) - copy(p, tb) - - return len(p), b.err -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/exmaples_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/exmaples_test.go deleted file mode 100644 index 202974e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/exmaples_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package s3manager_test - -import ( - "bytes" - "fmt" - "net/http" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -// ExampleNewUploader_overrideReadSeekerProvider gives an example -// on a custom ReadSeekerWriteToProvider can be provided to Uploader -// to define how parts will be buffered in memory. -func ExampleNewUploader_overrideReadSeekerProvider() { - sess := session.Must(session.NewSession()) - - uploader := s3manager.NewUploader(sess, func(u *s3manager.Uploader) { - // Define a strategy that will buffer 25 MiB in memory - u.BufferProvider = s3manager.NewBufferedReadSeekerWriteToPool(25 * 1024 * 1024) - }) - - _, err := uploader.Upload(&s3manager.UploadInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("largeobject"), - Body: bytes.NewReader([]byte("large_multi_part_upload")), - }) - if err != nil { - fmt.Println(err.Error()) - } -} - -// ExampleNewUploader_overrideTransport gives an example -// on how to override the default HTTP transport. This can -// be used to tune timeouts such as response headers, or -// write / read buffer usage when writing or reading respectively -// from the net/http transport. -func ExampleNewUploader_overrideTransport() { - // Create Transport - tr := &http.Transport{ - ResponseHeaderTimeout: 1 * time.Second, - // WriteBufferSize: 1024*1024 // Go 1.13 - // ReadBufferSize: 1024*1024 // Go 1.13 - } - - sess := session.Must(session.NewSession(&aws.Config{ - HTTPClient: &http.Client{Transport: tr}, - })) - - uploader := s3manager.NewUploader(sess) - - _, err := uploader.Upload(&s3manager.UploadInput{ - Bucket: aws.String("examplebucket"), - Key: aws.String("largeobject"), - Body: bytes.NewReader([]byte("large_multi_part_upload")), - }) - if err != nil { - fmt.Println(err.Error()) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_bucket_region_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_bucket_region_test.go deleted file mode 100644 index ac3f58a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_bucket_region_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build integration - -package s3manager_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -func TestGetBucketRegion(t *testing.T) { - expectRegion := aws.StringValue(integSess.Config.Region) - - ctx := aws.BackgroundContext() - region, err := s3manager.GetBucketRegion(ctx, integSess, - aws.StringValue(bucketName), expectRegion) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := expectRegion, region; e != a { - t.Errorf("expect %s bucket region, got %s", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_shared_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_shared_test.go deleted file mode 100644 index e5fd91d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_shared_test.go +++ /dev/null @@ -1,86 +0,0 @@ -// +build integration - -package s3manager_test - -import ( - "crypto/md5" - "fmt" - "io" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/awstesting/integration" - "github.com/aws/aws-sdk-go/awstesting/integration/s3integ" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -func init() { - integSess = integration.SessionWithDefaultRegion("us-west-2") -} - -var integSess *session.Session -var bucketName *string -var svc *s3.S3 - -func TestMain(m *testing.M) { - svc = s3.New(integSess) - bucketName = aws.String(s3integ.GenerateBucketName()) - if err := s3integ.SetupBucket(svc, *bucketName); err != nil { - panic(err) - } - - var result int - defer func() { - if err := s3integ.CleanupBucket(svc, *bucketName); err != nil { - fmt.Fprintln(os.Stderr, err) - } - if r := recover(); r != nil { - fmt.Fprintln(os.Stderr, "S3 integrationt tests paniced,", r) - result = 1 - } - os.Exit(result) - }() - - result = m.Run() -} - -type dlwriter struct { - buf []byte -} - -func newDLWriter(size int) *dlwriter { - return &dlwriter{buf: make([]byte, size)} -} - -func (d dlwriter) WriteAt(p []byte, pos int64) (n int, err error) { - if pos > int64(len(d.buf)) { - return 0, io.EOF - } - - written := 0 - for i, b := range p { - if i >= len(d.buf) { - break - } - d.buf[pos+int64(i)] = b - written++ - } - return written, nil -} - -func validate(t *testing.T, key string, md5value string) { - mgr := s3manager.NewDownloader(integSess) - params := &s3.GetObjectInput{Bucket: bucketName, Key: &key} - - w := newDLWriter(1024 * 1024 * 20) - n, err := mgr.Download(w, params) - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if e, a := md5value, fmt.Sprintf("%x", md5.Sum(w.buf[0:n])); e != a { - t.Errorf("expect %s md5 value, got %s", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_upload_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_upload_test.go deleted file mode 100644 index 3eadd99..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/integ_upload_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// +build integration - -package s3manager_test - -import ( - "bytes" - "crypto/md5" - "fmt" - "regexp" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -var integBuf12MB = make([]byte, 1024*1024*12) -var integMD512MB = fmt.Sprintf("%x", md5.Sum(integBuf12MB)) - -func TestUploadConcurrently(t *testing.T) { - key := "12mb-1" - mgr := s3manager.NewUploader(integSess) - out, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: bucketName, - Key: &key, - Body: bytes.NewReader(integBuf12MB), - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - if len(out.UploadID) == 0 { - t.Errorf("expect upload ID but was empty") - } - - re := regexp.MustCompile(`^https?://.+/` + key + `$`) - if e, a := re.String(), out.Location; !re.MatchString(a) { - t.Errorf("expect %s to match URL regexp %q, did not", e, a) - } - - validate(t, key, integMD512MB) -} - -func TestUploadFailCleanup(t *testing.T) { - // Break checksum on 2nd part so it fails - part := 0 - svc.Handlers.Build.PushBack(func(r *request.Request) { - if r.Operation.Name == "UploadPart" { - if part == 1 { - r.HTTPRequest.Header.Set("X-Amz-Content-Sha256", "000") - } - part++ - } - }) - - key := "12mb-leave" - mgr := s3manager.NewUploaderWithClient(svc, func(u *s3manager.Uploader) { - u.LeavePartsOnError = false - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: bucketName, - Key: &key, - Body: bytes.NewReader(integBuf12MB), - }) - if err == nil { - t.Fatalf("expect error, but did not get one") - } - - aerr := err.(awserr.Error) - if e, a := "MissingRegion", aerr.Code(); strings.Contains(a, e) { - t.Errorf("expect %q to not be in error code %q", e, a) - } - - uploadID := "" - merr := err.(s3manager.MultiUploadFailure) - if uploadID = merr.UploadID(); len(uploadID) == 0 { - t.Errorf("expect upload ID to not be empty, but was") - } - - _, err = svc.ListParts(&s3.ListPartsInput{ - Bucket: bucketName, Key: &key, UploadId: &uploadID, - }) - if err == nil { - t.Errorf("expect error for list parts, but got none") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/shared_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/shared_test.go deleted file mode 100644 index b5b6131..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/shared_test.go +++ /dev/null @@ -1,4 +0,0 @@ -package s3manager_test - -var buf12MB = make([]byte, 1024*1024*12) -var buf2MB = make([]byte, 1024*1024*2) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go index 8debfcd..96eef5c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload.go @@ -397,14 +397,18 @@ func (u *uploader) init() error { u.cfg.MaxUploadParts = MaxUploadParts } + // Try to get the total size for some optimizations + if err := u.initSize(); err != nil { + return err + } + // If PartSize was changed or partPool was never setup then we need to allocated a new pool // so that we return []byte slices of the correct size if u.cfg.partPool == nil || u.cfg.partPool.partSize != u.cfg.PartSize { u.cfg.partPool = newPartPool(u.cfg.PartSize) } - // Try to get the total size for some optimizations - return u.initSize() + return nil } // initSize tries to detect the total stream size, setting u.totalSize. If diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go index 3b21018..9a5b463 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_input.go @@ -97,10 +97,10 @@ type UploadInput struct { // The date and time when you want this object's Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // For information about downloading objects from Requester Pays buckets, see - // Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` @@ -127,12 +127,14 @@ type UploadInput struct { // If x-amz-server-side-encryption is present and has the value of aws:kms, // this header specifies the ID of the AWS Key Management Service (AWS KMS) - // customer master key (CMK) that was used for the object. + // symmetrical customer managed customer master key (CMK) that was used for + // the object. // // If the value of x-amz-server-side-encryption is aws:kms, this header specifies - // the ID of the AWS KMS CMK that will be used for the object. If you specify - // x-amz-server-side-encryption:aws:kms, but do not providex-amz-server-side-encryption-aws-kms-key-id, - // Amazon S3 uses the AWS managed CMK in AWS to protect the data. + // the ID of the symmetric customer managed AWS KMS CMK that will be used for + // the object. If you specify x-amz-server-side-encryption:aws:kms, but do not + // providex-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the AWS + // managed CMK in AWS to protect the data. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` // The server-side encryption algorithm used when storing this object in Amazon diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_test.go deleted file mode 100644 index f8763db..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/upload_test.go +++ /dev/null @@ -1,1415 +0,0 @@ -// +build go1.8 - -package s3manager_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - random "math/rand" - "net/http" - "net/http/httptest" - "os" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "sync" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/service/s3/s3manager" -) - -var emptyList = []string{} - -func val(i interface{}, s string) interface{} { - v, err := awsutil.ValuesAtPath(i, s) - if err != nil || len(v) == 0 { - return nil - } - if _, ok := v[0].(io.Reader); ok { - return v[0] - } - - if rv := reflect.ValueOf(v[0]); rv.Kind() == reflect.Ptr { - return rv.Elem().Interface() - } - - return v[0] -} - -func contains(src []string, s string) bool { - for _, v := range src { - if s == v { - return true - } - } - return false -} - -func loggingSvc(ignoreOps []string) (*s3.S3, *[]string, *[]interface{}) { - var m sync.Mutex - partNum := 0 - names := []string{} - params := []interface{}{} - svc := s3.New(unit.Session) - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.UnmarshalError.Clear() - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - m.Lock() - defer m.Unlock() - - if !contains(ignoreOps, r.Operation.Name) { - names = append(names, r.Operation.Name) - params = append(params, r.Params) - } - - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - - switch data := r.Data.(type) { - case *s3.CreateMultipartUploadOutput: - data.UploadId = aws.String("UPLOAD-ID") - case *s3.UploadPartOutput: - partNum++ - data.ETag = aws.String(fmt.Sprintf("ETAG%d", partNum)) - case *s3.CompleteMultipartUploadOutput: - data.Location = aws.String("https://location") - data.VersionId = aws.String("VERSION-ID") - case *s3.PutObjectOutput: - data.VersionId = aws.String("VERSION-ID") - } - }) - - return svc, &names, ¶ms -} - -func buflen(i interface{}) int { - r := i.(io.Reader) - b, _ := ioutil.ReadAll(r) - return len(b) -} - -func TestUploadOrderMulti(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - u := s3manager.NewUploaderWithClient(s) - - resp, err := u.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key - value"), - Body: bytes.NewReader(buf12MB), - ServerSideEncryption: aws.String("aws:kms"), - SSEKMSKeyId: aws.String("KmsId"), - ContentType: aws.String("content/type"), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - expected := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "UploadPart", "CompleteMultipartUpload"} - if !reflect.DeepEqual(expected, *ops) { - t.Errorf("Expected %v, but received %v", expected, *ops) - } - - if e, a := `https://s3.mock-region.amazonaws.com/Bucket/Key%20-%20value`, resp.Location; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if "UPLOAD-ID" != resp.UploadID { - t.Errorf("Expected %q, but received %q", "UPLOAD-ID", resp.UploadID) - } - - if "VERSION-ID" != *resp.VersionID { - t.Errorf("Expected %q, but received %q", "VERSION-ID", *resp.VersionID) - } - - // Validate input values - - // UploadPart - for i := 1; i < 5; i++ { - v := val((*args)[i], "UploadId") - if "UPLOAD-ID" != v { - t.Errorf("Expected %q, but received %q", "UPLOAD-ID", v) - } - } - - // CompleteMultipartUpload - v := val((*args)[4], "UploadId") - if "UPLOAD-ID" != v { - t.Errorf("Expected %q, but received %q", "UPLOAD-ID", v) - } - - for i := 0; i < 3; i++ { - e := val((*args)[4], fmt.Sprintf("MultipartUpload.Parts[%d].PartNumber", i)) - if int64(i+1) != e.(int64) { - t.Errorf("Expected %d, but received %d", i+1, e) - } - } - - vals := []string{ - val((*args)[4], "MultipartUpload.Parts[0].ETag").(string), - val((*args)[4], "MultipartUpload.Parts[1].ETag").(string), - val((*args)[4], "MultipartUpload.Parts[2].ETag").(string), - } - - for _, a := range vals { - if matched, err := regexp.MatchString(`^ETAG\d+$`, a); !matched || err != nil { - t.Errorf("Failed regexp expression `^ETAG\\d+$`") - } - } - - // Custom headers - e := val((*args)[0], "ServerSideEncryption") - if e != "aws:kms" { - t.Errorf("Expected %q, but received %q", "aws:kms", e) - } - - e = val((*args)[0], "SSEKMSKeyId") - if e != "KmsId" { - t.Errorf("Expected %q, but received %q", "KmsId", e) - } - - e = val((*args)[0], "ContentType") - if e != "content/type" { - t.Errorf("Expected %q, but received %q", "content/type", e) - } -} - -func TestUploadOrderMultiDifferentPartSize(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.PartSize = 1024 * 1024 * 7 - u.Concurrency = 1 - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf12MB), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - vals := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "CompleteMultipartUpload"} - if !reflect.DeepEqual(vals, *ops) { - t.Errorf("Expected %v, but received %v", vals, *ops) - } - - // Part lengths - if len := buflen(val((*args)[1], "Body")); 1024*1024*7 != len { - t.Errorf("Expected %d, but received %d", 1024*1024*7, len) - } - if len := buflen(val((*args)[2], "Body")); 1024*1024*5 != len { - t.Errorf("Expected %d, but received %d", 1024*1024*5, len) - } -} - -func TestUploadIncreasePartSize(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - u.MaxUploadParts = 2 - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf12MB), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if int64(s3manager.DefaultDownloadPartSize) != mgr.PartSize { - t.Errorf("Expected %d, but received %d", s3manager.DefaultDownloadPartSize, mgr.PartSize) - } - - vals := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "CompleteMultipartUpload"} - if !reflect.DeepEqual(vals, *ops) { - t.Errorf("Expected %v, but received %v", vals, *ops) - } - - // Part lengths - if len := buflen(val((*args)[1], "Body")); (1024*1024*6)+1 != len { - t.Errorf("Expected %d, but received %d", (1024*1024*6)+1, len) - } - - if len := buflen(val((*args)[2], "Body")); (1024*1024*6)-1 != len { - t.Errorf("Expected %d, but received %d", (1024*1024*6)-1, len) - } -} - -func TestUploadFailIfPartSizeTooSmall(t *testing.T) { - mgr := s3manager.NewUploader(unit.Session, func(u *s3manager.Uploader) { - u.PartSize = 5 - }) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf12MB), - }) - - if resp != nil { - t.Errorf("Expected response to be nil, but received %v", resp) - } - - if err == nil { - t.Errorf("Expected error, but received nil") - } - - aerr := err.(awserr.Error) - if e, a := "ConfigError", aerr.Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := "part size must be at least", aerr.Message(); !strings.Contains(a, e) { - t.Errorf("expect %v to be in %v", e, a) - } -} - -func TestUploadOrderSingle(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key - value"), - Body: bytes.NewReader(buf2MB), - ServerSideEncryption: aws.String("aws:kms"), - SSEKMSKeyId: aws.String("KmsId"), - ContentType: aws.String("content/type"), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if vals := []string{"PutObject"}; !reflect.DeepEqual(vals, *ops) { - t.Errorf("Expected %v, but received %v", vals, *ops) - } - - if e, a := `https://s3.mock-region.amazonaws.com/Bucket/Key%20-%20value`, resp.Location; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e := "VERSION-ID"; e != *resp.VersionID { - t.Errorf("Expected %q, but received %q", e, *resp.VersionID) - } - - if len(resp.UploadID) > 0 { - t.Errorf("Expected empty string, but received %q", resp.UploadID) - } - - if e, a := "aws:kms", val((*args)[0], "ServerSideEncryption").(string); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := "KmsId", val((*args)[0], "SSEKMSKeyId").(string); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := "content/type", val((*args)[0], "ContentType").(string); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } -} - -func TestUploadOrderSingleFailure(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse.StatusCode = 400 - }) - mgr := s3manager.NewUploaderWithClient(s) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf2MB), - }) - - if err == nil { - t.Error("Expected error, but receievd nil") - } - - if vals := []string{"PutObject"}; !reflect.DeepEqual(vals, *ops) { - t.Errorf("Expected %v, but received %v", vals, *ops) - } - - if resp != nil { - t.Errorf("Expected response to be nil, but received %v", resp) - } -} - -func TestUploadOrderZero(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(make([]byte, 0)), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if vals := []string{"PutObject"}; !reflect.DeepEqual(vals, *ops) { - t.Errorf("Expected %v, but received %v", vals, *ops) - } - - if len(resp.Location) == 0 { - t.Error("Expected Location to not be empty") - } - - if len(resp.UploadID) > 0 { - t.Errorf("Expected empty string, but received %q", resp.UploadID) - } - - if e, a := 0, buflen(val((*args)[0], "Body")); e != a { - t.Errorf("Expected %d, but received %d", e, a) - } -} - -func TestUploadOrderMultiFailure(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - s.Handlers.Send.PushBack(func(r *request.Request) { - switch t := r.Data.(type) { - case *s3.UploadPartOutput: - if *t.ETag == "ETAG2" { - r.HTTPResponse.StatusCode = 400 - } - } - }) - - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf12MB), - }) - - if err == nil { - t.Error("Expected error, but receievd nil") - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "AbortMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } -} - -func TestUploadOrderMultiFailureOnComplete(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - s.Handlers.Send.PushBack(func(r *request.Request) { - switch r.Data.(type) { - case *s3.CompleteMultipartUploadOutput: - r.HTTPResponse.StatusCode = 400 - } - }) - - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(buf12MB), - }) - - if err == nil { - t.Error("Expected error, but receievd nil") - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", - "UploadPart", "CompleteMultipartUpload", "AbortMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } -} - -func TestUploadOrderMultiFailureOnCreate(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - s.Handlers.Send.PushBack(func(r *request.Request) { - switch r.Data.(type) { - case *s3.CreateMultipartUploadOutput: - r.HTTPResponse.StatusCode = 400 - } - }) - - mgr := s3manager.NewUploaderWithClient(s) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(make([]byte, 1024*1024*12)), - }) - - if err == nil { - t.Error("Expected error, but receievd nil") - } - - if e, a := []string{"CreateMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } -} - -func TestUploadOrderMultiFailureLeaveParts(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - s.Handlers.Send.PushBack(func(r *request.Request) { - switch data := r.Data.(type) { - case *s3.UploadPartOutput: - if *data.ETag == "ETAG2" { - r.HTTPResponse.StatusCode = 400 - } - } - }) - - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - u.LeavePartsOnError = true - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(make([]byte, 1024*1024*12)), - }) - - if err == nil { - t.Error("Expected error, but receievd nil") - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } -} - -type failreader struct { - times int - failCount int -} - -func (f *failreader) Read(b []byte) (int, error) { - f.failCount++ - if f.failCount >= f.times { - return 0, fmt.Errorf("random failure") - } - return len(b), nil -} - -func TestUploadOrderReadFail1(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &failreader{times: 1}, - }) - - if e, a := "ReadRequestBody", err.(awserr.Error).Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := err.(awserr.Error).OrigErr().Error(), "random failure"; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := []string{}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } -} - -func TestUploadOrderReadFail2(t *testing.T) { - s, ops, _ := loggingSvc([]string{"UploadPart"}) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &failreader{times: 2}, - }) - - if e, a := "MultipartUpload", err.(awserr.Error).Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := "ReadRequestBody", err.(awserr.Error).OrigErr().(awserr.Error).Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if errStr := err.(awserr.Error).OrigErr().Error(); !strings.Contains(errStr, "random failure") { - t.Errorf("Expected error to contains 'random failure', but was %q", errStr) - } - - if e, a := []string{"CreateMultipartUpload", "AbortMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } -} - -type sizedReader struct { - size int - cur int - err error -} - -func (s *sizedReader) Read(p []byte) (n int, err error) { - if s.cur >= s.size { - if s.err == nil { - s.err = io.EOF - } - return 0, s.err - } - - n = len(p) - s.cur += len(p) - if s.cur > s.size { - n -= s.cur - s.size - } - - return n, err -} - -func TestUploadOrderMultiBufferedReader(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &sizedReader{size: 1024 * 1024 * 12}, - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "UploadPart", "CompleteMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } - - // Part lengths - parts := []int{ - buflen(val((*args)[1], "Body")), - buflen(val((*args)[2], "Body")), - buflen(val((*args)[3], "Body")), - } - sort.Ints(parts) - - if e, a := []int{1024 * 1024 * 2, 1024 * 1024 * 5, 1024 * 1024 * 5}, parts; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } -} - -func TestUploadOrderMultiBufferedReaderPartial(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &sizedReader{size: 1024 * 1024 * 12, err: io.EOF}, - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "UploadPart", "CompleteMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } - - // Part lengths - parts := []int{ - buflen(val((*args)[1], "Body")), - buflen(val((*args)[2], "Body")), - buflen(val((*args)[3], "Body")), - } - sort.Ints(parts) - - if e, a := []int{1024 * 1024 * 2, 1024 * 1024 * 5, 1024 * 1024 * 5}, parts; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } -} - -// TestUploadOrderMultiBufferedReaderEOF tests the edge case where the -// file size is the same as part size. -func TestUploadOrderMultiBufferedReaderEOF(t *testing.T) { - s, ops, args := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &sizedReader{size: 1024 * 1024 * 10, err: io.EOF}, - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if e, a := []string{"CreateMultipartUpload", "UploadPart", "UploadPart", "CompleteMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } - - // Part lengths - parts := []int{ - buflen(val((*args)[1], "Body")), - buflen(val((*args)[2], "Body")), - } - sort.Ints(parts) - - if e, a := []int{1024 * 1024 * 5, 1024 * 1024 * 5}, parts; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } -} - -func TestUploadOrderMultiBufferedReaderExceedTotalParts(t *testing.T) { - s, ops, _ := loggingSvc([]string{"UploadPart"}) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - u.MaxUploadParts = 2 - }) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &sizedReader{size: 1024 * 1024 * 12}, - }) - - if err == nil { - t.Error("Expected an error, but received nil") - } - - if resp != nil { - t.Errorf("Expected nil, but receievd %v", resp) - } - - if e, a := []string{"CreateMultipartUpload", "AbortMultipartUpload"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but receievd %v", e, a) - } - - aerr := err.(awserr.Error) - if e, a := "MultipartUpload", aerr.Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if e, a := "TotalPartsExceeded", aerr.OrigErr().(awserr.Error).Code(); e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - if !strings.Contains(aerr.Error(), "configured MaxUploadParts (2)") { - t.Errorf("Expected error to contain 'configured MaxUploadParts (2)', but receievd %q", aerr.Error()) - } -} - -func TestUploadOrderSingleBufferedReader(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &sizedReader{size: 1024 * 1024 * 2}, - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if e, a := []string{"PutObject"}, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("Expected %v, but received %v", e, a) - } - - if len(resp.Location) == 0 { - t.Error("Expected a value in Location but received empty string") - } - - if len(resp.UploadID) > 0 { - t.Errorf("Expected empty string but received %q", resp.UploadID) - } -} - -func TestUploadZeroLenObject(t *testing.T) { - requestMade := false - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - requestMade = true - w.WriteHeader(http.StatusOK) - })) - defer server.Close() - mgr := s3manager.NewUploaderWithClient(s3.New(unit.Session, &aws.Config{ - Endpoint: aws.String(server.URL), - })) - resp, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: strings.NewReader(""), - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - if !requestMade { - t.Error("Expected request to have been made, but was not") - } - - if len(resp.Location) == 0 { - t.Error("Expected a non-empty string value for Location") - } - - if len(resp.UploadID) > 0 { - t.Errorf("Expected empty string, but received %q", resp.UploadID) - } -} - -func TestUploadInputS3PutObjectInputPairity(t *testing.T) { - matchings := compareStructType(reflect.TypeOf(s3.PutObjectInput{}), - reflect.TypeOf(s3manager.UploadInput{})) - aOnly := []string{} - bOnly := []string{} - - for k, c := range matchings { - if c == 1 && k != "ContentLength" { - aOnly = append(aOnly, k) - } else if c == 2 { - bOnly = append(bOnly, k) - } - } - - if len(aOnly) > 0 { - t.Errorf("Expected empty array, but received %v", aOnly) - } - - if len(bOnly) > 0 { - t.Errorf("Expected empty array, but received %v", bOnly) - } -} - -type testIncompleteReader struct { - Size int64 - read int64 -} - -func (r *testIncompleteReader) Read(p []byte) (n int, err error) { - r.read += int64(len(p)) - if r.read >= r.Size { - return int(r.read - r.Size), io.ErrUnexpectedEOF - } - return len(p), nil -} - -func TestUploadUnexpectedEOF(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - u.PartSize = s3manager.MinUploadPartSize - }) - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &testIncompleteReader{ - Size: int64(s3manager.MinUploadPartSize + 1), - }, - }) - if err == nil { - t.Error("Expected error, but received none") - } - - // Ensure upload started. - if e, a := "CreateMultipartUpload", (*ops)[0]; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } - - // Part may or may not be sent because of timing of sending parts and - // reading next part in upload manager. Just check for the last abort. - if e, a := "AbortMultipartUpload", (*ops)[len(*ops)-1]; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } -} - -func compareStructType(a, b reflect.Type) map[string]int { - if a.Kind() != reflect.Struct || b.Kind() != reflect.Struct { - panic(fmt.Sprintf("types must both be structs, got %v and %v", a.Kind(), b.Kind())) - } - - aFields := enumFields(a) - bFields := enumFields(b) - - matchings := map[string]int{} - - for i := 0; i < len(aFields) || i < len(bFields); i++ { - if i < len(aFields) { - c := matchings[aFields[i].Name] - matchings[aFields[i].Name] = c + 1 - } - if i < len(bFields) { - c := matchings[bFields[i].Name] - matchings[bFields[i].Name] = c + 2 - } - } - - return matchings -} - -func enumFields(v reflect.Type) []reflect.StructField { - fields := []reflect.StructField{} - - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - // Ignoreing anon fields - if field.PkgPath != "" { - // Ignore unexported fields - continue - } - - fields = append(fields, field) - } - - return fields -} - -type fooReaderAt struct{} - -func (r *fooReaderAt) Read(p []byte) (n int, err error) { - return 12, io.EOF -} - -func (r *fooReaderAt) ReadAt(p []byte, off int64) (n int, err error) { - return 12, io.EOF -} - -func TestReaderAt(t *testing.T) { - svc := s3.New(unit.Session) - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.UnmarshalError.Clear() - svc.Handlers.Send.Clear() - - contentLen := "" - svc.Handlers.Send.PushBack(func(r *request.Request) { - contentLen = r.HTTPRequest.Header.Get("Content-Length") - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - }) - - mgr := s3manager.NewUploaderWithClient(svc, func(u *s3manager.Uploader) { - u.Concurrency = 1 - }) - - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: &fooReaderAt{}, - }) - - if err != nil { - t.Errorf("Expected no error but received %v", err) - } - - if e, a := "12", contentLen; e != a { - t.Errorf("Expected %q, but received %q", e, a) - } -} - -func TestSSE(t *testing.T) { - svc := s3.New(unit.Session) - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.UnmarshalError.Clear() - svc.Handlers.ValidateResponse.Clear() - svc.Handlers.Send.Clear() - partNum := 0 - mutex := &sync.Mutex{} - - svc.Handlers.Send.PushBack(func(r *request.Request) { - mutex.Lock() - defer mutex.Unlock() - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - switch data := r.Data.(type) { - case *s3.CreateMultipartUploadOutput: - data.UploadId = aws.String("UPLOAD-ID") - case *s3.UploadPartOutput: - input := r.Params.(*s3.UploadPartInput) - if input.SSECustomerAlgorithm == nil { - t.Fatal("SSECustomerAlgoritm should not be nil") - } - if input.SSECustomerKey == nil { - t.Fatal("SSECustomerKey should not be nil") - } - partNum++ - data.ETag = aws.String(fmt.Sprintf("ETAG%d", partNum)) - case *s3.CompleteMultipartUploadOutput: - data.Location = aws.String("https://location") - data.VersionId = aws.String("VERSION-ID") - case *s3.PutObjectOutput: - data.VersionId = aws.String("VERSION-ID") - } - - }) - - mgr := s3manager.NewUploaderWithClient(svc, func(u *s3manager.Uploader) { - u.Concurrency = 5 - }) - - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - SSECustomerAlgorithm: aws.String("AES256"), - SSECustomerKey: aws.String("foo"), - Body: bytes.NewBuffer(make([]byte, 1024*1024*10)), - }) - - if err != nil { - t.Fatal("Expected no error, but received" + err.Error()) - } -} - -func TestUploadWithContextCanceled(t *testing.T) { - u := s3manager.NewUploader(unit.Session) - - params := s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: bytes.NewReader(make([]byte, 0)), - } - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} - ctx.Error = fmt.Errorf("context canceled") - close(ctx.DoneCh) - - _, err := u.UploadWithContext(ctx, ¶ms) - if err == nil { - t.Fatalf("expected error, did not get one") - } - aerr := err.(awserr.Error) - if e, a := request.CanceledErrorCode, aerr.Code(); e != a { - t.Errorf("expected error code %q, got %q", e, a) - } - if e, a := "canceled", aerr.Message(); !strings.Contains(a, e) { - t.Errorf("expected error message to contain %q, but did not %q", e, a) - } -} - -// S3 Uploader incorrectly fails an upload if the content being uploaded -// has a size of MinPartSize * MaxUploadParts. -// Github: aws/aws-sdk-go#2557 -func TestUploadMaxPartsEOF(t *testing.T) { - s, ops, _ := loggingSvc(emptyList) - mgr := s3manager.NewUploaderWithClient(s, func(u *s3manager.Uploader) { - u.Concurrency = 1 - u.PartSize = s3manager.DefaultUploadPartSize - u.MaxUploadParts = 2 - }) - f := bytes.NewReader(make([]byte, int(mgr.PartSize)*mgr.MaxUploadParts)) - - r1 := io.NewSectionReader(f, 0, s3manager.DefaultUploadPartSize) - r2 := io.NewSectionReader(f, s3manager.DefaultUploadPartSize, 2*s3manager.DefaultUploadPartSize) - body := io.MultiReader(r1, r2) - - _, err := mgr.Upload(&s3manager.UploadInput{ - Bucket: aws.String("Bucket"), - Key: aws.String("Key"), - Body: body, - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - expectOps := []string{ - "CreateMultipartUpload", - "UploadPart", - "UploadPart", - "CompleteMultipartUpload", - } - if e, a := expectOps, *ops; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v ops, got %v", e, a) - } -} - -func createTempFile(t *testing.T, size int64) (*os.File, func(*testing.T), error) { - file, err := ioutil.TempFile(os.TempDir(), aws.SDKName+t.Name()) - if err != nil { - return nil, nil, err - } - filename := file.Name() - if err := file.Truncate(size); err != nil { - return nil, nil, err - } - - return file, - func(t *testing.T) { - if err := file.Close(); err != nil { - t.Errorf("failed to close temp file, %s, %v", filename, err) - } - if err := os.Remove(filename); err != nil { - t.Errorf("failed to remove temp file, %s, %v", filename, err) - } - }, - nil -} - -func buildFailHandlers(tb testing.TB, parts, retry int) []http.Handler { - handlers := make([]http.Handler, parts) - for i := 0; i < len(handlers); i++ { - handlers[i] = &failPartHandler{ - tb: tb, - failsRemaining: retry, - successHandler: successPartHandler{tb: tb}, - } - } - - return handlers -} - -func TestUploadRetry(t *testing.T) { - const numParts, retries = 3, 10 - - testFile, testFileCleanup, err := createTempFile(t, s3manager.DefaultUploadPartSize*numParts) - if err != nil { - t.Fatalf("failed to create test file, %v", err) - } - defer testFileCleanup(t) - - cases := map[string]struct { - Body io.Reader - PartHandlers func(testing.TB) []http.Handler - }{ - "bytes.Buffer": { - Body: bytes.NewBuffer(make([]byte, s3manager.DefaultUploadPartSize*numParts)), - PartHandlers: func(tb testing.TB) []http.Handler { - return buildFailHandlers(tb, numParts, retries) - }, - }, - "bytes.Reader": { - Body: bytes.NewReader(make([]byte, s3manager.DefaultUploadPartSize*numParts)), - PartHandlers: func(tb testing.TB) []http.Handler { - return buildFailHandlers(tb, numParts, retries) - }, - }, - "os.File": { - Body: testFile, - PartHandlers: func(tb testing.TB) []http.Handler { - return buildFailHandlers(tb, numParts, retries) - }, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - mux := newMockS3UploadServer(t, c.PartHandlers(t)) - server := httptest.NewServer(mux) - defer server.Close() - - var logger aws.Logger - var logLevel *aws.LogLevelType - if v := os.Getenv("DEBUG_BODY"); len(v) != 0 { - logger = t - logLevel = aws.LogLevel( - aws.LogDebugWithRequestErrors | aws.LogDebugWithRequestRetries, - ) - } - sess := unit.Session.Copy(&aws.Config{ - Endpoint: aws.String(server.URL), - S3ForcePathStyle: aws.Bool(true), - DisableSSL: aws.Bool(true), - MaxRetries: aws.Int(retries + 1), - SleepDelay: func(time.Duration) {}, - - Logger: logger, - LogLevel: logLevel, - //Credentials: credentials.AnonymousCredentials, - }) - - uploader := s3manager.NewUploader(sess, func(u *s3manager.Uploader) { - // u.Concurrency = 1 - }) - _, err := uploader.Upload(&s3manager.UploadInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - Body: c.Body, - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - }) - } -} - -func TestUploadBufferStrategy(t *testing.T) { - cases := map[string]struct { - PartSize int64 - Size int64 - Strategy s3manager.ReadSeekerWriteToProvider - callbacks int - }{ - "NoBuffer": { - PartSize: s3manager.DefaultUploadPartSize, - Strategy: nil, - }, - "SinglePart": { - PartSize: s3manager.DefaultUploadPartSize, - Size: s3manager.DefaultUploadPartSize, - Strategy: &recordedBufferProvider{size: int(s3manager.DefaultUploadPartSize)}, - callbacks: 1, - }, - "MultiPart": { - PartSize: s3manager.DefaultUploadPartSize, - Size: s3manager.DefaultUploadPartSize * 2, - Strategy: &recordedBufferProvider{size: int(s3manager.DefaultUploadPartSize)}, - callbacks: 2, - }, - } - - for name, tCase := range cases { - t.Run(name, func(t *testing.T) { - _ = tCase - sess := unit.Session.Copy() - svc := s3.New(sess) - svc.Handlers.Unmarshal.Clear() - svc.Handlers.UnmarshalMeta.Clear() - svc.Handlers.UnmarshalError.Clear() - svc.Handlers.Send.Clear() - svc.Handlers.Send.PushBack(func(r *request.Request) { - if r.Body != nil { - io.Copy(ioutil.Discard, r.Body) - } - - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - - switch data := r.Data.(type) { - case *s3.CreateMultipartUploadOutput: - data.UploadId = aws.String("UPLOAD-ID") - case *s3.UploadPartOutput: - data.ETag = aws.String(fmt.Sprintf("ETAG%d", random.Int())) - case *s3.CompleteMultipartUploadOutput: - data.Location = aws.String("https://location") - data.VersionId = aws.String("VERSION-ID") - case *s3.PutObjectOutput: - data.VersionId = aws.String("VERSION-ID") - } - }) - - uploader := s3manager.NewUploaderWithClient(svc, func(u *s3manager.Uploader) { - u.PartSize = tCase.PartSize - u.BufferProvider = tCase.Strategy - u.Concurrency = 1 - }) - - expected := getTestBytes(int(tCase.Size)) - _, err := uploader.Upload(&s3manager.UploadInput{ - Bucket: aws.String("bucket"), - Key: aws.String("key"), - Body: bytes.NewReader(expected), - }) - if err != nil { - t.Fatalf("failed to upload file: %v", err) - } - - switch strat := tCase.Strategy.(type) { - case *recordedBufferProvider: - if !bytes.Equal(expected, strat.content) { - t.Errorf("content buffered did not match expected") - } - if tCase.callbacks != strat.callbackCount { - t.Errorf("expected %v, got %v callbacks", tCase.callbacks, strat.callbackCount) - } - } - }) - } -} - -type mockS3UploadServer struct { - *http.ServeMux - - tb testing.TB - partHandler []http.Handler -} - -func newMockS3UploadServer(tb testing.TB, partHandler []http.Handler) *mockS3UploadServer { - s := &mockS3UploadServer{ - ServeMux: http.NewServeMux(), - partHandler: partHandler, - tb: tb, - } - - s.HandleFunc("/", s.handleRequest) - - return s -} - -func (s mockS3UploadServer) handleRequest(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - _, hasUploads := r.URL.Query()["uploads"] - - switch { - case r.Method == "POST" && hasUploads: - // CreateMultipartUpload - w.Header().Set("Content-Length", strconv.Itoa(len(createUploadResp))) - w.Write([]byte(createUploadResp)) - - case r.Method == "PUT": - // UploadPart - partNumStr := r.URL.Query().Get("partNumber") - id, err := strconv.Atoi(partNumStr) - if err != nil { - failRequest(w, 400, "BadRequest", - fmt.Sprintf("unable to parse partNumber, %q, %v", - partNumStr, err)) - return - } - id-- - if id < 0 || id >= len(s.partHandler) { - failRequest(w, 400, "BadRequest", - fmt.Sprintf("invalid partNumber %v", id)) - return - } - s.partHandler[id].ServeHTTP(w, r) - - case r.Method == "POST": - // CompleteMultipartUpload - w.Header().Set("Content-Length", strconv.Itoa(len(completeUploadResp))) - w.Write([]byte(completeUploadResp)) - - case r.Method == "DELETE": - // AbortMultipartUpload - w.Header().Set("Content-Length", strconv.Itoa(len(abortUploadResp))) - w.WriteHeader(200) - w.Write([]byte(abortUploadResp)) - - default: - failRequest(w, 400, "BadRequest", - fmt.Sprintf("invalid request %v %v", r.Method, r.URL)) - } -} - -func failRequest(w http.ResponseWriter, status int, code, msg string) { - msg = fmt.Sprintf(baseRequestErrorResp, code, msg) - w.Header().Set("Content-Length", strconv.Itoa(len(msg))) - w.WriteHeader(status) - w.Write([]byte(msg)) -} - -type successPartHandler struct { - tb testing.TB -} - -func (h successPartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - n, err := io.Copy(ioutil.Discard, r.Body) - if err != nil { - failRequest(w, 400, "BadRequest", - fmt.Sprintf("failed to read body, %v", err)) - return - } - - contLenStr := r.Header.Get("Content-Length") - expectLen, err := strconv.ParseInt(contLenStr, 10, 64) - if err != nil { - h.tb.Logf("expect content-length, got %q, %v", contLenStr, err) - failRequest(w, 400, "BadRequest", - fmt.Sprintf("unable to get content-length %v", err)) - return - } - if e, a := expectLen, n; e != a { - h.tb.Logf("expect %v read, got %v", e, a) - failRequest(w, 400, "BadRequest", - fmt.Sprintf( - "content-length and body do not match, %v, %v", e, a)) - return - } - - w.Header().Set("Content-Length", strconv.Itoa(len(uploadPartResp))) - w.Write([]byte(uploadPartResp)) -} - -type failPartHandler struct { - tb testing.TB - - failsRemaining int - successHandler http.Handler -} - -func (h *failPartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - - if h.failsRemaining == 0 && h.successHandler != nil { - h.successHandler.ServeHTTP(w, r) - return - } - - io.Copy(ioutil.Discard, r.Body) - - failRequest(w, 500, "InternalException", - fmt.Sprintf("mock error, partNumber %v", r.URL.Query().Get("partNumber"))) - - h.failsRemaining-- -} - -type recordedBufferProvider struct { - content []byte - size int - callbackCount int -} - -func (r *recordedBufferProvider) GetWriteTo(seeker io.ReadSeeker) (s3manager.ReadSeekerWriteTo, func()) { - b := make([]byte, r.size) - w := &s3manager.BufferedReadSeekerWriteTo{BufferedReadSeeker: s3manager.NewBufferedReadSeeker(seeker, b)} - - return w, func() { - r.content = append(r.content, b...) - r.callbackCount++ - } -} - -const createUploadResp = ` - - bucket - key - abc123 - -` -const uploadPartResp = ` - - key - -` -const baseRequestErrorResp = ` - - %s - %s - request-id - host-id - -` -const completeUploadResp = ` - - bucket - key - key - https://bucket.us-west-2.amazonaws.com/key - abc123 - -` - -const abortUploadResp = ` - - -` diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/writer_read_from_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/writer_read_from_test.go deleted file mode 100644 index 6a5196e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/s3manager/writer_read_from_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package s3manager - -import ( - "fmt" - "io" - "reflect" - "testing" -) - -type testBufioWriter struct { - ReadFromN int64 - ReadFromErr error - FlushReturn error -} - -func (t testBufioWriter) Write(p []byte) (n int, err error) { - panic("unused") -} - -func (t testBufioWriter) ReadFrom(r io.Reader) (n int64, err error) { - return t.ReadFromN, t.ReadFromErr -} - -func (t testBufioWriter) Flush() error { - return t.FlushReturn -} - -func (t *testBufioWriter) Reset(io.Writer) { - panic("unused") -} - -func TestBufferedReadFromFlusher_ReadFrom(t *testing.T) { - cases := map[string]struct { - w testBufioWriter - expectedErr error - }{ - "no errors": {}, - "error returned from underlying ReadFrom": { - w: testBufioWriter{ - ReadFromN: 42, - ReadFromErr: fmt.Errorf("readfrom"), - }, - expectedErr: fmt.Errorf("readfrom"), - }, - "error returned from Flush": { - w: testBufioWriter{ - ReadFromN: 7, - FlushReturn: fmt.Errorf("flush"), - }, - expectedErr: fmt.Errorf("flush"), - }, - "error returned from ReadFrom and Flush": { - w: testBufioWriter{ - ReadFromN: 1337, - ReadFromErr: fmt.Errorf("readfrom"), - FlushReturn: fmt.Errorf("flush"), - }, - expectedErr: fmt.Errorf("readfrom"), - }, - } - - for name, tCase := range cases { - t.Log(name) - readFromFlusher := bufferedReadFrom{bufferedWriter: &tCase.w} - n, err := readFromFlusher.ReadFrom(nil) - if e, a := tCase.w.ReadFromN, n; e != a { - t.Errorf("expected %v bytes, got %v", e, a) - } - if e, a := tCase.expectedErr, err; !reflect.DeepEqual(e, a) { - t.Errorf("expected error %v. got %v", e, a) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go index ba77bb8..c90199c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "s3" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "S3" // ServiceID is a unique identifer of a specific service. + ServiceID = "S3" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the S3 client with a session. diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse_test.go deleted file mode 100644 index 6aeaded..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse_test.go +++ /dev/null @@ -1,138 +0,0 @@ -package s3_test - -import ( - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestSSECustomerKeyOverHTTPError(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{DisableSSL: aws.Bool(true)}) - req, _ := s.CopyObjectRequest(&s3.CopyObjectInput{ - Bucket: aws.String("bucket"), - CopySource: aws.String("bucket/source"), - Key: aws.String("dest"), - SSECustomerKey: aws.String("key"), - }) - err := req.Build() - - if err == nil { - t.Error("expected an error") - } - if e, a := "ConfigError", err.(awserr.Error).Code(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if !strings.Contains(err.(awserr.Error).Message(), "cannot send SSE keys over HTTP") { - t.Errorf("expected error to contain 'cannot send SSE keys over HTTP', but received %s", err.(awserr.Error).Message()) - } -} - -func TestCopySourceSSECustomerKeyOverHTTPError(t *testing.T) { - s := s3.New(unit.Session, &aws.Config{DisableSSL: aws.Bool(true)}) - req, _ := s.CopyObjectRequest(&s3.CopyObjectInput{ - Bucket: aws.String("bucket"), - CopySource: aws.String("bucket/source"), - Key: aws.String("dest"), - CopySourceSSECustomerKey: aws.String("key"), - }) - err := req.Build() - - if err == nil { - t.Error("expected an error") - } - if e, a := "ConfigError", err.(awserr.Error).Code(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if !strings.Contains(err.(awserr.Error).Message(), "cannot send SSE keys over HTTP") { - t.Errorf("expected error to contain 'cannot send SSE keys over HTTP', but received %s", err.(awserr.Error).Message()) - } -} - -func TestComputeSSEKeys(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.CopyObjectRequest(&s3.CopyObjectInput{ - Bucket: aws.String("bucket"), - CopySource: aws.String("bucket/source"), - Key: aws.String("dest"), - SSECustomerKey: aws.String("key"), - CopySourceSSECustomerKey: aws.String("key"), - }) - err := req.Build() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := "a2V5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "a2V5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "PG4LipwVIkqCKLmpjKFTHQ==", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "PG4LipwVIkqCKLmpjKFTHQ==", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestComputeSSEKeysShortcircuit(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.CopyObjectRequest(&s3.CopyObjectInput{ - Bucket: aws.String("bucket"), - CopySource: aws.String("bucket/source"), - Key: aws.String("dest"), - SSECustomerKey: aws.String("key"), - CopySourceSSECustomerKey: aws.String("key"), - SSECustomerKeyMD5: aws.String("MD5"), - CopySourceSSECustomerKeyMD5: aws.String("MD5"), - }) - err := req.Build() - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := "a2V5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "a2V5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "MD5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "MD5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestSSECustomerKeysWithSpaces(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.CopyObjectRequest(&s3.CopyObjectInput{ - Bucket: aws.String("bucket"), - CopySource: aws.String("bucket/source"), - Key: aws.String("dest"), - SSECustomerKey: aws.String(" key "), - CopySourceSSECustomerKey: aws.String(" copykey "), - }) - err := req.Build() - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - if e, a := "ICAga2V5ICAg", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "ICAgY29weWtleSAgIA==", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "13XiUSCa6ReZ3CHtCLiJLg==", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "MHVtfmuml539o1871Vsc6w==", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key-md5"); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error_test.go deleted file mode 100644 index 086ca8c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error_test.go +++ /dev/null @@ -1,186 +0,0 @@ -package s3_test - -import ( - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -const errMsg = `ErrorCodemessage bodyrequestIDhostID=` - -var lastModifiedTime = time.Date(2009, 11, 23, 0, 0, 0, 0, time.UTC) - -func TestCopyObjectNoError(t *testing.T) { - const successMsg = ` - -2009-11-23T0:00:00Z"1da64c7f13d1e8dbeaea40b905fd586c"` - - res, err := newCopyTestSvc(successMsg).CopyObject(&s3.CopyObjectInput{ - Bucket: aws.String("bucketname"), - CopySource: aws.String("bucketname/exists.txt"), - Key: aws.String("destination.txt"), - }) - - if err != nil { - t.Fatalf("expected no error, but received %v", err) - } - if e, a := fmt.Sprintf(`%q`, "1da64c7f13d1e8dbeaea40b905fd586c"), *res.CopyObjectResult.ETag; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := lastModifiedTime, *res.CopyObjectResult.LastModified; !e.Equal(a) { - t.Errorf("expected %v, but received %v", e, a) - } -} - -func TestCopyObjectError(t *testing.T) { - _, err := newCopyTestSvc(errMsg).CopyObject(&s3.CopyObjectInput{ - Bucket: aws.String("bucketname"), - CopySource: aws.String("bucketname/doesnotexist.txt"), - Key: aws.String("destination.txt"), - }) - - if err == nil { - t.Error("expected error, but received none") - } - e := err.(awserr.Error) - - if e, a := "ErrorCode", e.Code(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "message body", e.Message(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestUploadPartCopySuccess(t *testing.T) { - const successMsg = ` - -2009-11-23T0:00:00Z"1da64c7f13d1e8dbeaea40b905fd586c"` - - res, err := newCopyTestSvc(successMsg).UploadPartCopy(&s3.UploadPartCopyInput{ - Bucket: aws.String("bucketname"), - CopySource: aws.String("bucketname/doesnotexist.txt"), - Key: aws.String("destination.txt"), - PartNumber: aws.Int64(0), - UploadId: aws.String("uploadID"), - }) - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - if e, a := fmt.Sprintf(`%q`, "1da64c7f13d1e8dbeaea40b905fd586c"), *res.CopyPartResult.ETag; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := lastModifiedTime, *res.CopyPartResult.LastModified; !e.Equal(a) { - t.Errorf("expected %v, but received %v", e, a) - } -} - -func TestUploadPartCopyError(t *testing.T) { - _, err := newCopyTestSvc(errMsg).UploadPartCopy(&s3.UploadPartCopyInput{ - Bucket: aws.String("bucketname"), - CopySource: aws.String("bucketname/doesnotexist.txt"), - Key: aws.String("destination.txt"), - PartNumber: aws.Int64(0), - UploadId: aws.String("uploadID"), - }) - - if err == nil { - t.Error("expected an error") - } - e := err.(awserr.Error) - - if e, a := "ErrorCode", e.Code(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "message body", e.Message(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestCompleteMultipartUploadSuccess(t *testing.T) { - const successMsg = ` - -locationNamebucketNamekeyName"etagVal"` - - res, err := newCopyTestSvc(successMsg).CompleteMultipartUpload(&s3.CompleteMultipartUploadInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("key"), - UploadId: aws.String("uploadID"), - }) - - if err != nil { - t.Errorf("expected no error, but received %v", err) - } - - if e, a := `"etagVal"`, *res.ETag; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "bucketName", *res.Bucket; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "keyName", *res.Key; e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "locationName", *res.Location; e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func TestCompleteMultipartUploadError(t *testing.T) { - _, err := newCopyTestSvc(errMsg).CompleteMultipartUpload(&s3.CompleteMultipartUploadInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("key"), - UploadId: aws.String("uploadID"), - }) - - if err == nil { - t.Error("expected an error") - } - e := err.(awserr.Error) - - if e, a := "ErrorCode", e.Code(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } - if e, a := "message body", e.Message(); e != a { - t.Errorf("expected %s, but received %s", e, a) - } -} - -func newCopyTestSvc(errMsg string) *s3.S3 { - const statusCode = http.StatusOK - - svc := s3.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(0), - SleepDelay: func(time.Duration) {}, - }) - - svc.Handlers.Send.Swap(corehandlers.SendHandler.Name, - request.NamedHandler{ - Name: "newCopyTestSvc", - Fn: func(r *request.Request) { - io.Copy(ioutil.Discard, r.HTTPRequest.Body) - r.HTTPRequest.Body.Close() - r.HTTPResponse = &http.Response{ - Status: http.StatusText(statusCode), - StatusCode: statusCode, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader(errMsg)), - } - }, - }) - - return svc -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_leak_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_leak_test.go deleted file mode 100644 index 857bbaa..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_leak_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package s3 - -import ( - "net/http" - "testing" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestUnmarhsalErrorLeak(t *testing.T) { - req := &request.Request{ - HTTPRequest: &http.Request{ - Header: make(http.Header), - Body: &awstesting.ReadCloser{Size: 2048}, - }, - } - req.HTTPResponse = &http.Response{ - Body: &awstesting.ReadCloser{Size: 2048}, - Header: http.Header{ - "X-Amzn-Requestid": []string{"1"}, - }, - StatusCode: http.StatusOK, - } - - reader := req.HTTPResponse.Body.(*awstesting.ReadCloser) - unmarshalError(req) - - if req.Error == nil { - t.Error("expected an error, but received none") - } - - if !reader.Closed { - t.Error("expected reader to be closed") - } - - if e, a := 0, reader.Size; e != a { - t.Errorf("expected %d, but received %d", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go deleted file mode 100644 index a314542..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go +++ /dev/null @@ -1,266 +0,0 @@ -package s3_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "strings" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -type testErrorCase struct { - RespFn func() *http.Response - ReqID, HostID string - Code, Msg string - WithoutStatusMsg bool -} - -var testUnmarshalCases = []testErrorCase{ - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 301, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: -1, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "BucketRegionError", Msg: "incorrect region, the bucket is not in 'mock-region' region", - }, - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 403, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: 0, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "Forbidden", Msg: "Forbidden", - }, - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 400, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: 0, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "BadRequest", Msg: "Bad Request", - }, - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 404, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: 0, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "NotFound", Msg: "Not Found", - }, - { - // SDK only reads request ID and host ID from the header. The values - // in message body are ignored. - RespFn: func() *http.Response { - body := `SomeExceptionException messageignored-request-idignored-host-id` - return &http.Response{ - StatusCode: 500, - Header: http.Header{ - "X-Amz-Request-Id": []string{"taken-request-id"}, - "X-Amz-Id-2": []string{"taken-host-id"}, - }, - Body: ioutil.NopCloser(strings.NewReader(body)), - ContentLength: int64(len(body)), - } - }, - ReqID: "taken-request-id", - HostID: "taken-host-id", - Code: "SomeException", Msg: "Exception message", - }, - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 404, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: -1, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "NotFound", Msg: "Not Found", WithoutStatusMsg: true, - }, - { - RespFn: func() *http.Response { - return &http.Response{ - StatusCode: 404, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(bytes.NewReader(nil)), - ContentLength: -1, - } - }, - ReqID: "abc123", - HostID: "321cba", - Code: "NotFound", Msg: "Not Found", - }, -} - -func TestUnmarshalError(t *testing.T) { - for i, c := range testUnmarshalCases { - s := s3.New(unit.Session) - s.Handlers.Send.Clear() - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = c.RespFn() - if !c.WithoutStatusMsg { - r.HTTPResponse.Status = fmt.Sprintf("%d%s", - r.HTTPResponse.StatusCode, - http.StatusText(r.HTTPResponse.StatusCode)) - } - }) - _, err := s.PutBucketAcl(&s3.PutBucketAclInput{ - Bucket: aws.String("bucket"), ACL: aws.String("public-read"), - }) - - if err == nil { - t.Fatalf("%d, expected error, got nil", i) - } - if e, a := c.Code, err.(awserr.Error).Code(); e != a { - t.Errorf("%d, Code: expect %s, got %s", i, e, a) - } - if e, a := c.Msg, err.(awserr.Error).Message(); !strings.Contains(a, e) { - t.Errorf("%d, Message: expect %s, got %s", i, e, a) - } - if e, a := c.ReqID, err.(awserr.RequestFailure).RequestID(); e != a { - t.Errorf("%d, RequestID: expect %s, got %s", i, e, a) - } - if e, a := c.HostID, err.(s3.RequestFailure).HostID(); e != a { - t.Errorf("%d, HostID: expect %s, got %s", i, e, a) - } - } -} - -const completeMultiResp = ` -163 - - -https://bucket.s3-us-west-2.amazonaws.com/keybucketkey"a7d414b9133d6483d9a1c4e04e856e3b-2" -0 -` - -func Test200NoErrorUnmarshalError(t *testing.T) { - s := s3.New(unit.Session) - s.Handlers.Send.Clear() - s.Handlers.Send.PushBack(func(r *request.Request) { - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(strings.NewReader(completeMultiResp)), - ContentLength: -1, - } - r.HTTPResponse.Status = http.StatusText(r.HTTPResponse.StatusCode) - }) - _, err := s.CompleteMultipartUpload(&s3.CompleteMultipartUploadInput{ - Bucket: aws.String("bucket"), Key: aws.String("key"), - UploadId: aws.String("id"), - MultipartUpload: &s3.CompletedMultipartUpload{Parts: []*s3.CompletedPart{ - {ETag: aws.String("etag"), PartNumber: aws.Int64(1)}, - }}, - }) - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } -} - -const completeMultiErrResp = `SomeExceptionException message` - -func Test200WithErrorUnmarshalError(t *testing.T) { - const expectAttempts = 4 - s := s3.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(expectAttempts - 1), - SleepDelay: func(time.Duration) {}, - }) - - var attempts int - s.Handlers.Send.Clear() - s.Handlers.Send.PushBack(func(r *request.Request) { - attempts++ - - r.HTTPResponse = &http.Response{ - StatusCode: 200, - Header: http.Header{ - "X-Amz-Request-Id": []string{"abc123"}, - "X-Amz-Id-2": []string{"321cba"}, - }, - Body: ioutil.NopCloser(strings.NewReader(completeMultiErrResp)), - ContentLength: -1, - } - r.HTTPResponse.Status = http.StatusText(r.HTTPResponse.StatusCode) - }) - - _, err := s.CompleteMultipartUpload(&s3.CompleteMultipartUploadInput{ - Bucket: aws.String("bucket"), Key: aws.String("key"), - UploadId: aws.String("id"), - MultipartUpload: &s3.CompletedMultipartUpload{Parts: []*s3.CompletedPart{ - {ETag: aws.String("etag"), PartNumber: aws.Int64(1)}, - }}, - }) - - if err == nil { - t.Fatalf("expected error, got nil") - } - if e, a := expectAttempts, attempts; e != a { - t.Errorf("expect %v attempts, got %v", e, a) - } - if e, a := "SomeException", err.(awserr.Error).Code(); e != a { - t.Errorf("Code: expect %s, got %s", e, a) - } - if e, a := "Exception message", err.(awserr.Error).Message(); e != a { - t.Errorf("Message: expect %s, got %s", e, a) - } - if e, a := "abc123", err.(s3.RequestFailure).RequestID(); e != a { - t.Errorf("RequestID: expect %s, got %s", e, a) - } - if e, a := "321cba", err.(s3.RequestFailure).HostID(); e != a { - t.Errorf("HostID: expect %s, got %s", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go deleted file mode 100644 index 4a91ae0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package sts_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/corehandlers" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/sts" -) - -var svc = sts.New(unit.Session, &aws.Config{ - Region: aws.String("mock-region"), -}) - -func TestUnsignedRequest_AssumeRoleWithSAML(t *testing.T) { - req, _ := svc.AssumeRoleWithSAMLRequest(&sts.AssumeRoleWithSAMLInput{ - PrincipalArn: aws.String("ARN01234567890123456789"), - RoleArn: aws.String("ARN01234567890123456789"), - SAMLAssertion: aws.String("ASSERT"), - }) - - err := req.Sign() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := "", req.HTTPRequest.Header.Get("Authorization"); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestUnsignedRequest_AssumeRoleWithWebIdentity(t *testing.T) { - req, _ := svc.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ - RoleArn: aws.String("ARN01234567890123456789"), - RoleSessionName: aws.String("SESSION"), - WebIdentityToken: aws.String("TOKEN"), - }) - - err := req.Sign() - if err != nil { - t.Errorf("expect no error, got %v", err) - } - if e, a := "", req.HTTPRequest.Header.Get("Authorization"); e != a { - t.Errorf("expect %v, got %v", e, a) - } -} - -func TestSTSCustomRetryErrorCodes(t *testing.T) { - svc := sts.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(1), - }) - svc.Handlers.Validate.Clear() - - const xmlErr = `%ssome error message` - var reqCount int - resps := []*http.Response{ - { - StatusCode: 400, - Header: http.Header{}, - Body: ioutil.NopCloser(bytes.NewReader( - []byte(fmt.Sprintf(xmlErr, sts.ErrCodeIDPCommunicationErrorException)), - )), - }, - { - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - }, - } - - req, _ := svc.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{}) - req.Handlers.Send.Swap(corehandlers.SendHandler.Name, request.NamedHandler{ - Name: "custom send handler", - Fn: func(r *request.Request) { - r.HTTPResponse = resps[reqCount] - reqCount++ - }, - }) - - if err := req.Send(); err != nil { - t.Fatalf("expect no error, got %v", err) - } - - if e, a := 2, reqCount; e != a { - t.Errorf("expect %v requests, got %v", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go deleted file mode 100644 index f15ad18..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sts_test - -import ( - "fmt" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/sts" -) - -var _ time.Duration -var _ strings.Reader -var _ aws.Config - -func parseTime(layout, value string) *time.Time { - t, err := time.Parse(layout, value) - if err != nil { - panic(err) - } - return &t -} - -// To assume a role -// - -func ExampleSTS_AssumeRole_shared00() { - svc := sts.New(session.New()) - input := &sts.AssumeRoleInput{ - ExternalId: aws.String("123ABC"), - Policy: aws.String("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}"), - RoleArn: aws.String("arn:aws:iam::123456789012:role/demo"), - RoleSessionName: aws.String("testAssumeRoleSession"), - Tags: []*sts.Tag{ - { - Key: aws.String("Project"), - Value: aws.String("Unicorn"), - }, - { - Key: aws.String("Team"), - Value: aws.String("Automation"), - }, - { - Key: aws.String("Cost-Center"), - Value: aws.String("12345"), - }, - }, - TransitiveTagKeys: []*string{ - aws.String("Project"), - aws.String("Cost-Center"), - }, - } - - result, err := svc.AssumeRole(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case sts.ErrCodeMalformedPolicyDocumentException: - fmt.Println(sts.ErrCodeMalformedPolicyDocumentException, aerr.Error()) - case sts.ErrCodePackedPolicyTooLargeException: - fmt.Println(sts.ErrCodePackedPolicyTooLargeException, aerr.Error()) - case sts.ErrCodeRegionDisabledException: - fmt.Println(sts.ErrCodeRegionDisabledException, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To assume a role as an OpenID Connect-federated user -// - -func ExampleSTS_AssumeRoleWithWebIdentity_shared00() { - svc := sts.New(session.New()) - input := &sts.AssumeRoleWithWebIdentityInput{ - DurationSeconds: aws.Int64(3600), - Policy: aws.String("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}"), - ProviderId: aws.String("www.amazon.com"), - RoleArn: aws.String("arn:aws:iam::123456789012:role/FederatedWebIdentityRole"), - RoleSessionName: aws.String("app1"), - WebIdentityToken: aws.String("Atza%7CIQEBLjAsAhRFiXuWpUXuRvQ9PZL3GMFcYevydwIUFAHZwXZXXXXXXXXJnrulxKDHwy87oGKPznh0D6bEQZTSCzyoCtL_8S07pLpr0zMbn6w1lfVZKNTBdDansFBmtGnIsIapjI6xKR02Yc_2bQ8LZbUXSGm6Ry6_BG7PrtLZtj_dfCTj92xNGed-CrKqjG7nPBjNIL016GGvuS5gSvPRUxWES3VYfm1wl7WTI7jn-Pcb6M-buCgHhFOzTQxod27L9CqnOLio7N3gZAGpsp6n1-AJBOCJckcyXe2c6uD0srOJeZlKUm2eTDVMf8IehDVI0r1QOnTV6KzzAI3OY87Vd_cVMQ"), - } - - result, err := svc.AssumeRoleWithWebIdentity(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case sts.ErrCodeMalformedPolicyDocumentException: - fmt.Println(sts.ErrCodeMalformedPolicyDocumentException, aerr.Error()) - case sts.ErrCodePackedPolicyTooLargeException: - fmt.Println(sts.ErrCodePackedPolicyTooLargeException, aerr.Error()) - case sts.ErrCodeIDPRejectedClaimException: - fmt.Println(sts.ErrCodeIDPRejectedClaimException, aerr.Error()) - case sts.ErrCodeIDPCommunicationErrorException: - fmt.Println(sts.ErrCodeIDPCommunicationErrorException, aerr.Error()) - case sts.ErrCodeInvalidIdentityTokenException: - fmt.Println(sts.ErrCodeInvalidIdentityTokenException, aerr.Error()) - case sts.ErrCodeExpiredTokenException: - fmt.Println(sts.ErrCodeExpiredTokenException, aerr.Error()) - case sts.ErrCodeRegionDisabledException: - fmt.Println(sts.ErrCodeRegionDisabledException, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To decode information about an authorization status of a request -// - -func ExampleSTS_DecodeAuthorizationMessage_shared00() { - svc := sts.New(session.New()) - input := &sts.DecodeAuthorizationMessageInput{ - EncodedMessage: aws.String(""), - } - - result, err := svc.DecodeAuthorizationMessage(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case sts.ErrCodeInvalidAuthorizationMessageException: - fmt.Println(sts.ErrCodeInvalidAuthorizationMessageException, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get details about a calling IAM user -// -// This example shows a request and response made with the credentials for a user named -// Alice in the AWS account 123456789012. -func ExampleSTS_GetCallerIdentity_shared00() { - svc := sts.New(session.New()) - input := &sts.GetCallerIdentityInput{} - - result, err := svc.GetCallerIdentity(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get details about a calling user federated with AssumeRole -// -// This example shows a request and response made with temporary credentials created -// by AssumeRole. The name of the assumed role is my-role-name, and the RoleSessionName -// is set to my-role-session-name. -func ExampleSTS_GetCallerIdentity_shared01() { - svc := sts.New(session.New()) - input := &sts.GetCallerIdentityInput{} - - result, err := svc.GetCallerIdentity(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get details about a calling user federated with GetFederationToken -// -// This example shows a request and response made with temporary credentials created -// by using GetFederationToken. The Name parameter is set to my-federated-user-name. -func ExampleSTS_GetCallerIdentity_shared02() { - svc := sts.New(session.New()) - input := &sts.GetCallerIdentityInput{} - - result, err := svc.GetCallerIdentity(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get temporary credentials for a role by using GetFederationToken -// - -func ExampleSTS_GetFederationToken_shared00() { - svc := sts.New(session.New()) - input := &sts.GetFederationTokenInput{ - DurationSeconds: aws.Int64(3600), - Name: aws.String("testFedUserSession"), - Policy: aws.String("{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}"), - Tags: []*sts.Tag{ - { - Key: aws.String("Project"), - Value: aws.String("Pegasus"), - }, - { - Key: aws.String("Cost-Center"), - Value: aws.String("98765"), - }, - }, - } - - result, err := svc.GetFederationToken(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case sts.ErrCodeMalformedPolicyDocumentException: - fmt.Println(sts.ErrCodeMalformedPolicyDocumentException, aerr.Error()) - case sts.ErrCodePackedPolicyTooLargeException: - fmt.Println(sts.ErrCodePackedPolicyTooLargeException, aerr.Error()) - case sts.ErrCodeRegionDisabledException: - fmt.Println(sts.ErrCodeRegionDisabledException, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} - -// To get temporary credentials for an IAM user or an AWS account -// - -func ExampleSTS_GetSessionToken_shared00() { - svc := sts.New(session.New()) - input := &sts.GetSessionTokenInput{ - DurationSeconds: aws.Int64(3600), - SerialNumber: aws.String("YourMFASerialNumber"), - TokenCode: aws.String("123456"), - } - - result, err := svc.GetSessionToken(input) - if err != nil { - if aerr, ok := err.(awserr.Error); ok { - switch aerr.Code() { - case sts.ErrCodeRegionDisabledException: - fmt.Println(sts.ErrCodeRegionDisabledException, aerr.Error()) - default: - fmt.Println(aerr.Error()) - } - } else { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - } - return - } - - fmt.Println(result) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/integ_test.go b/vendor/github.com/aws/aws-sdk-go/service/sts/integ_test.go deleted file mode 100644 index 38b9243..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/integ_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// +build go1.10,integration - -package sts_test - -import ( - "context" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting/integration" - "github.com/aws/aws-sdk-go/service/sts" -) - -var _ aws.Config -var _ awserr.Error -var _ request.Request - -func TestInteg_00_GetSessionToken(t *testing.T) { - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - - sess := integration.SessionWithDefaultRegion("us-west-2") - svc := sts.New(sess) - params := &sts.GetSessionTokenInput{} - _, err := svc.GetSessionTokenWithContext(ctx, params, func(r *request.Request) { - r.Handlers.Validate.RemoveByName("core.ValidateParametersHandler") - }) - if err != nil { - t.Errorf("expect no error, got %v", err) - } -} -func TestInteg_01_GetFederationToken(t *testing.T) { - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - - sess := integration.SessionWithDefaultRegion("us-west-2") - svc := sts.New(sess) - params := &sts.GetFederationTokenInput{ - Name: aws.String("temp"), - Policy: aws.String("{\\\"temp\\\":true}"), - } - _, err := svc.GetFederationTokenWithContext(ctx, params, func(r *request.Request) { - r.Handlers.Validate.RemoveByName("core.ValidateParametersHandler") - }) - if err == nil { - t.Fatalf("expect request to fail") - } - aerr, ok := err.(awserr.RequestFailure) - if !ok { - t.Fatalf("expect awserr, was %T", err) - } - if len(aerr.Code()) == 0 { - t.Errorf("expect non-empty error code") - } - if v := aerr.Code(); v == request.ErrCodeSerialization { - t.Errorf("expect API error code got serialization failure") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go index 586faed..d34a685 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sts" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "STS" // ServiceID is a unique identifer of a specific service. + ServiceID = "STS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the STS client with a session. diff --git a/vendor/github.com/beorn7/perks/.gitignore b/vendor/github.com/beorn7/perks/.gitignore deleted file mode 100644 index 1bd9209..0000000 --- a/vendor/github.com/beorn7/perks/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.test -*.prof diff --git a/vendor/github.com/beorn7/perks/README.md b/vendor/github.com/beorn7/perks/README.md deleted file mode 100644 index fc05777..0000000 --- a/vendor/github.com/beorn7/perks/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Perks for Go (golang.org) - -Perks contains the Go package quantile that computes approximate quantiles over -an unbounded data stream within low memory and CPU bounds. - -For more information and examples, see: -http://godoc.org/github.com/bmizerany/perks - -A very special thank you and shout out to Graham Cormode (Rutgers University), -Flip Korn (AT&T Labs–Research), S. Muthukrishnan (Rutgers University), and -Divesh Srivastava (AT&T Labs–Research) for their research and publication of -[Effective Computation of Biased Quantiles over Data Streams](http://www.cs.rutgers.edu/~muthu/bquant.pdf) - -Thank you, also: -* Armon Dadgar (@armon) -* Andrew Gerrand (@nf) -* Brad Fitzpatrick (@bradfitz) -* Keith Rarick (@kr) - -FAQ: - -Q: Why not move the quantile package into the project root? -A: I want to add more packages to perks later. - -Copyright (C) 2013 Blake Mizerany - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/beorn7/perks/VERSION b/vendor/github.com/beorn7/perks/VERSION deleted file mode 100644 index 3eefcb9..0000000 --- a/vendor/github.com/beorn7/perks/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0.0 diff --git a/vendor/github.com/beorn7/perks/go.mod b/vendor/github.com/beorn7/perks/go.mod deleted file mode 100644 index c4022f2..0000000 --- a/vendor/github.com/beorn7/perks/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/beorn7/perks - -go 1.11 diff --git a/vendor/github.com/beorn7/perks/quantile/bench_test.go b/vendor/github.com/beorn7/perks/quantile/bench_test.go deleted file mode 100644 index 0bd0e4e..0000000 --- a/vendor/github.com/beorn7/perks/quantile/bench_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package quantile - -import ( - "testing" -) - -func BenchmarkInsertTargeted(b *testing.B) { - b.ReportAllocs() - - s := NewTargeted(Targets) - b.ResetTimer() - for i := float64(0); i < float64(b.N); i++ { - s.Insert(i) - } -} - -func BenchmarkInsertTargetedSmallEpsilon(b *testing.B) { - s := NewTargeted(TargetsSmallEpsilon) - b.ResetTimer() - for i := float64(0); i < float64(b.N); i++ { - s.Insert(i) - } -} - -func BenchmarkInsertBiased(b *testing.B) { - s := NewLowBiased(0.01) - b.ResetTimer() - for i := float64(0); i < float64(b.N); i++ { - s.Insert(i) - } -} - -func BenchmarkInsertBiasedSmallEpsilon(b *testing.B) { - s := NewLowBiased(0.0001) - b.ResetTimer() - for i := float64(0); i < float64(b.N); i++ { - s.Insert(i) - } -} - -func BenchmarkQuery(b *testing.B) { - s := NewTargeted(Targets) - for i := float64(0); i < 1e6; i++ { - s.Insert(i) - } - b.ResetTimer() - n := float64(b.N) - for i := float64(0); i < n; i++ { - s.Query(i / n) - } -} - -func BenchmarkQuerySmallEpsilon(b *testing.B) { - s := NewTargeted(TargetsSmallEpsilon) - for i := float64(0); i < 1e6; i++ { - s.Insert(i) - } - b.ResetTimer() - n := float64(b.N) - for i := float64(0); i < n; i++ { - s.Query(i / n) - } -} diff --git a/vendor/github.com/beorn7/perks/quantile/example_test.go b/vendor/github.com/beorn7/perks/quantile/example_test.go deleted file mode 100644 index ab3293a..0000000 --- a/vendor/github.com/beorn7/perks/quantile/example_test.go +++ /dev/null @@ -1,121 +0,0 @@ -// +build go1.1 - -package quantile_test - -import ( - "bufio" - "fmt" - "log" - "os" - "strconv" - "time" - - "github.com/beorn7/perks/quantile" -) - -func Example_simple() { - ch := make(chan float64) - go sendFloats(ch) - - // Compute the 50th, 90th, and 99th percentile. - q := quantile.NewTargeted(map[float64]float64{ - 0.50: 0.005, - 0.90: 0.001, - 0.99: 0.0001, - }) - for v := range ch { - q.Insert(v) - } - - fmt.Println("perc50:", q.Query(0.50)) - fmt.Println("perc90:", q.Query(0.90)) - fmt.Println("perc99:", q.Query(0.99)) - fmt.Println("count:", q.Count()) - // Output: - // perc50: 5 - // perc90: 16 - // perc99: 223 - // count: 2388 -} - -func Example_mergeMultipleStreams() { - // Scenario: - // We have multiple database shards. On each shard, there is a process - // collecting query response times from the database logs and inserting - // them into a Stream (created via NewTargeted(0.90)), much like the - // Simple example. These processes expose a network interface for us to - // ask them to serialize and send us the results of their - // Stream.Samples so we may Merge and Query them. - // - // NOTES: - // * These sample sets are small, allowing us to get them - // across the network much faster than sending the entire list of data - // points. - // - // * For this to work correctly, we must supply the same quantiles - // a priori the process collecting the samples supplied to NewTargeted, - // even if we do not plan to query them all here. - ch := make(chan quantile.Samples) - getDBQuerySamples(ch) - q := quantile.NewTargeted(map[float64]float64{0.90: 0.001}) - for samples := range ch { - q.Merge(samples) - } - fmt.Println("perc90:", q.Query(0.90)) -} - -func Example_window() { - // Scenario: We want the 90th, 95th, and 99th percentiles for each - // minute. - - ch := make(chan float64) - go sendStreamValues(ch) - - tick := time.NewTicker(1 * time.Minute) - q := quantile.NewTargeted(map[float64]float64{ - 0.90: 0.001, - 0.95: 0.0005, - 0.99: 0.0001, - }) - for { - select { - case t := <-tick.C: - flushToDB(t, q.Samples()) - q.Reset() - case v := <-ch: - q.Insert(v) - } - } -} - -func sendStreamValues(ch chan float64) { - // Use your imagination -} - -func flushToDB(t time.Time, samples quantile.Samples) { - // Use your imagination -} - -// This is a stub for the above example. In reality this would hit the remote -// servers via http or something like it. -func getDBQuerySamples(ch chan quantile.Samples) {} - -func sendFloats(ch chan<- float64) { - f, err := os.Open("exampledata.txt") - if err != nil { - log.Fatal(err) - } - sc := bufio.NewScanner(f) - for sc.Scan() { - b := sc.Bytes() - v, err := strconv.ParseFloat(string(b), 64) - if err != nil { - log.Fatal(err) - } - ch <- v - } - if sc.Err() != nil { - log.Fatal(sc.Err()) - } - close(ch) -} diff --git a/vendor/github.com/beorn7/perks/quantile/stream_test.go b/vendor/github.com/beorn7/perks/quantile/stream_test.go deleted file mode 100644 index 8551950..0000000 --- a/vendor/github.com/beorn7/perks/quantile/stream_test.go +++ /dev/null @@ -1,215 +0,0 @@ -package quantile - -import ( - "math" - "math/rand" - "sort" - "testing" -) - -var ( - Targets = map[float64]float64{ - 0.01: 0.001, - 0.10: 0.01, - 0.50: 0.05, - 0.90: 0.01, - 0.99: 0.001, - } - TargetsSmallEpsilon = map[float64]float64{ - 0.01: 0.0001, - 0.10: 0.001, - 0.50: 0.005, - 0.90: 0.001, - 0.99: 0.0001, - } - LowQuantiles = []float64{0.01, 0.1, 0.5} - HighQuantiles = []float64{0.99, 0.9, 0.5} -) - -const RelativeEpsilon = 0.01 - -func verifyPercsWithAbsoluteEpsilon(t *testing.T, a []float64, s *Stream) { - sort.Float64s(a) - for quantile, epsilon := range Targets { - n := float64(len(a)) - k := int(quantile * n) - if k < 1 { - k = 1 - } - lower := int((quantile - epsilon) * n) - if lower < 1 { - lower = 1 - } - upper := int(math.Ceil((quantile + epsilon) * n)) - if upper > len(a) { - upper = len(a) - } - w, min, max := a[k-1], a[lower-1], a[upper-1] - if g := s.Query(quantile); g < min || g > max { - t.Errorf("q=%f: want %v [%f,%f], got %v", quantile, w, min, max, g) - } - } -} - -func verifyLowPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) { - sort.Float64s(a) - for _, qu := range LowQuantiles { - n := float64(len(a)) - k := int(qu * n) - - lowerRank := int((1 - RelativeEpsilon) * qu * n) - upperRank := int(math.Ceil((1 + RelativeEpsilon) * qu * n)) - w, min, max := a[k-1], a[lowerRank-1], a[upperRank-1] - if g := s.Query(qu); g < min || g > max { - t.Errorf("q=%f: want %v [%f,%f], got %v", qu, w, min, max, g) - } - } -} - -func verifyHighPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) { - sort.Float64s(a) - for _, qu := range HighQuantiles { - n := float64(len(a)) - k := int(qu * n) - - lowerRank := int((1 - (1+RelativeEpsilon)*(1-qu)) * n) - upperRank := int(math.Ceil((1 - (1-RelativeEpsilon)*(1-qu)) * n)) - w, min, max := a[k-1], a[lowerRank-1], a[upperRank-1] - if g := s.Query(qu); g < min || g > max { - t.Errorf("q=%f: want %v [%f,%f], got %v", qu, w, min, max, g) - } - } -} - -func populateStream(s *Stream) []float64 { - a := make([]float64, 0, 1e5+100) - for i := 0; i < cap(a); i++ { - v := rand.NormFloat64() - // Add 5% asymmetric outliers. - if i%20 == 0 { - v = v*v + 1 - } - s.Insert(v) - a = append(a, v) - } - return a -} - -func TestTargetedQuery(t *testing.T) { - rand.Seed(42) - s := NewTargeted(Targets) - a := populateStream(s) - verifyPercsWithAbsoluteEpsilon(t, a, s) -} - -func TestTargetedQuerySmallSampleSize(t *testing.T) { - rand.Seed(42) - s := NewTargeted(TargetsSmallEpsilon) - a := []float64{1, 2, 3, 4, 5} - for _, v := range a { - s.Insert(v) - } - verifyPercsWithAbsoluteEpsilon(t, a, s) - // If not yet flushed, results should be precise: - if !s.flushed() { - for φ, want := range map[float64]float64{ - 0.01: 1, - 0.10: 1, - 0.50: 3, - 0.90: 5, - 0.99: 5, - } { - if got := s.Query(φ); got != want { - t.Errorf("want %f for φ=%f, got %f", want, φ, got) - } - } - } -} - -func TestLowBiasedQuery(t *testing.T) { - rand.Seed(42) - s := NewLowBiased(RelativeEpsilon) - a := populateStream(s) - verifyLowPercsWithRelativeEpsilon(t, a, s) -} - -func TestHighBiasedQuery(t *testing.T) { - rand.Seed(42) - s := NewHighBiased(RelativeEpsilon) - a := populateStream(s) - verifyHighPercsWithRelativeEpsilon(t, a, s) -} - -// BrokenTestTargetedMerge is broken, see Merge doc comment. -func BrokenTestTargetedMerge(t *testing.T) { - rand.Seed(42) - s1 := NewTargeted(Targets) - s2 := NewTargeted(Targets) - a := populateStream(s1) - a = append(a, populateStream(s2)...) - s1.Merge(s2.Samples()) - verifyPercsWithAbsoluteEpsilon(t, a, s1) -} - -// BrokenTestLowBiasedMerge is broken, see Merge doc comment. -func BrokenTestLowBiasedMerge(t *testing.T) { - rand.Seed(42) - s1 := NewLowBiased(RelativeEpsilon) - s2 := NewLowBiased(RelativeEpsilon) - a := populateStream(s1) - a = append(a, populateStream(s2)...) - s1.Merge(s2.Samples()) - verifyLowPercsWithRelativeEpsilon(t, a, s2) -} - -// BrokenTestHighBiasedMerge is broken, see Merge doc comment. -func BrokenTestHighBiasedMerge(t *testing.T) { - rand.Seed(42) - s1 := NewHighBiased(RelativeEpsilon) - s2 := NewHighBiased(RelativeEpsilon) - a := populateStream(s1) - a = append(a, populateStream(s2)...) - s1.Merge(s2.Samples()) - verifyHighPercsWithRelativeEpsilon(t, a, s2) -} - -func TestUncompressed(t *testing.T) { - q := NewTargeted(Targets) - for i := 100; i > 0; i-- { - q.Insert(float64(i)) - } - if g := q.Count(); g != 100 { - t.Errorf("want count 100, got %d", g) - } - // Before compression, Query should have 100% accuracy. - for quantile := range Targets { - w := quantile * 100 - if g := q.Query(quantile); g != w { - t.Errorf("want %f, got %f", w, g) - } - } -} - -func TestUncompressedSamples(t *testing.T) { - q := NewTargeted(map[float64]float64{0.99: 0.001}) - for i := 1; i <= 100; i++ { - q.Insert(float64(i)) - } - if g := q.Samples().Len(); g != 100 { - t.Errorf("want count 100, got %d", g) - } -} - -func TestUncompressedOne(t *testing.T) { - q := NewTargeted(map[float64]float64{0.99: 0.01}) - q.Insert(3.14) - if g := q.Query(0.90); g != 3.14 { - t.Error("want PI, got", g) - } -} - -func TestDefaults(t *testing.T) { - if g := NewTargeted(map[float64]float64{0.99: 0.001}).Query(0.99); g != 0 { - t.Errorf("want 0, got %f", g) - } -} diff --git a/vendor/github.com/davecgh/go-spew/.gitignore b/vendor/github.com/davecgh/go-spew/.gitignore deleted file mode 100644 index 0026861..0000000 --- a/vendor/github.com/davecgh/go-spew/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe diff --git a/vendor/github.com/davecgh/go-spew/.travis.yml b/vendor/github.com/davecgh/go-spew/.travis.yml deleted file mode 100644 index 1f4cbf5..0000000 --- a/vendor/github.com/davecgh/go-spew/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go -go_import_path: github.com/davecgh/go-spew -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - tip -sudo: false -install: - - go get -v github.com/alecthomas/gometalinter - - gometalinter --install -script: - - export PATH=$PATH:$HOME/gopath/bin - - export GORACE="halt_on_error=1" - - test -z "$(gometalinter --disable-all - --enable=gofmt - --enable=golint - --enable=vet - --enable=gosimple - --enable=unconvert - --deadline=4m ./spew | tee /dev/stderr)" - - go test -v -race -tags safe ./spew - - go test -v -race -tags testcgo ./spew -covermode=atomic -coverprofile=profile.cov -after_success: - - go get -v github.com/mattn/goveralls - - goveralls -coverprofile=profile.cov -service=travis-ci diff --git a/vendor/github.com/davecgh/go-spew/README.md b/vendor/github.com/davecgh/go-spew/README.md deleted file mode 100644 index f6ed02c..0000000 --- a/vendor/github.com/davecgh/go-spew/README.md +++ /dev/null @@ -1,201 +0,0 @@ -go-spew -======= - -[![Build Status](https://img.shields.io/travis/davecgh/go-spew.svg)](https://travis-ci.org/davecgh/go-spew) -[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) -[![Coverage Status](https://img.shields.io/coveralls/davecgh/go-spew.svg)](https://coveralls.io/r/davecgh/go-spew?branch=master) - -Go-spew implements a deep pretty printer for Go data structures to aid in -debugging. A comprehensive suite of tests with 100% test coverage is provided -to ensure proper functionality. See `test_coverage.txt` for the gocov coverage -report. Go-spew is licensed under the liberal ISC license, so it may be used in -open source or commercial projects. - -If you're interested in reading about how this package came to life and some -of the challenges involved in providing a deep pretty printer, there is a blog -post about it -[here](https://web.archive.org/web/20160304013555/https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/). - -## Documentation - -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/davecgh/go-spew/spew) - -Full `go doc` style documentation for the project can be viewed online without -installing this package by using the excellent GoDoc site here: -http://godoc.org/github.com/davecgh/go-spew/spew - -You can also view the documentation locally once the package is installed with -the `godoc` tool by running `godoc -http=":6060"` and pointing your browser to -http://localhost:6060/pkg/github.com/davecgh/go-spew/spew - -## Installation - -```bash -$ go get -u github.com/davecgh/go-spew/spew -``` - -## Quick Start - -Add this import line to the file you're working in: - -```Go -import "github.com/davecgh/go-spew/spew" -``` - -To dump a variable with full newlines, indentation, type, and pointer -information use Dump, Fdump, or Sdump: - -```Go -spew.Dump(myVar1, myVar2, ...) -spew.Fdump(someWriter, myVar1, myVar2, ...) -str := spew.Sdump(myVar1, myVar2, ...) -``` - -Alternatively, if you would prefer to use format strings with a compacted inline -printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most -compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types -and pointer addresses): - -```Go -spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) -spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) -spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) -spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) -``` - -## Debugging a Web Application Example - -Here is an example of how you can use `spew.Sdump()` to help debug a web application. Please be sure to wrap your output using the `html.EscapeString()` function for safety reasons. You should also only use this debugging technique in a development environment, never in production. - -```Go -package main - -import ( - "fmt" - "html" - "net/http" - - "github.com/davecgh/go-spew/spew" -) - -func handler(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/html") - fmt.Fprintf(w, "Hi there, %s!", r.URL.Path[1:]) - fmt.Fprintf(w, "") -} - -func main() { - http.HandleFunc("/", handler) - http.ListenAndServe(":8080", nil) -} -``` - -## Sample Dump Output - -``` -(main.Foo) { - unexportedField: (*main.Bar)(0xf84002e210)({ - flag: (main.Flag) flagTwo, - data: (uintptr) - }), - ExportedField: (map[interface {}]interface {}) { - (string) "one": (bool) true - } -} -([]uint8) { - 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | - 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| - 00000020 31 32 |12| -} -``` - -## Sample Formatter Output - -Double pointer to a uint8: -``` - %v: <**>5 - %+v: <**>(0xf8400420d0->0xf8400420c8)5 - %#v: (**uint8)5 - %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 -``` - -Pointer to circular struct with a uint8 field and a pointer to itself: -``` - %v: <*>{1 <*>} - %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} - %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} - %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} -``` - -## Configuration Options - -Configuration of spew is handled by fields in the ConfigState type. For -convenience, all of the top-level functions use a global state available via the -spew.Config global. - -It is also possible to create a ConfigState instance that provides methods -equivalent to the top-level functions. This allows concurrent configuration -options. See the ConfigState documentation for more details. - -``` -* Indent - String to use for each indentation level for Dump functions. - It is a single space by default. A popular alternative is "\t". - -* MaxDepth - Maximum number of levels to descend into nested data structures. - There is no limit by default. - -* DisableMethods - Disables invocation of error and Stringer interface methods. - Method invocation is enabled by default. - -* DisablePointerMethods - Disables invocation of error and Stringer interface methods on types - which only accept pointer receivers from non-pointer variables. This option - relies on access to the unsafe package, so it will not have any effect when - running in environments without access to the unsafe package such as Google - App Engine or with the "safe" build tag specified. - Pointer method invocation is enabled by default. - -* DisablePointerAddresses - DisablePointerAddresses specifies whether to disable the printing of - pointer addresses. This is useful when diffing data structures in tests. - -* DisableCapacities - DisableCapacities specifies whether to disable the printing of capacities - for arrays, slices, maps and channels. This is useful when diffing data - structures in tests. - -* ContinueOnMethod - Enables recursion into types after invoking error and Stringer interface - methods. Recursion after method invocation is disabled by default. - -* SortKeys - Specifies map keys should be sorted before being printed. Use - this to have a more deterministic, diffable output. Note that - only native types (bool, int, uint, floats, uintptr and string) - and types which implement error or Stringer interfaces are supported, - with other types sorted according to the reflect.Value.String() output - which guarantees display stability. Natural map order is used by - default. - -* SpewKeys - SpewKeys specifies that, as a last resort attempt, map keys should be - spewed to strings and sorted by those strings. This is only considered - if SortKeys is true. - -``` - -## Unsafe Package Dependency - -This package relies on the unsafe package to perform some of the more advanced -features, however it also supports a "limited" mode which allows it to work in -environments where the unsafe package is not available. By default, it will -operate in this mode on Google App Engine and when compiled with GopherJS. The -"safe" build tag may also be specified to force the package to build without -using the unsafe package. - -## License - -Go-spew is licensed under the [copyfree](http://copyfree.org) ISC License. diff --git a/vendor/github.com/davecgh/go-spew/cov_report.sh b/vendor/github.com/davecgh/go-spew/cov_report.sh deleted file mode 100644 index 9579497..0000000 --- a/vendor/github.com/davecgh/go-spew/cov_report.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# This script uses gocov to generate a test coverage report. -# The gocov tool my be obtained with the following command: -# go get github.com/axw/gocov/gocov -# -# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. - -# Check for gocov. -if ! type gocov >/dev/null 2>&1; then - echo >&2 "This script requires the gocov tool." - echo >&2 "You may obtain it with the following command:" - echo >&2 "go get github.com/axw/gocov/gocov" - exit 1 -fi - -# Only run the cgo tests if gcc is installed. -if type gcc >/dev/null 2>&1; then - (cd spew && gocov test -tags testcgo | gocov report) -else - (cd spew && gocov test | gocov report) -fi diff --git a/vendor/github.com/davecgh/go-spew/spew/common_test.go b/vendor/github.com/davecgh/go-spew/spew/common_test.go deleted file mode 100644 index 0f5ce47..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/common_test.go +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew_test - -import ( - "fmt" - "reflect" - "testing" - - "github.com/davecgh/go-spew/spew" -) - -// custom type to test Stinger interface on non-pointer receiver. -type stringer string - -// String implements the Stringer interface for testing invocation of custom -// stringers on types with non-pointer receivers. -func (s stringer) String() string { - return "stringer " + string(s) -} - -// custom type to test Stinger interface on pointer receiver. -type pstringer string - -// String implements the Stringer interface for testing invocation of custom -// stringers on types with only pointer receivers. -func (s *pstringer) String() string { - return "stringer " + string(*s) -} - -// xref1 and xref2 are cross referencing structs for testing circular reference -// detection. -type xref1 struct { - ps2 *xref2 -} -type xref2 struct { - ps1 *xref1 -} - -// indirCir1, indirCir2, and indirCir3 are used to generate an indirect circular -// reference for testing detection. -type indirCir1 struct { - ps2 *indirCir2 -} -type indirCir2 struct { - ps3 *indirCir3 -} -type indirCir3 struct { - ps1 *indirCir1 -} - -// embed is used to test embedded structures. -type embed struct { - a string -} - -// embedwrap is used to test embedded structures. -type embedwrap struct { - *embed - e *embed -} - -// panicer is used to intentionally cause a panic for testing spew properly -// handles them -type panicer int - -func (p panicer) String() string { - panic("test panic") -} - -// customError is used to test custom error interface invocation. -type customError int - -func (e customError) Error() string { - return fmt.Sprintf("error: %d", int(e)) -} - -// stringizeWants converts a slice of wanted test output into a format suitable -// for a test error message. -func stringizeWants(wants []string) string { - s := "" - for i, want := range wants { - if i > 0 { - s += fmt.Sprintf("want%d: %s", i+1, want) - } else { - s += "want: " + want - } - } - return s -} - -// testFailed returns whether or not a test failed by checking if the result -// of the test is in the slice of wanted strings. -func testFailed(result string, wants []string) bool { - for _, want := range wants { - if result == want { - return false - } - } - return true -} - -type sortableStruct struct { - x int -} - -func (ss sortableStruct) String() string { - return fmt.Sprintf("ss.%d", ss.x) -} - -type unsortableStruct struct { - x int -} - -type sortTestCase struct { - input []reflect.Value - expected []reflect.Value -} - -func helpTestSortValues(tests []sortTestCase, cs *spew.ConfigState, t *testing.T) { - getInterfaces := func(values []reflect.Value) []interface{} { - interfaces := []interface{}{} - for _, v := range values { - interfaces = append(interfaces, v.Interface()) - } - return interfaces - } - - for _, test := range tests { - spew.SortValues(test.input, cs) - // reflect.DeepEqual cannot really make sense of reflect.Value, - // probably because of all the pointer tricks. For instance, - // v(2.0) != v(2.0) on a 32-bits system. Turn them into interface{} - // instead. - input := getInterfaces(test.input) - expected := getInterfaces(test.expected) - if !reflect.DeepEqual(input, expected) { - t.Errorf("Sort mismatch:\n %v != %v", input, expected) - } - } -} - -// TestSortValues ensures the sort functionality for relect.Value based sorting -// works as intended. -func TestSortValues(t *testing.T) { - v := reflect.ValueOf - - a := v("a") - b := v("b") - c := v("c") - embedA := v(embed{"a"}) - embedB := v(embed{"b"}) - embedC := v(embed{"c"}) - tests := []sortTestCase{ - // No values. - { - []reflect.Value{}, - []reflect.Value{}, - }, - // Bools. - { - []reflect.Value{v(false), v(true), v(false)}, - []reflect.Value{v(false), v(false), v(true)}, - }, - // Ints. - { - []reflect.Value{v(2), v(1), v(3)}, - []reflect.Value{v(1), v(2), v(3)}, - }, - // Uints. - { - []reflect.Value{v(uint8(2)), v(uint8(1)), v(uint8(3))}, - []reflect.Value{v(uint8(1)), v(uint8(2)), v(uint8(3))}, - }, - // Floats. - { - []reflect.Value{v(2.0), v(1.0), v(3.0)}, - []reflect.Value{v(1.0), v(2.0), v(3.0)}, - }, - // Strings. - { - []reflect.Value{b, a, c}, - []reflect.Value{a, b, c}, - }, - // Array - { - []reflect.Value{v([3]int{3, 2, 1}), v([3]int{1, 3, 2}), v([3]int{1, 2, 3})}, - []reflect.Value{v([3]int{1, 2, 3}), v([3]int{1, 3, 2}), v([3]int{3, 2, 1})}, - }, - // Uintptrs. - { - []reflect.Value{v(uintptr(2)), v(uintptr(1)), v(uintptr(3))}, - []reflect.Value{v(uintptr(1)), v(uintptr(2)), v(uintptr(3))}, - }, - // SortableStructs. - { - // Note: not sorted - DisableMethods is set. - []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, - []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, - }, - // UnsortableStructs. - { - // Note: not sorted - SpewKeys is false. - []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, - []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, - }, - // Invalid. - { - []reflect.Value{embedB, embedA, embedC}, - []reflect.Value{embedB, embedA, embedC}, - }, - } - cs := spew.ConfigState{DisableMethods: true, SpewKeys: false} - helpTestSortValues(tests, &cs, t) -} - -// TestSortValuesWithMethods ensures the sort functionality for relect.Value -// based sorting works as intended when using string methods. -func TestSortValuesWithMethods(t *testing.T) { - v := reflect.ValueOf - - a := v("a") - b := v("b") - c := v("c") - tests := []sortTestCase{ - // Ints. - { - []reflect.Value{v(2), v(1), v(3)}, - []reflect.Value{v(1), v(2), v(3)}, - }, - // Strings. - { - []reflect.Value{b, a, c}, - []reflect.Value{a, b, c}, - }, - // SortableStructs. - { - []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, - []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})}, - }, - // UnsortableStructs. - { - // Note: not sorted - SpewKeys is false. - []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, - []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, - }, - } - cs := spew.ConfigState{DisableMethods: false, SpewKeys: false} - helpTestSortValues(tests, &cs, t) -} - -// TestSortValuesWithSpew ensures the sort functionality for relect.Value -// based sorting works as intended when using spew to stringify keys. -func TestSortValuesWithSpew(t *testing.T) { - v := reflect.ValueOf - - a := v("a") - b := v("b") - c := v("c") - tests := []sortTestCase{ - // Ints. - { - []reflect.Value{v(2), v(1), v(3)}, - []reflect.Value{v(1), v(2), v(3)}, - }, - // Strings. - { - []reflect.Value{b, a, c}, - []reflect.Value{a, b, c}, - }, - // SortableStructs. - { - []reflect.Value{v(sortableStruct{2}), v(sortableStruct{1}), v(sortableStruct{3})}, - []reflect.Value{v(sortableStruct{1}), v(sortableStruct{2}), v(sortableStruct{3})}, - }, - // UnsortableStructs. - { - []reflect.Value{v(unsortableStruct{2}), v(unsortableStruct{1}), v(unsortableStruct{3})}, - []reflect.Value{v(unsortableStruct{1}), v(unsortableStruct{2}), v(unsortableStruct{3})}, - }, - } - cs := spew.ConfigState{DisableMethods: true, SpewKeys: true} - helpTestSortValues(tests, &cs, t) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/dump_test.go b/vendor/github.com/davecgh/go-spew/spew/dump_test.go deleted file mode 100644 index 4a31a2e..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/dump_test.go +++ /dev/null @@ -1,1042 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* -Test Summary: -NOTE: For each test, a nil pointer, a single pointer and double pointer to the -base test element are also tested to ensure proper indirection across all types. - -- Max int8, int16, int32, int64, int -- Max uint8, uint16, uint32, uint64, uint -- Boolean true and false -- Standard complex64 and complex128 -- Array containing standard ints -- Array containing type with custom formatter on pointer receiver only -- Array containing interfaces -- Array containing bytes -- Slice containing standard float32 values -- Slice containing type with custom formatter on pointer receiver only -- Slice containing interfaces -- Slice containing bytes -- Nil slice -- Standard string -- Nil interface -- Sub-interface -- Map with string keys and int vals -- Map with custom formatter type on pointer receiver only keys and vals -- Map with interface keys and values -- Map with nil interface value -- Struct with primitives -- Struct that contains another struct -- Struct that contains custom type with Stringer pointer interface via both - exported and unexported fields -- Struct that contains embedded struct and field to same struct -- Uintptr to 0 (null pointer) -- Uintptr address of real variable -- Unsafe.Pointer to 0 (null pointer) -- Unsafe.Pointer to address of real variable -- Nil channel -- Standard int channel -- Function with no params and no returns -- Function with param and no returns -- Function with multiple params and multiple returns -- Struct that is circular through self referencing -- Structs that are circular through cross referencing -- Structs that are indirectly circular -- Type that panics in its Stringer interface -*/ - -package spew_test - -import ( - "bytes" - "fmt" - "testing" - "unsafe" - - "github.com/davecgh/go-spew/spew" -) - -// dumpTest is used to describe a test to be performed against the Dump method. -type dumpTest struct { - in interface{} - wants []string -} - -// dumpTests houses all of the tests to be performed against the Dump method. -var dumpTests = make([]dumpTest, 0) - -// addDumpTest is a helper method to append the passed input and desired result -// to dumpTests -func addDumpTest(in interface{}, wants ...string) { - test := dumpTest{in, wants} - dumpTests = append(dumpTests, test) -} - -func addIntDumpTests() { - // Max int8. - v := int8(127) - nv := (*int8)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "int8" - vs := "127" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Max int16. - v2 := int16(32767) - nv2 := (*int16)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "int16" - v2s := "32767" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") - - // Max int32. - v3 := int32(2147483647) - nv3 := (*int32)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "int32" - v3s := "2147483647" - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") - - // Max int64. - v4 := int64(9223372036854775807) - nv4 := (*int64)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "int64" - v4s := "9223372036854775807" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") - addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") - addDumpTest(nv4, "(*"+v4t+")()\n") - - // Max int. - v5 := int(2147483647) - nv5 := (*int)(nil) - pv5 := &v5 - v5Addr := fmt.Sprintf("%p", pv5) - pv5Addr := fmt.Sprintf("%p", &pv5) - v5t := "int" - v5s := "2147483647" - addDumpTest(v5, "("+v5t+") "+v5s+"\n") - addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") - addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") - addDumpTest(nv5, "(*"+v5t+")()\n") -} - -func addUintDumpTests() { - // Max uint8. - v := uint8(255) - nv := (*uint8)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "uint8" - vs := "255" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Max uint16. - v2 := uint16(65535) - nv2 := (*uint16)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uint16" - v2s := "65535" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") - - // Max uint32. - v3 := uint32(4294967295) - nv3 := (*uint32)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "uint32" - v3s := "4294967295" - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") - - // Max uint64. - v4 := uint64(18446744073709551615) - nv4 := (*uint64)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "uint64" - v4s := "18446744073709551615" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") - addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") - addDumpTest(nv4, "(*"+v4t+")()\n") - - // Max uint. - v5 := uint(4294967295) - nv5 := (*uint)(nil) - pv5 := &v5 - v5Addr := fmt.Sprintf("%p", pv5) - pv5Addr := fmt.Sprintf("%p", &pv5) - v5t := "uint" - v5s := "4294967295" - addDumpTest(v5, "("+v5t+") "+v5s+"\n") - addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") - addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") - addDumpTest(nv5, "(*"+v5t+")()\n") -} - -func addBoolDumpTests() { - // Boolean true. - v := bool(true) - nv := (*bool)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "bool" - vs := "true" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Boolean false. - v2 := bool(false) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "bool" - v2s := "false" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") -} - -func addFloatDumpTests() { - // Standard float32. - v := float32(3.1415) - nv := (*float32)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "float32" - vs := "3.1415" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Standard float64. - v2 := float64(3.1415926) - nv2 := (*float64)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "float64" - v2s := "3.1415926" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") -} - -func addComplexDumpTests() { - // Standard complex64. - v := complex(float32(6), -2) - nv := (*complex64)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "complex64" - vs := "(6-2i)" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Standard complex128. - v2 := complex(float64(-6), 2) - nv2 := (*complex128)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "complex128" - v2s := "(-6+2i)" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") -} - -func addArrayDumpTests() { - // Array containing standard ints. - v := [3]int{1, 2, 3} - vLen := fmt.Sprintf("%d", len(v)) - vCap := fmt.Sprintf("%d", cap(v)) - nv := (*[3]int)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "int" - vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 1,\n (" + - vt + ") 2,\n (" + vt + ") 3\n}" - addDumpTest(v, "([3]"+vt+") "+vs+"\n") - addDumpTest(pv, "(*[3]"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**[3]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*[3]"+vt+")()\n") - - // Array containing type with custom formatter on pointer receiver only. - v2i0 := pstringer("1") - v2i1 := pstringer("2") - v2i2 := pstringer("3") - v2 := [3]pstringer{v2i0, v2i1, v2i2} - v2i0Len := fmt.Sprintf("%d", len(v2i0)) - v2i1Len := fmt.Sprintf("%d", len(v2i1)) - v2i2Len := fmt.Sprintf("%d", len(v2i2)) - v2Len := fmt.Sprintf("%d", len(v2)) - v2Cap := fmt.Sprintf("%d", cap(v2)) - nv2 := (*[3]pstringer)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.pstringer" - v2sp := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + - ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t + - ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t + - ") (len=" + v2i2Len + ") " + "stringer 3\n}" - v2s := v2sp - if spew.UnsafeDisabled { - v2s = "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + - ") (len=" + v2i0Len + ") \"1\",\n (" + v2t + ") (len=" + - v2i1Len + ") \"2\",\n (" + v2t + ") (len=" + v2i2Len + - ") " + "\"3\"\n}" - } - addDumpTest(v2, "([3]"+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*[3]"+v2t+")("+v2Addr+")("+v2sp+")\n") - addDumpTest(&pv2, "(**[3]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2sp+")\n") - addDumpTest(nv2, "(*[3]"+v2t+")()\n") - - // Array containing interfaces. - v3i0 := "one" - v3 := [3]interface{}{v3i0, int(2), uint(3)} - v3i0Len := fmt.Sprintf("%d", len(v3i0)) - v3Len := fmt.Sprintf("%d", len(v3)) - v3Cap := fmt.Sprintf("%d", cap(v3)) - nv3 := (*[3]interface{})(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "[3]interface {}" - v3t2 := "string" - v3t3 := "int" - v3t4 := "uint" - v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + - "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + - v3t4 + ") 3\n}" - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") - - // Array containing bytes. - v4 := [34]byte{ - 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, - 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, - 0x31, 0x32, - } - v4Len := fmt.Sprintf("%d", len(v4)) - v4Cap := fmt.Sprintf("%d", cap(v4)) - nv4 := (*[34]byte)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "[34]uint8" - v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + - "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + - " |............... |\n" + - " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + - " |!\"#$%&'()*+,-./0|\n" + - " 00000020 31 32 " + - " |12|\n}" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") - addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") - addDumpTest(nv4, "(*"+v4t+")()\n") -} - -func addSliceDumpTests() { - // Slice containing standard float32 values. - v := []float32{3.14, 6.28, 12.56} - vLen := fmt.Sprintf("%d", len(v)) - vCap := fmt.Sprintf("%d", cap(v)) - nv := (*[]float32)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "float32" - vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 3.14,\n (" + - vt + ") 6.28,\n (" + vt + ") 12.56\n}" - addDumpTest(v, "([]"+vt+") "+vs+"\n") - addDumpTest(pv, "(*[]"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**[]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*[]"+vt+")()\n") - - // Slice containing type with custom formatter on pointer receiver only. - v2i0 := pstringer("1") - v2i1 := pstringer("2") - v2i2 := pstringer("3") - v2 := []pstringer{v2i0, v2i1, v2i2} - v2i0Len := fmt.Sprintf("%d", len(v2i0)) - v2i1Len := fmt.Sprintf("%d", len(v2i1)) - v2i2Len := fmt.Sprintf("%d", len(v2i2)) - v2Len := fmt.Sprintf("%d", len(v2)) - v2Cap := fmt.Sprintf("%d", cap(v2)) - nv2 := (*[]pstringer)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.pstringer" - v2s := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" + - v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len + - ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " + - "stringer 3\n}" - addDumpTest(v2, "([]"+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*[]"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**[]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*[]"+v2t+")()\n") - - // Slice containing interfaces. - v3i0 := "one" - v3 := []interface{}{v3i0, int(2), uint(3), nil} - v3i0Len := fmt.Sprintf("%d", len(v3i0)) - v3Len := fmt.Sprintf("%d", len(v3)) - v3Cap := fmt.Sprintf("%d", cap(v3)) - nv3 := (*[]interface{})(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "[]interface {}" - v3t2 := "string" - v3t3 := "int" - v3t4 := "uint" - v3t5 := "interface {}" - v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + - "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + - v3t4 + ") 3,\n (" + v3t5 + ") \n}" - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") - - // Slice containing bytes. - v4 := []byte{ - 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, - 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, - 0x31, 0x32, - } - v4Len := fmt.Sprintf("%d", len(v4)) - v4Cap := fmt.Sprintf("%d", cap(v4)) - nv4 := (*[]byte)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "[]uint8" - v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + - "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + - " |............... |\n" + - " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + - " |!\"#$%&'()*+,-./0|\n" + - " 00000020 31 32 " + - " |12|\n}" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") - addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") - addDumpTest(nv4, "(*"+v4t+")()\n") - - // Nil slice. - v5 := []int(nil) - nv5 := (*[]int)(nil) - pv5 := &v5 - v5Addr := fmt.Sprintf("%p", pv5) - pv5Addr := fmt.Sprintf("%p", &pv5) - v5t := "[]int" - v5s := "" - addDumpTest(v5, "("+v5t+") "+v5s+"\n") - addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") - addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") - addDumpTest(nv5, "(*"+v5t+")()\n") -} - -func addStringDumpTests() { - // Standard string. - v := "test" - vLen := fmt.Sprintf("%d", len(v)) - nv := (*string)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "string" - vs := "(len=" + vLen + ") \"test\"" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") -} - -func addInterfaceDumpTests() { - // Nil interface. - var v interface{} - nv := (*interface{})(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "interface {}" - vs := "" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Sub-interface. - v2 := interface{}(uint16(65535)) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uint16" - v2s := "65535" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") -} - -func addMapDumpTests() { - // Map with string keys and int vals. - k := "one" - kk := "two" - m := map[string]int{k: 1, kk: 2} - klen := fmt.Sprintf("%d", len(k)) // not kLen to shut golint up - kkLen := fmt.Sprintf("%d", len(kk)) - mLen := fmt.Sprintf("%d", len(m)) - nilMap := map[string]int(nil) - nm := (*map[string]int)(nil) - pm := &m - mAddr := fmt.Sprintf("%p", pm) - pmAddr := fmt.Sprintf("%p", &pm) - mt := "map[string]int" - mt1 := "string" - mt2 := "int" - ms := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + klen + ") " + - "\"one\": (" + mt2 + ") 1,\n (" + mt1 + ") (len=" + kkLen + - ") \"two\": (" + mt2 + ") 2\n}" - ms2 := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + kkLen + ") " + - "\"two\": (" + mt2 + ") 2,\n (" + mt1 + ") (len=" + klen + - ") \"one\": (" + mt2 + ") 1\n}" - addDumpTest(m, "("+mt+") "+ms+"\n", "("+mt+") "+ms2+"\n") - addDumpTest(pm, "(*"+mt+")("+mAddr+")("+ms+")\n", - "(*"+mt+")("+mAddr+")("+ms2+")\n") - addDumpTest(&pm, "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms+")\n", - "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms2+")\n") - addDumpTest(nm, "(*"+mt+")()\n") - addDumpTest(nilMap, "("+mt+") \n") - - // Map with custom formatter type on pointer receiver only keys and vals. - k2 := pstringer("one") - v2 := pstringer("1") - m2 := map[pstringer]pstringer{k2: v2} - k2Len := fmt.Sprintf("%d", len(k2)) - v2Len := fmt.Sprintf("%d", len(v2)) - m2Len := fmt.Sprintf("%d", len(m2)) - nilMap2 := map[pstringer]pstringer(nil) - nm2 := (*map[pstringer]pstringer)(nil) - pm2 := &m2 - m2Addr := fmt.Sprintf("%p", pm2) - pm2Addr := fmt.Sprintf("%p", &pm2) - m2t := "map[spew_test.pstringer]spew_test.pstringer" - m2t1 := "spew_test.pstringer" - m2t2 := "spew_test.pstringer" - m2s := "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " + - "stringer one: (" + m2t2 + ") (len=" + v2Len + ") stringer 1\n}" - if spew.UnsafeDisabled { - m2s = "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + - ") " + "\"one\": (" + m2t2 + ") (len=" + v2Len + - ") \"1\"\n}" - } - addDumpTest(m2, "("+m2t+") "+m2s+"\n") - addDumpTest(pm2, "(*"+m2t+")("+m2Addr+")("+m2s+")\n") - addDumpTest(&pm2, "(**"+m2t+")("+pm2Addr+"->"+m2Addr+")("+m2s+")\n") - addDumpTest(nm2, "(*"+m2t+")()\n") - addDumpTest(nilMap2, "("+m2t+") \n") - - // Map with interface keys and values. - k3 := "one" - k3Len := fmt.Sprintf("%d", len(k3)) - m3 := map[interface{}]interface{}{k3: 1} - m3Len := fmt.Sprintf("%d", len(m3)) - nilMap3 := map[interface{}]interface{}(nil) - nm3 := (*map[interface{}]interface{})(nil) - pm3 := &m3 - m3Addr := fmt.Sprintf("%p", pm3) - pm3Addr := fmt.Sprintf("%p", &pm3) - m3t := "map[interface {}]interface {}" - m3t1 := "string" - m3t2 := "int" - m3s := "(len=" + m3Len + ") {\n (" + m3t1 + ") (len=" + k3Len + ") " + - "\"one\": (" + m3t2 + ") 1\n}" - addDumpTest(m3, "("+m3t+") "+m3s+"\n") - addDumpTest(pm3, "(*"+m3t+")("+m3Addr+")("+m3s+")\n") - addDumpTest(&pm3, "(**"+m3t+")("+pm3Addr+"->"+m3Addr+")("+m3s+")\n") - addDumpTest(nm3, "(*"+m3t+")()\n") - addDumpTest(nilMap3, "("+m3t+") \n") - - // Map with nil interface value. - k4 := "nil" - k4Len := fmt.Sprintf("%d", len(k4)) - m4 := map[string]interface{}{k4: nil} - m4Len := fmt.Sprintf("%d", len(m4)) - nilMap4 := map[string]interface{}(nil) - nm4 := (*map[string]interface{})(nil) - pm4 := &m4 - m4Addr := fmt.Sprintf("%p", pm4) - pm4Addr := fmt.Sprintf("%p", &pm4) - m4t := "map[string]interface {}" - m4t1 := "string" - m4t2 := "interface {}" - m4s := "(len=" + m4Len + ") {\n (" + m4t1 + ") (len=" + k4Len + ")" + - " \"nil\": (" + m4t2 + ") \n}" - addDumpTest(m4, "("+m4t+") "+m4s+"\n") - addDumpTest(pm4, "(*"+m4t+")("+m4Addr+")("+m4s+")\n") - addDumpTest(&pm4, "(**"+m4t+")("+pm4Addr+"->"+m4Addr+")("+m4s+")\n") - addDumpTest(nm4, "(*"+m4t+")()\n") - addDumpTest(nilMap4, "("+m4t+") \n") -} - -func addStructDumpTests() { - // Struct with primitives. - type s1 struct { - a int8 - b uint8 - } - v := s1{127, 255} - nv := (*s1)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.s1" - vt2 := "int8" - vt3 := "uint8" - vs := "{\n a: (" + vt2 + ") 127,\n b: (" + vt3 + ") 255\n}" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Struct that contains another struct. - type s2 struct { - s1 s1 - b bool - } - v2 := s2{s1{127, 255}, true} - nv2 := (*s2)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.s2" - v2t2 := "spew_test.s1" - v2t3 := "int8" - v2t4 := "uint8" - v2t5 := "bool" - v2s := "{\n s1: (" + v2t2 + ") {\n a: (" + v2t3 + ") 127,\n b: (" + - v2t4 + ") 255\n },\n b: (" + v2t5 + ") true\n}" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") - - // Struct that contains custom type with Stringer pointer interface via both - // exported and unexported fields. - type s3 struct { - s pstringer - S pstringer - } - v3 := s3{"test", "test2"} - nv3 := (*s3)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "spew_test.s3" - v3t2 := "spew_test.pstringer" - v3s := "{\n s: (" + v3t2 + ") (len=4) stringer test,\n S: (" + v3t2 + - ") (len=5) stringer test2\n}" - v3sp := v3s - if spew.UnsafeDisabled { - v3s = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + - v3t2 + ") (len=5) \"test2\"\n}" - v3sp = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + - v3t2 + ") (len=5) stringer test2\n}" - } - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3sp+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3sp+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") - - // Struct that contains embedded struct and field to same struct. - e := embed{"embedstr"} - eLen := fmt.Sprintf("%d", len("embedstr")) - v4 := embedwrap{embed: &e, e: &e} - nv4 := (*embedwrap)(nil) - pv4 := &v4 - eAddr := fmt.Sprintf("%p", &e) - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "spew_test.embedwrap" - v4t2 := "spew_test.embed" - v4t3 := "string" - v4s := "{\n embed: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 + - ") (len=" + eLen + ") \"embedstr\"\n }),\n e: (*" + v4t2 + - ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ")" + - " \"embedstr\"\n })\n}" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") - addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") - addDumpTest(nv4, "(*"+v4t+")()\n") -} - -func addUintptrDumpTests() { - // Null pointer. - v := uintptr(0) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "uintptr" - vs := "" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - - // Address of real variable. - i := 1 - v2 := uintptr(unsafe.Pointer(&i)) - nv2 := (*uintptr)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uintptr" - v2s := fmt.Sprintf("%p", &i) - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") -} - -func addUnsafePointerDumpTests() { - // Null pointer. - v := unsafe.Pointer(nil) - nv := (*unsafe.Pointer)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "unsafe.Pointer" - vs := "" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Address of real variable. - i := 1 - v2 := unsafe.Pointer(&i) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "unsafe.Pointer" - v2s := fmt.Sprintf("%p", &i) - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv, "(*"+vt+")()\n") -} - -func addChanDumpTests() { - // Nil channel. - var v chan int - pv := &v - nv := (*chan int)(nil) - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "chan int" - vs := "" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Real channel. - v2 := make(chan int) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "chan int" - v2s := fmt.Sprintf("%p", v2) - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") -} - -func addFuncDumpTests() { - // Function with no params and no returns. - v := addIntDumpTests - nv := (*func())(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "func()" - vs := fmt.Sprintf("%p", v) - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") - - // Function with param and no returns. - v2 := TestDump - nv2 := (*func(*testing.T))(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "func(*testing.T)" - v2s := fmt.Sprintf("%p", v2) - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") - addDumpTest(nv2, "(*"+v2t+")()\n") - - // Function with multiple params and multiple returns. - var v3 = func(i int, s string) (b bool, err error) { - return true, nil - } - nv3 := (*func(int, string) (bool, error))(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "func(int, string) (bool, error)" - v3s := fmt.Sprintf("%p", v3) - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") - addDumpTest(nv3, "(*"+v3t+")()\n") -} - -func addCircularDumpTests() { - // Struct that is circular through self referencing. - type circular struct { - c *circular - } - v := circular{nil} - v.c = &v - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.circular" - vs := "{\n c: (*" + vt + ")(" + vAddr + ")({\n c: (*" + vt + ")(" + - vAddr + ")()\n })\n}" - vs2 := "{\n c: (*" + vt + ")(" + vAddr + ")()\n}" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs2+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs2+")\n") - - // Structs that are circular through cross referencing. - v2 := xref1{nil} - ts2 := xref2{&v2} - v2.ps2 = &ts2 - pv2 := &v2 - ts2Addr := fmt.Sprintf("%p", &ts2) - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.xref1" - v2t2 := "spew_test.xref2" - v2s := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + - ")(" + v2Addr + ")({\n ps2: (*" + v2t2 + ")(" + ts2Addr + - ")()\n })\n })\n}" - v2s2 := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + - ")(" + v2Addr + ")()\n })\n}" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s2+")\n") - addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s2+")\n") - - // Structs that are indirectly circular. - v3 := indirCir1{nil} - tic2 := indirCir2{nil} - tic3 := indirCir3{&v3} - tic2.ps3 = &tic3 - v3.ps2 = &tic2 - pv3 := &v3 - tic2Addr := fmt.Sprintf("%p", &tic2) - tic3Addr := fmt.Sprintf("%p", &tic3) - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "spew_test.indirCir1" - v3t2 := "spew_test.indirCir2" - v3t3 := "spew_test.indirCir3" - v3s := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + - ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + - ")({\n ps2: (*" + v3t2 + ")(" + tic2Addr + - ")()\n })\n })\n })\n}" - v3s2 := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + - ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + - ")()\n })\n })\n}" - addDumpTest(v3, "("+v3t+") "+v3s+"\n") - addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s2+")\n") - addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s2+")\n") -} - -func addPanicDumpTests() { - // Type that panics in its Stringer interface. - v := panicer(127) - nv := (*panicer)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.panicer" - vs := "(PANIC=test panic)127" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") -} - -func addErrorDumpTests() { - // Type that has a custom Error interface. - v := customError(127) - nv := (*customError)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.customError" - vs := "error: 127" - addDumpTest(v, "("+vt+") "+vs+"\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") - addDumpTest(nv, "(*"+vt+")()\n") -} - -// TestDump executes all of the tests described by dumpTests. -func TestDump(t *testing.T) { - // Setup tests. - addIntDumpTests() - addUintDumpTests() - addBoolDumpTests() - addFloatDumpTests() - addComplexDumpTests() - addArrayDumpTests() - addSliceDumpTests() - addStringDumpTests() - addInterfaceDumpTests() - addMapDumpTests() - addStructDumpTests() - addUintptrDumpTests() - addUnsafePointerDumpTests() - addChanDumpTests() - addFuncDumpTests() - addCircularDumpTests() - addPanicDumpTests() - addErrorDumpTests() - addCgoDumpTests() - - t.Logf("Running %d tests", len(dumpTests)) - for i, test := range dumpTests { - buf := new(bytes.Buffer) - spew.Fdump(buf, test.in) - s := buf.String() - if testFailed(s, test.wants) { - t.Errorf("Dump #%d\n got: %s %s", i, s, stringizeWants(test.wants)) - continue - } - } -} - -func TestDumpSortedKeys(t *testing.T) { - cfg := spew.ConfigState{SortKeys: true} - s := cfg.Sdump(map[int]string{1: "1", 3: "3", 2: "2"}) - expected := "(map[int]string) (len=3) {\n(int) 1: (string) (len=1) " + - "\"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) " + - "(len=1) \"3\"\n" + - "}\n" - if s != expected { - t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) - } - - s = cfg.Sdump(map[stringer]int{"1": 1, "3": 3, "2": 2}) - expected = "(map[spew_test.stringer]int) (len=3) {\n" + - "(spew_test.stringer) (len=1) stringer 1: (int) 1,\n" + - "(spew_test.stringer) (len=1) stringer 2: (int) 2,\n" + - "(spew_test.stringer) (len=1) stringer 3: (int) 3\n" + - "}\n" - if s != expected { - t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) - } - - s = cfg.Sdump(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2}) - expected = "(map[spew_test.pstringer]int) (len=3) {\n" + - "(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n" + - "(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n" + - "(spew_test.pstringer) (len=1) stringer 3: (int) 3\n" + - "}\n" - if spew.UnsafeDisabled { - expected = "(map[spew_test.pstringer]int) (len=3) {\n" + - "(spew_test.pstringer) (len=1) \"1\": (int) 1,\n" + - "(spew_test.pstringer) (len=1) \"2\": (int) 2,\n" + - "(spew_test.pstringer) (len=1) \"3\": (int) 3\n" + - "}\n" - } - if s != expected { - t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) - } - - s = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2}) - expected = "(map[spew_test.customError]int) (len=3) {\n" + - "(spew_test.customError) error: 1: (int) 1,\n" + - "(spew_test.customError) error: 2: (int) 2,\n" + - "(spew_test.customError) error: 3: (int) 3\n" + - "}\n" - if s != expected { - t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) - } - -} diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go deleted file mode 100644 index 108baa5..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2013-2016 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when both cgo is supported and "-tags testcgo" is added to the go test -// command line. This means the cgo tests are only added (and hence run) when -// specifially requested. This configuration is used because spew itself -// does not require cgo to run even though it does handle certain cgo types -// specially. Rather than forcing all clients to require cgo and an external -// C compiler just to run the tests, this scheme makes them optional. -// +build cgo,testcgo - -package spew_test - -import ( - "fmt" - - "github.com/davecgh/go-spew/spew/testdata" -) - -func addCgoDumpTests() { - // C char pointer. - v := testdata.GetCgoCharPointer() - nv := testdata.GetCgoNullCharPointer() - pv := &v - vcAddr := fmt.Sprintf("%p", v) - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "*testdata._Ctype_char" - vs := "116" - addDumpTest(v, "("+vt+")("+vcAddr+")("+vs+")\n") - addDumpTest(pv, "(*"+vt+")("+vAddr+"->"+vcAddr+")("+vs+")\n") - addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+"->"+vcAddr+")("+vs+")\n") - addDumpTest(nv, "("+vt+")()\n") - - // C char array. - v2, v2l, v2c := testdata.GetCgoCharArray() - v2Len := fmt.Sprintf("%d", v2l) - v2Cap := fmt.Sprintf("%d", v2c) - v2t := "[6]testdata._Ctype_char" - v2s := "(len=" + v2Len + " cap=" + v2Cap + ") " + - "{\n 00000000 74 65 73 74 32 00 " + - " |test2.|\n}" - addDumpTest(v2, "("+v2t+") "+v2s+"\n") - - // C unsigned char array. - v3, v3l, v3c := testdata.GetCgoUnsignedCharArray() - v3Len := fmt.Sprintf("%d", v3l) - v3Cap := fmt.Sprintf("%d", v3c) - v3t := "[6]testdata._Ctype_unsignedchar" - v3t2 := "[6]testdata._Ctype_uchar" - v3s := "(len=" + v3Len + " cap=" + v3Cap + ") " + - "{\n 00000000 74 65 73 74 33 00 " + - " |test3.|\n}" - addDumpTest(v3, "("+v3t+") "+v3s+"\n", "("+v3t2+") "+v3s+"\n") - - // C signed char array. - v4, v4l, v4c := testdata.GetCgoSignedCharArray() - v4Len := fmt.Sprintf("%d", v4l) - v4Cap := fmt.Sprintf("%d", v4c) - v4t := "[6]testdata._Ctype_schar" - v4t2 := "testdata._Ctype_schar" - v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + - "{\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 101,\n (" + v4t2 + - ") 115,\n (" + v4t2 + ") 116,\n (" + v4t2 + ") 52,\n (" + v4t2 + - ") 0\n}" - addDumpTest(v4, "("+v4t+") "+v4s+"\n") - - // C uint8_t array. - v5, v5l, v5c := testdata.GetCgoUint8tArray() - v5Len := fmt.Sprintf("%d", v5l) - v5Cap := fmt.Sprintf("%d", v5c) - v5t := "[6]testdata._Ctype_uint8_t" - v5t2 := "[6]testdata._Ctype_uchar" - v5s := "(len=" + v5Len + " cap=" + v5Cap + ") " + - "{\n 00000000 74 65 73 74 35 00 " + - " |test5.|\n}" - addDumpTest(v5, "("+v5t+") "+v5s+"\n", "("+v5t2+") "+v5s+"\n") - - // C typedefed unsigned char array. - v6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray() - v6Len := fmt.Sprintf("%d", v6l) - v6Cap := fmt.Sprintf("%d", v6c) - v6t := "[6]testdata._Ctype_custom_uchar_t" - v6t2 := "[6]testdata._Ctype_uchar" - v6s := "(len=" + v6Len + " cap=" + v6Cap + ") " + - "{\n 00000000 74 65 73 74 36 00 " + - " |test6.|\n}" - addDumpTest(v6, "("+v6t+") "+v6s+"\n", "("+v6t2+") "+v6s+"\n") -} diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go deleted file mode 100644 index 52a0971..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/dumpnocgo_test.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2013 Dave Collins -// -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when either cgo is not supported or "-tags testcgo" is not added to the go -// test command line. This file intentionally does not setup any cgo tests in -// this scenario. -// +build !cgo !testcgo - -package spew_test - -func addCgoDumpTests() { - // Don't add any tests for cgo since this file is only compiled when - // there should not be any cgo tests. -} diff --git a/vendor/github.com/davecgh/go-spew/spew/example_test.go b/vendor/github.com/davecgh/go-spew/spew/example_test.go deleted file mode 100644 index c6ec8c6..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew_test - -import ( - "fmt" - - "github.com/davecgh/go-spew/spew" -) - -type Flag int - -const ( - flagOne Flag = iota - flagTwo -) - -var flagStrings = map[Flag]string{ - flagOne: "flagOne", - flagTwo: "flagTwo", -} - -func (f Flag) String() string { - if s, ok := flagStrings[f]; ok { - return s - } - return fmt.Sprintf("Unknown flag (%d)", int(f)) -} - -type Bar struct { - data uintptr -} - -type Foo struct { - unexportedField Bar - ExportedField map[interface{}]interface{} -} - -// This example demonstrates how to use Dump to dump variables to stdout. -func ExampleDump() { - // The following package level declarations are assumed for this example: - /* - type Flag int - - const ( - flagOne Flag = iota - flagTwo - ) - - var flagStrings = map[Flag]string{ - flagOne: "flagOne", - flagTwo: "flagTwo", - } - - func (f Flag) String() string { - if s, ok := flagStrings[f]; ok { - return s - } - return fmt.Sprintf("Unknown flag (%d)", int(f)) - } - - type Bar struct { - data uintptr - } - - type Foo struct { - unexportedField Bar - ExportedField map[interface{}]interface{} - } - */ - - // Setup some sample data structures for the example. - bar := Bar{uintptr(0)} - s1 := Foo{bar, map[interface{}]interface{}{"one": true}} - f := Flag(5) - b := []byte{ - 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, - 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, - 0x31, 0x32, - } - - // Dump! - spew.Dump(s1, f, b) - - // Output: - // (spew_test.Foo) { - // unexportedField: (spew_test.Bar) { - // data: (uintptr) - // }, - // ExportedField: (map[interface {}]interface {}) (len=1) { - // (string) (len=3) "one": (bool) true - // } - // } - // (spew_test.Flag) Unknown flag (5) - // ([]uint8) (len=34 cap=34) { - // 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | - // 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| - // 00000020 31 32 |12| - // } - // -} - -// This example demonstrates how to use Printf to display a variable with a -// format string and inline formatting. -func ExamplePrintf() { - // Create a double pointer to a uint 8. - ui8 := uint8(5) - pui8 := &ui8 - ppui8 := &pui8 - - // Create a circular data type. - type circular struct { - ui8 uint8 - c *circular - } - c := circular{ui8: 1} - c.c = &c - - // Print! - spew.Printf("ppui8: %v\n", ppui8) - spew.Printf("circular: %v\n", c) - - // Output: - // ppui8: <**>5 - // circular: {1 <*>{1 <*>}} -} - -// This example demonstrates how to use a ConfigState. -func ExampleConfigState() { - // Modify the indent level of the ConfigState only. The global - // configuration is not modified. - scs := spew.ConfigState{Indent: "\t"} - - // Output using the ConfigState instance. - v := map[string]int{"one": 1} - scs.Printf("v: %v\n", v) - scs.Dump(v) - - // Output: - // v: map[one:1] - // (map[string]int) (len=1) { - // (string) (len=3) "one": (int) 1 - // } -} - -// This example demonstrates how to use ConfigState.Dump to dump variables to -// stdout -func ExampleConfigState_Dump() { - // See the top-level Dump example for details on the types used in this - // example. - - // Create two ConfigState instances with different indentation. - scs := spew.ConfigState{Indent: "\t"} - scs2 := spew.ConfigState{Indent: " "} - - // Setup some sample data structures for the example. - bar := Bar{uintptr(0)} - s1 := Foo{bar, map[interface{}]interface{}{"one": true}} - - // Dump using the ConfigState instances. - scs.Dump(s1) - scs2.Dump(s1) - - // Output: - // (spew_test.Foo) { - // unexportedField: (spew_test.Bar) { - // data: (uintptr) - // }, - // ExportedField: (map[interface {}]interface {}) (len=1) { - // (string) (len=3) "one": (bool) true - // } - // } - // (spew_test.Foo) { - // unexportedField: (spew_test.Bar) { - // data: (uintptr) - // }, - // ExportedField: (map[interface {}]interface {}) (len=1) { - // (string) (len=3) "one": (bool) true - // } - // } - // -} - -// This example demonstrates how to use ConfigState.Printf to display a variable -// with a format string and inline formatting. -func ExampleConfigState_Printf() { - // See the top-level Dump example for details on the types used in this - // example. - - // Create two ConfigState instances and modify the method handling of the - // first ConfigState only. - scs := spew.NewDefaultConfig() - scs2 := spew.NewDefaultConfig() - scs.DisableMethods = true - - // Alternatively - // scs := spew.ConfigState{Indent: " ", DisableMethods: true} - // scs2 := spew.ConfigState{Indent: " "} - - // This is of type Flag which implements a Stringer and has raw value 1. - f := flagTwo - - // Dump using the ConfigState instances. - scs.Printf("f: %v\n", f) - scs2.Printf("f: %v\n", f) - - // Output: - // f: 1 - // f: flagTwo -} diff --git a/vendor/github.com/davecgh/go-spew/spew/format_test.go b/vendor/github.com/davecgh/go-spew/spew/format_test.go deleted file mode 100644 index 87ee965..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/format_test.go +++ /dev/null @@ -1,1558 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* -Test Summary: -NOTE: For each test, a nil pointer, a single pointer and double pointer to the -base test element are also tested to ensure proper indirection across all types. - -- Max int8, int16, int32, int64, int -- Max uint8, uint16, uint32, uint64, uint -- Boolean true and false -- Standard complex64 and complex128 -- Array containing standard ints -- Array containing type with custom formatter on pointer receiver only -- Array containing interfaces -- Slice containing standard float32 values -- Slice containing type with custom formatter on pointer receiver only -- Slice containing interfaces -- Nil slice -- Standard string -- Nil interface -- Sub-interface -- Map with string keys and int vals -- Map with custom formatter type on pointer receiver only keys and vals -- Map with interface keys and values -- Map with nil interface value -- Struct with primitives -- Struct that contains another struct -- Struct that contains custom type with Stringer pointer interface via both - exported and unexported fields -- Struct that contains embedded struct and field to same struct -- Uintptr to 0 (null pointer) -- Uintptr address of real variable -- Unsafe.Pointer to 0 (null pointer) -- Unsafe.Pointer to address of real variable -- Nil channel -- Standard int channel -- Function with no params and no returns -- Function with param and no returns -- Function with multiple params and multiple returns -- Struct that is circular through self referencing -- Structs that are circular through cross referencing -- Structs that are indirectly circular -- Type that panics in its Stringer interface -- Type that has a custom Error interface -- %x passthrough with uint -- %#x passthrough with uint -- %f passthrough with precision -- %f passthrough with width and precision -- %d passthrough with width -- %q passthrough with string -*/ - -package spew_test - -import ( - "bytes" - "fmt" - "testing" - "unsafe" - - "github.com/davecgh/go-spew/spew" -) - -// formatterTest is used to describe a test to be performed against NewFormatter. -type formatterTest struct { - format string - in interface{} - wants []string -} - -// formatterTests houses all of the tests to be performed against NewFormatter. -var formatterTests = make([]formatterTest, 0) - -// addFormatterTest is a helper method to append the passed input and desired -// result to formatterTests. -func addFormatterTest(format string, in interface{}, wants ...string) { - test := formatterTest{format, in, wants} - formatterTests = append(formatterTests, test) -} - -func addIntFormatterTests() { - // Max int8. - v := int8(127) - nv := (*int8)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "int8" - vs := "127" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Max int16. - v2 := int16(32767) - nv2 := (*int16)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "int16" - v2s := "32767" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Max int32. - v3 := int32(2147483647) - nv3 := (*int32)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "int32" - v3s := "2147483647" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - - // Max int64. - v4 := int64(9223372036854775807) - nv4 := (*int64)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "int64" - v4s := "9223372036854775807" - addFormatterTest("%v", v4, v4s) - addFormatterTest("%v", pv4, "<*>"+v4s) - addFormatterTest("%v", &pv4, "<**>"+v4s) - addFormatterTest("%v", nv4, "") - addFormatterTest("%+v", v4, v4s) - addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) - addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%#v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) - addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) - addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") - addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) - addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") - - // Max int. - v5 := int(2147483647) - nv5 := (*int)(nil) - pv5 := &v5 - v5Addr := fmt.Sprintf("%p", pv5) - pv5Addr := fmt.Sprintf("%p", &pv5) - v5t := "int" - v5s := "2147483647" - addFormatterTest("%v", v5, v5s) - addFormatterTest("%v", pv5, "<*>"+v5s) - addFormatterTest("%v", &pv5, "<**>"+v5s) - addFormatterTest("%v", nv5, "") - addFormatterTest("%+v", v5, v5s) - addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s) - addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s) - addFormatterTest("%+v", nv5, "") - addFormatterTest("%#v", v5, "("+v5t+")"+v5s) - addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s) - addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s) - addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") - addFormatterTest("%#+v", v5, "("+v5t+")"+v5s) - addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s) - addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s) - addFormatterTest("%#+v", nv5, "(*"+v5t+")"+"") -} - -func addUintFormatterTests() { - // Max uint8. - v := uint8(255) - nv := (*uint8)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "uint8" - vs := "255" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Max uint16. - v2 := uint16(65535) - nv2 := (*uint16)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uint16" - v2s := "65535" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Max uint32. - v3 := uint32(4294967295) - nv3 := (*uint32)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "uint32" - v3s := "4294967295" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - - // Max uint64. - v4 := uint64(18446744073709551615) - nv4 := (*uint64)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "uint64" - v4s := "18446744073709551615" - addFormatterTest("%v", v4, v4s) - addFormatterTest("%v", pv4, "<*>"+v4s) - addFormatterTest("%v", &pv4, "<**>"+v4s) - addFormatterTest("%v", nv4, "") - addFormatterTest("%+v", v4, v4s) - addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) - addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%#v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) - addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) - addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") - addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) - addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") - - // Max uint. - v5 := uint(4294967295) - nv5 := (*uint)(nil) - pv5 := &v5 - v5Addr := fmt.Sprintf("%p", pv5) - pv5Addr := fmt.Sprintf("%p", &pv5) - v5t := "uint" - v5s := "4294967295" - addFormatterTest("%v", v5, v5s) - addFormatterTest("%v", pv5, "<*>"+v5s) - addFormatterTest("%v", &pv5, "<**>"+v5s) - addFormatterTest("%v", nv5, "") - addFormatterTest("%+v", v5, v5s) - addFormatterTest("%+v", pv5, "<*>("+v5Addr+")"+v5s) - addFormatterTest("%+v", &pv5, "<**>("+pv5Addr+"->"+v5Addr+")"+v5s) - addFormatterTest("%+v", nv5, "") - addFormatterTest("%#v", v5, "("+v5t+")"+v5s) - addFormatterTest("%#v", pv5, "(*"+v5t+")"+v5s) - addFormatterTest("%#v", &pv5, "(**"+v5t+")"+v5s) - addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") - addFormatterTest("%#+v", v5, "("+v5t+")"+v5s) - addFormatterTest("%#+v", pv5, "(*"+v5t+")("+v5Addr+")"+v5s) - addFormatterTest("%#+v", &pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")"+v5s) - addFormatterTest("%#v", nv5, "(*"+v5t+")"+"") -} - -func addBoolFormatterTests() { - // Boolean true. - v := bool(true) - nv := (*bool)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "bool" - vs := "true" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Boolean false. - v2 := bool(false) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "bool" - v2s := "false" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) -} - -func addFloatFormatterTests() { - // Standard float32. - v := float32(3.1415) - nv := (*float32)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "float32" - vs := "3.1415" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Standard float64. - v2 := float64(3.1415926) - nv2 := (*float64)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "float64" - v2s := "3.1415926" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") -} - -func addComplexFormatterTests() { - // Standard complex64. - v := complex(float32(6), -2) - nv := (*complex64)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "complex64" - vs := "(6-2i)" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Standard complex128. - v2 := complex(float64(-6), 2) - nv2 := (*complex128)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "complex128" - v2s := "(-6+2i)" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") -} - -func addArrayFormatterTests() { - // Array containing standard ints. - v := [3]int{1, 2, 3} - nv := (*[3]int)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "[3]int" - vs := "[1 2 3]" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Array containing type with custom formatter on pointer receiver only. - v2 := [3]pstringer{"1", "2", "3"} - nv2 := (*[3]pstringer)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "[3]spew_test.pstringer" - v2sp := "[stringer 1 stringer 2 stringer 3]" - v2s := v2sp - if spew.UnsafeDisabled { - v2s = "[1 2 3]" - } - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2sp) - addFormatterTest("%v", &pv2, "<**>"+v2sp) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2sp) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2sp) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2sp) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2sp) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2sp) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2sp) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Array containing interfaces. - v3 := [3]interface{}{"one", int(2), uint(3)} - nv3 := (*[3]interface{})(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "[3]interface {}" - v3t2 := "string" - v3t3 := "int" - v3t4 := "uint" - v3s := "[one 2 3]" - v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3]" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) - addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") -} - -func addSliceFormatterTests() { - // Slice containing standard float32 values. - v := []float32{3.14, 6.28, 12.56} - nv := (*[]float32)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "[]float32" - vs := "[3.14 6.28 12.56]" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Slice containing type with custom formatter on pointer receiver only. - v2 := []pstringer{"1", "2", "3"} - nv2 := (*[]pstringer)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "[]spew_test.pstringer" - v2s := "[stringer 1 stringer 2 stringer 3]" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Slice containing interfaces. - v3 := []interface{}{"one", int(2), uint(3), nil} - nv3 := (*[]interface{})(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "[]interface {}" - v3t2 := "string" - v3t3 := "int" - v3t4 := "uint" - v3t5 := "interface {}" - v3s := "[one 2 3 ]" - v3s2 := "[(" + v3t2 + ")one (" + v3t3 + ")2 (" + v3t4 + ")3 (" + v3t5 + - ")]" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) - addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") - - // Nil slice. - var v4 []int - nv4 := (*[]int)(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "[]int" - v4s := "" - addFormatterTest("%v", v4, v4s) - addFormatterTest("%v", pv4, "<*>"+v4s) - addFormatterTest("%v", &pv4, "<**>"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%+v", v4, v4s) - addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) - addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%#v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s) - addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s) - addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") - addFormatterTest("%#+v", v4, "("+v4t+")"+v4s) - addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s) - addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") -} - -func addStringFormatterTests() { - // Standard string. - v := "test" - nv := (*string)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "string" - vs := "test" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") -} - -func addInterfaceFormatterTests() { - // Nil interface. - var v interface{} - nv := (*interface{})(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "interface {}" - vs := "" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Sub-interface. - v2 := interface{}(uint16(65535)) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uint16" - v2s := "65535" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) -} - -func addMapFormatterTests() { - // Map with string keys and int vals. - v := map[string]int{"one": 1, "two": 2} - nilMap := map[string]int(nil) - nv := (*map[string]int)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "map[string]int" - vs := "map[one:1 two:2]" - vs2 := "map[two:2 one:1]" - addFormatterTest("%v", v, vs, vs2) - addFormatterTest("%v", pv, "<*>"+vs, "<*>"+vs2) - addFormatterTest("%v", &pv, "<**>"+vs, "<**>"+vs2) - addFormatterTest("%+v", nilMap, "") - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs, vs2) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs, "<*>("+vAddr+")"+vs2) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs, - "<**>("+pvAddr+"->"+vAddr+")"+vs2) - addFormatterTest("%+v", nilMap, "") - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs, "("+vt+")"+vs2) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs, "(*"+vt+")"+vs2) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs, "(**"+vt+")"+vs2) - addFormatterTest("%#v", nilMap, "("+vt+")"+"") - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs, "("+vt+")"+vs2) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs, - "(*"+vt+")("+vAddr+")"+vs2) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs, - "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs2) - addFormatterTest("%#+v", nilMap, "("+vt+")"+"") - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Map with custom formatter type on pointer receiver only keys and vals. - v2 := map[pstringer]pstringer{"one": "1"} - nv2 := (*map[pstringer]pstringer)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "map[spew_test.pstringer]spew_test.pstringer" - v2s := "map[stringer one:stringer 1]" - if spew.UnsafeDisabled { - v2s = "map[one:1]" - } - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Map with interface keys and values. - v3 := map[interface{}]interface{}{"one": 1} - nv3 := (*map[interface{}]interface{})(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "map[interface {}]interface {}" - v3t1 := "string" - v3t2 := "int" - v3s := "map[one:1]" - v3s2 := "map[(" + v3t1 + ")one:(" + v3t2 + ")1]" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s2) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s2) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s2) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s2) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s2) - addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") - - // Map with nil interface value - v4 := map[string]interface{}{"nil": nil} - nv4 := (*map[string]interface{})(nil) - pv4 := &v4 - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "map[string]interface {}" - v4t1 := "interface {}" - v4s := "map[nil:]" - v4s2 := "map[nil:(" + v4t1 + ")]" - addFormatterTest("%v", v4, v4s) - addFormatterTest("%v", pv4, "<*>"+v4s) - addFormatterTest("%v", &pv4, "<**>"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%+v", v4, v4s) - addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s) - addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%#v", v4, "("+v4t+")"+v4s2) - addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s2) - addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s2) - addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") - addFormatterTest("%#+v", v4, "("+v4t+")"+v4s2) - addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s2) - addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s2) - addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") -} - -func addStructFormatterTests() { - // Struct with primitives. - type s1 struct { - a int8 - b uint8 - } - v := s1{127, 255} - nv := (*s1)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.s1" - vt2 := "int8" - vt3 := "uint8" - vs := "{127 255}" - vs2 := "{a:127 b:255}" - vs3 := "{a:(" + vt2 + ")127 b:(" + vt3 + ")255}" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs2) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs2) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs2) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs3) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs3) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs3) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs3) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs3) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs3) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Struct that contains another struct. - type s2 struct { - s1 s1 - b bool - } - v2 := s2{s1{127, 255}, true} - nv2 := (*s2)(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.s2" - v2t2 := "spew_test.s1" - v2t3 := "int8" - v2t4 := "uint8" - v2t5 := "bool" - v2s := "{{127 255} true}" - v2s2 := "{s1:{a:127 b:255} b:true}" - v2s3 := "{s1:(" + v2t2 + "){a:(" + v2t3 + ")127 b:(" + v2t4 + ")255} b:(" + - v2t5 + ")true}" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s2) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s2) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s2) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s3) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s3) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s3) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s3) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s3) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s3) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Struct that contains custom type with Stringer pointer interface via both - // exported and unexported fields. - type s3 struct { - s pstringer - S pstringer - } - v3 := s3{"test", "test2"} - nv3 := (*s3)(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "spew_test.s3" - v3t2 := "spew_test.pstringer" - v3s := "{stringer test stringer test2}" - v3sp := v3s - v3s2 := "{s:stringer test S:stringer test2}" - v3s2p := v3s2 - v3s3 := "{s:(" + v3t2 + ")stringer test S:(" + v3t2 + ")stringer test2}" - v3s3p := v3s3 - if spew.UnsafeDisabled { - v3s = "{test test2}" - v3sp = "{test stringer test2}" - v3s2 = "{s:test S:test2}" - v3s2p = "{s:test S:stringer test2}" - v3s3 = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")test2}" - v3s3p = "{s:(" + v3t2 + ")test S:(" + v3t2 + ")stringer test2}" - } - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3sp) - addFormatterTest("%v", &pv3, "<**>"+v3sp) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%+v", v3, v3s2) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s2p) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s2p) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s3) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s3p) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s3p) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s3) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s3p) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s3p) - addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") - - // Struct that contains embedded struct and field to same struct. - e := embed{"embedstr"} - v4 := embedwrap{embed: &e, e: &e} - nv4 := (*embedwrap)(nil) - pv4 := &v4 - eAddr := fmt.Sprintf("%p", &e) - v4Addr := fmt.Sprintf("%p", pv4) - pv4Addr := fmt.Sprintf("%p", &pv4) - v4t := "spew_test.embedwrap" - v4t2 := "spew_test.embed" - v4t3 := "string" - v4s := "{<*>{embedstr} <*>{embedstr}}" - v4s2 := "{embed:<*>(" + eAddr + "){a:embedstr} e:<*>(" + eAddr + - "){a:embedstr}}" - v4s3 := "{embed:(*" + v4t2 + "){a:(" + v4t3 + ")embedstr} e:(*" + v4t2 + - "){a:(" + v4t3 + ")embedstr}}" - v4s4 := "{embed:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + - ")embedstr} e:(*" + v4t2 + ")(" + eAddr + "){a:(" + v4t3 + ")embedstr}}" - addFormatterTest("%v", v4, v4s) - addFormatterTest("%v", pv4, "<*>"+v4s) - addFormatterTest("%v", &pv4, "<**>"+v4s) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%+v", v4, v4s2) - addFormatterTest("%+v", pv4, "<*>("+v4Addr+")"+v4s2) - addFormatterTest("%+v", &pv4, "<**>("+pv4Addr+"->"+v4Addr+")"+v4s2) - addFormatterTest("%+v", nv4, "") - addFormatterTest("%#v", v4, "("+v4t+")"+v4s3) - addFormatterTest("%#v", pv4, "(*"+v4t+")"+v4s3) - addFormatterTest("%#v", &pv4, "(**"+v4t+")"+v4s3) - addFormatterTest("%#v", nv4, "(*"+v4t+")"+"") - addFormatterTest("%#+v", v4, "("+v4t+")"+v4s4) - addFormatterTest("%#+v", pv4, "(*"+v4t+")("+v4Addr+")"+v4s4) - addFormatterTest("%#+v", &pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")"+v4s4) - addFormatterTest("%#+v", nv4, "(*"+v4t+")"+"") -} - -func addUintptrFormatterTests() { - // Null pointer. - v := uintptr(0) - nv := (*uintptr)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "uintptr" - vs := "" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Address of real variable. - i := 1 - v2 := uintptr(unsafe.Pointer(&i)) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "uintptr" - v2s := fmt.Sprintf("%p", &i) - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) -} - -func addUnsafePointerFormatterTests() { - // Null pointer. - v := unsafe.Pointer(nil) - nv := (*unsafe.Pointer)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "unsafe.Pointer" - vs := "" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Address of real variable. - i := 1 - v2 := unsafe.Pointer(&i) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "unsafe.Pointer" - v2s := fmt.Sprintf("%p", &i) - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) -} - -func addChanFormatterTests() { - // Nil channel. - var v chan int - pv := &v - nv := (*chan int)(nil) - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "chan int" - vs := "" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Real channel. - v2 := make(chan int) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "chan int" - v2s := fmt.Sprintf("%p", v2) - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) -} - -func addFuncFormatterTests() { - // Function with no params and no returns. - v := addIntFormatterTests - nv := (*func())(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "func()" - vs := fmt.Sprintf("%p", v) - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") - - // Function with param and no returns. - v2 := TestFormatter - nv2 := (*func(*testing.T))(nil) - pv2 := &v2 - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "func(*testing.T)" - v2s := fmt.Sprintf("%p", v2) - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s) - addFormatterTest("%v", &pv2, "<**>"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%+v", v2, v2s) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%+v", nv2, "") - addFormatterTest("%#v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s) - addFormatterTest("%#v", nv2, "(*"+v2t+")"+"") - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s) - addFormatterTest("%#+v", nv2, "(*"+v2t+")"+"") - - // Function with multiple params and multiple returns. - var v3 = func(i int, s string) (b bool, err error) { - return true, nil - } - nv3 := (*func(int, string) (bool, error))(nil) - pv3 := &v3 - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "func(int, string) (bool, error)" - v3s := fmt.Sprintf("%p", v3) - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s) - addFormatterTest("%v", &pv3, "<**>"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%+v", v3, v3s) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%+v", nv3, "") - addFormatterTest("%#v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s) - addFormatterTest("%#v", nv3, "(*"+v3t+")"+"") - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s) - addFormatterTest("%#+v", nv3, "(*"+v3t+")"+"") -} - -func addCircularFormatterTests() { - // Struct that is circular through self referencing. - type circular struct { - c *circular - } - v := circular{nil} - v.c = &v - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.circular" - vs := "{<*>{<*>}}" - vs2 := "{<*>}" - vs3 := "{c:<*>(" + vAddr + "){c:<*>(" + vAddr + ")}}" - vs4 := "{c:<*>(" + vAddr + ")}" - vs5 := "{c:(*" + vt + "){c:(*" + vt + ")}}" - vs6 := "{c:(*" + vt + ")}" - vs7 := "{c:(*" + vt + ")(" + vAddr + "){c:(*" + vt + ")(" + vAddr + - ")}}" - vs8 := "{c:(*" + vt + ")(" + vAddr + ")}" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs2) - addFormatterTest("%v", &pv, "<**>"+vs2) - addFormatterTest("%+v", v, vs3) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs4) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs4) - addFormatterTest("%#v", v, "("+vt+")"+vs5) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs6) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs6) - addFormatterTest("%#+v", v, "("+vt+")"+vs7) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs8) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs8) - - // Structs that are circular through cross referencing. - v2 := xref1{nil} - ts2 := xref2{&v2} - v2.ps2 = &ts2 - pv2 := &v2 - ts2Addr := fmt.Sprintf("%p", &ts2) - v2Addr := fmt.Sprintf("%p", pv2) - pv2Addr := fmt.Sprintf("%p", &pv2) - v2t := "spew_test.xref1" - v2t2 := "spew_test.xref2" - v2s := "{<*>{<*>{<*>}}}" - v2s2 := "{<*>{<*>}}" - v2s3 := "{ps2:<*>(" + ts2Addr + "){ps1:<*>(" + v2Addr + "){ps2:<*>(" + - ts2Addr + ")}}}" - v2s4 := "{ps2:<*>(" + ts2Addr + "){ps1:<*>(" + v2Addr + ")}}" - v2s5 := "{ps2:(*" + v2t2 + "){ps1:(*" + v2t + "){ps2:(*" + v2t2 + - ")}}}" - v2s6 := "{ps2:(*" + v2t2 + "){ps1:(*" + v2t + ")}}" - v2s7 := "{ps2:(*" + v2t2 + ")(" + ts2Addr + "){ps1:(*" + v2t + - ")(" + v2Addr + "){ps2:(*" + v2t2 + ")(" + ts2Addr + - ")}}}" - v2s8 := "{ps2:(*" + v2t2 + ")(" + ts2Addr + "){ps1:(*" + v2t + - ")(" + v2Addr + ")}}" - addFormatterTest("%v", v2, v2s) - addFormatterTest("%v", pv2, "<*>"+v2s2) - addFormatterTest("%v", &pv2, "<**>"+v2s2) - addFormatterTest("%+v", v2, v2s3) - addFormatterTest("%+v", pv2, "<*>("+v2Addr+")"+v2s4) - addFormatterTest("%+v", &pv2, "<**>("+pv2Addr+"->"+v2Addr+")"+v2s4) - addFormatterTest("%#v", v2, "("+v2t+")"+v2s5) - addFormatterTest("%#v", pv2, "(*"+v2t+")"+v2s6) - addFormatterTest("%#v", &pv2, "(**"+v2t+")"+v2s6) - addFormatterTest("%#+v", v2, "("+v2t+")"+v2s7) - addFormatterTest("%#+v", pv2, "(*"+v2t+")("+v2Addr+")"+v2s8) - addFormatterTest("%#+v", &pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")"+v2s8) - - // Structs that are indirectly circular. - v3 := indirCir1{nil} - tic2 := indirCir2{nil} - tic3 := indirCir3{&v3} - tic2.ps3 = &tic3 - v3.ps2 = &tic2 - pv3 := &v3 - tic2Addr := fmt.Sprintf("%p", &tic2) - tic3Addr := fmt.Sprintf("%p", &tic3) - v3Addr := fmt.Sprintf("%p", pv3) - pv3Addr := fmt.Sprintf("%p", &pv3) - v3t := "spew_test.indirCir1" - v3t2 := "spew_test.indirCir2" - v3t3 := "spew_test.indirCir3" - v3s := "{<*>{<*>{<*>{<*>}}}}" - v3s2 := "{<*>{<*>{<*>}}}" - v3s3 := "{ps2:<*>(" + tic2Addr + "){ps3:<*>(" + tic3Addr + "){ps1:<*>(" + - v3Addr + "){ps2:<*>(" + tic2Addr + ")}}}}" - v3s4 := "{ps2:<*>(" + tic2Addr + "){ps3:<*>(" + tic3Addr + "){ps1:<*>(" + - v3Addr + ")}}}" - v3s5 := "{ps2:(*" + v3t2 + "){ps3:(*" + v3t3 + "){ps1:(*" + v3t + - "){ps2:(*" + v3t2 + ")}}}}" - v3s6 := "{ps2:(*" + v3t2 + "){ps3:(*" + v3t3 + "){ps1:(*" + v3t + - ")}}}" - v3s7 := "{ps2:(*" + v3t2 + ")(" + tic2Addr + "){ps3:(*" + v3t3 + ")(" + - tic3Addr + "){ps1:(*" + v3t + ")(" + v3Addr + "){ps2:(*" + v3t2 + - ")(" + tic2Addr + ")}}}}" - v3s8 := "{ps2:(*" + v3t2 + ")(" + tic2Addr + "){ps3:(*" + v3t3 + ")(" + - tic3Addr + "){ps1:(*" + v3t + ")(" + v3Addr + ")}}}" - addFormatterTest("%v", v3, v3s) - addFormatterTest("%v", pv3, "<*>"+v3s2) - addFormatterTest("%v", &pv3, "<**>"+v3s2) - addFormatterTest("%+v", v3, v3s3) - addFormatterTest("%+v", pv3, "<*>("+v3Addr+")"+v3s4) - addFormatterTest("%+v", &pv3, "<**>("+pv3Addr+"->"+v3Addr+")"+v3s4) - addFormatterTest("%#v", v3, "("+v3t+")"+v3s5) - addFormatterTest("%#v", pv3, "(*"+v3t+")"+v3s6) - addFormatterTest("%#v", &pv3, "(**"+v3t+")"+v3s6) - addFormatterTest("%#+v", v3, "("+v3t+")"+v3s7) - addFormatterTest("%#+v", pv3, "(*"+v3t+")("+v3Addr+")"+v3s8) - addFormatterTest("%#+v", &pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")"+v3s8) -} - -func addPanicFormatterTests() { - // Type that panics in its Stringer interface. - v := panicer(127) - nv := (*panicer)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.panicer" - vs := "(PANIC=test panic)127" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") -} - -func addErrorFormatterTests() { - // Type that has a custom Error interface. - v := customError(127) - nv := (*customError)(nil) - pv := &v - vAddr := fmt.Sprintf("%p", pv) - pvAddr := fmt.Sprintf("%p", &pv) - vt := "spew_test.customError" - vs := "error: 127" - addFormatterTest("%v", v, vs) - addFormatterTest("%v", pv, "<*>"+vs) - addFormatterTest("%v", &pv, "<**>"+vs) - addFormatterTest("%v", nv, "") - addFormatterTest("%+v", v, vs) - addFormatterTest("%+v", pv, "<*>("+vAddr+")"+vs) - addFormatterTest("%+v", &pv, "<**>("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%+v", nv, "") - addFormatterTest("%#v", v, "("+vt+")"+vs) - addFormatterTest("%#v", pv, "(*"+vt+")"+vs) - addFormatterTest("%#v", &pv, "(**"+vt+")"+vs) - addFormatterTest("%#v", nv, "(*"+vt+")"+"") - addFormatterTest("%#+v", v, "("+vt+")"+vs) - addFormatterTest("%#+v", pv, "(*"+vt+")("+vAddr+")"+vs) - addFormatterTest("%#+v", &pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")"+vs) - addFormatterTest("%#+v", nv, "(*"+vt+")"+"") -} - -func addPassthroughFormatterTests() { - // %x passthrough with uint. - v := uint(4294967295) - pv := &v - vAddr := fmt.Sprintf("%x", pv) - pvAddr := fmt.Sprintf("%x", &pv) - vs := "ffffffff" - addFormatterTest("%x", v, vs) - addFormatterTest("%x", pv, vAddr) - addFormatterTest("%x", &pv, pvAddr) - - // %#x passthrough with uint. - v2 := int(2147483647) - pv2 := &v2 - v2Addr := fmt.Sprintf("%#x", pv2) - pv2Addr := fmt.Sprintf("%#x", &pv2) - v2s := "0x7fffffff" - addFormatterTest("%#x", v2, v2s) - addFormatterTest("%#x", pv2, v2Addr) - addFormatterTest("%#x", &pv2, pv2Addr) - - // %f passthrough with precision. - addFormatterTest("%.2f", 3.1415, "3.14") - addFormatterTest("%.3f", 3.1415, "3.142") - addFormatterTest("%.4f", 3.1415, "3.1415") - - // %f passthrough with width and precision. - addFormatterTest("%5.2f", 3.1415, " 3.14") - addFormatterTest("%6.3f", 3.1415, " 3.142") - addFormatterTest("%7.4f", 3.1415, " 3.1415") - - // %d passthrough with width. - addFormatterTest("%3d", 127, "127") - addFormatterTest("%4d", 127, " 127") - addFormatterTest("%5d", 127, " 127") - - // %q passthrough with string. - addFormatterTest("%q", "test", "\"test\"") -} - -// TestFormatter executes all of the tests described by formatterTests. -func TestFormatter(t *testing.T) { - // Setup tests. - addIntFormatterTests() - addUintFormatterTests() - addBoolFormatterTests() - addFloatFormatterTests() - addComplexFormatterTests() - addArrayFormatterTests() - addSliceFormatterTests() - addStringFormatterTests() - addInterfaceFormatterTests() - addMapFormatterTests() - addStructFormatterTests() - addUintptrFormatterTests() - addUnsafePointerFormatterTests() - addChanFormatterTests() - addFuncFormatterTests() - addCircularFormatterTests() - addPanicFormatterTests() - addErrorFormatterTests() - addPassthroughFormatterTests() - - t.Logf("Running %d tests", len(formatterTests)) - for i, test := range formatterTests { - buf := new(bytes.Buffer) - spew.Fprintf(buf, test.format, test.in) - s := buf.String() - if testFailed(s, test.wants) { - t.Errorf("Formatter #%d format: %s got: %s %s", i, test.format, s, - stringizeWants(test.wants)) - continue - } - } -} - -type testStruct struct { - x int -} - -func (ts testStruct) String() string { - return fmt.Sprintf("ts.%d", ts.x) -} - -type testStructP struct { - x int -} - -func (ts *testStructP) String() string { - return fmt.Sprintf("ts.%d", ts.x) -} - -func TestPrintSortedKeys(t *testing.T) { - cfg := spew.ConfigState{SortKeys: true} - s := cfg.Sprint(map[int]string{1: "1", 3: "3", 2: "2"}) - expected := "map[1:1 2:2 3:3]" - if s != expected { - t.Errorf("Sorted keys mismatch 1:\n %v %v", s, expected) - } - - s = cfg.Sprint(map[stringer]int{"1": 1, "3": 3, "2": 2}) - expected = "map[stringer 1:1 stringer 2:2 stringer 3:3]" - if s != expected { - t.Errorf("Sorted keys mismatch 2:\n %v %v", s, expected) - } - - s = cfg.Sprint(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2}) - expected = "map[stringer 1:1 stringer 2:2 stringer 3:3]" - if spew.UnsafeDisabled { - expected = "map[1:1 2:2 3:3]" - } - if s != expected { - t.Errorf("Sorted keys mismatch 3:\n %v %v", s, expected) - } - - s = cfg.Sprint(map[testStruct]int{{1}: 1, {3}: 3, {2}: 2}) - expected = "map[ts.1:1 ts.2:2 ts.3:3]" - if s != expected { - t.Errorf("Sorted keys mismatch 4:\n %v %v", s, expected) - } - - if !spew.UnsafeDisabled { - s = cfg.Sprint(map[testStructP]int{{1}: 1, {3}: 3, {2}: 2}) - expected = "map[ts.1:1 ts.2:2 ts.3:3]" - if s != expected { - t.Errorf("Sorted keys mismatch 5:\n %v %v", s, expected) - } - } - - s = cfg.Sprint(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2}) - expected = "map[error: 1:1 error: 2:2 error: 3:3]" - if s != expected { - t.Errorf("Sorted keys mismatch 6:\n %v %v", s, expected) - } -} diff --git a/vendor/github.com/davecgh/go-spew/spew/internal_test.go b/vendor/github.com/davecgh/go-spew/spew/internal_test.go deleted file mode 100644 index e312b4f..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/internal_test.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* -This test file is part of the spew package rather than than the spew_test -package because it needs access to internals to properly test certain cases -which are not possible via the public interface since they should never happen. -*/ - -package spew - -import ( - "bytes" - "reflect" - "testing" -) - -// dummyFmtState implements a fake fmt.State to use for testing invalid -// reflect.Value handling. This is necessary because the fmt package catches -// invalid values before invoking the formatter on them. -type dummyFmtState struct { - bytes.Buffer -} - -func (dfs *dummyFmtState) Flag(f int) bool { - return f == int('+') -} - -func (dfs *dummyFmtState) Precision() (int, bool) { - return 0, false -} - -func (dfs *dummyFmtState) Width() (int, bool) { - return 0, false -} - -// TestInvalidReflectValue ensures the dump and formatter code handles an -// invalid reflect value properly. This needs access to internal state since it -// should never happen in real code and therefore can't be tested via the public -// API. -func TestInvalidReflectValue(t *testing.T) { - i := 1 - - // Dump invalid reflect value. - v := new(reflect.Value) - buf := new(bytes.Buffer) - d := dumpState{w: buf, cs: &Config} - d.dump(*v) - s := buf.String() - want := "" - if s != want { - t.Errorf("InvalidReflectValue #%d\n got: %s want: %s", i, s, want) - } - i++ - - // Formatter invalid reflect value. - buf2 := new(dummyFmtState) - f := formatState{value: *v, cs: &Config, fs: buf2} - f.format(*v) - s = buf2.String() - want = "" - if s != want { - t.Errorf("InvalidReflectValue #%d got: %s want: %s", i, s, want) - } -} - -// SortValues makes the internal sortValues function available to the test -// package. -func SortValues(values []reflect.Value, cs *ConfigState) { - sortValues(values, cs) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go b/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go deleted file mode 100644 index 80dc221..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2013-2016 Dave Collins - -// Permission to use, copy, modify, and distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. - -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -// NOTE: Due to the following build constraints, this file will only be compiled -// when the code is not running on Google App Engine, compiled by GopherJS, and -// "-tags safe" is not added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// +build !js,!appengine,!safe,!disableunsafe,go1.4 - -/* -This test file is part of the spew package rather than than the spew_test -package because it needs access to internals to properly test certain cases -which are not possible via the public interface since they should never happen. -*/ - -package spew - -import ( - "bytes" - "reflect" - "testing" -) - -// changeKind uses unsafe to intentionally change the kind of a reflect.Value to -// the maximum kind value which does not exist. This is needed to test the -// fallback code which punts to the standard fmt library for new types that -// might get added to the language. -func changeKind(v *reflect.Value, readOnly bool) { - flags := flagField(v) - if readOnly { - *flags |= flagRO - } else { - *flags &^= flagRO - } - *flags |= flagKindMask -} - -// TestAddedReflectValue tests functionaly of the dump and formatter code which -// falls back to the standard fmt library for new types that might get added to -// the language. -func TestAddedReflectValue(t *testing.T) { - i := 1 - - // Dump using a reflect.Value that is exported. - v := reflect.ValueOf(int8(5)) - changeKind(&v, false) - buf := new(bytes.Buffer) - d := dumpState{w: buf, cs: &Config} - d.dump(v) - s := buf.String() - want := "(int8) 5" - if s != want { - t.Errorf("TestAddedReflectValue #%d\n got: %s want: %s", i, s, want) - } - i++ - - // Dump using a reflect.Value that is not exported. - changeKind(&v, true) - buf.Reset() - d.dump(v) - s = buf.String() - want = "(int8) " - if s != want { - t.Errorf("TestAddedReflectValue #%d\n got: %s want: %s", i, s, want) - } - i++ - - // Formatter using a reflect.Value that is exported. - changeKind(&v, false) - buf2 := new(dummyFmtState) - f := formatState{value: v, cs: &Config, fs: buf2} - f.format(v) - s = buf2.String() - want = "5" - if s != want { - t.Errorf("TestAddedReflectValue #%d got: %s want: %s", i, s, want) - } - i++ - - // Formatter using a reflect.Value that is not exported. - changeKind(&v, true) - buf2.Reset() - f = formatState{value: v, cs: &Config, fs: buf2} - f.format(v) - s = buf2.String() - want = "" - if s != want { - t.Errorf("TestAddedReflectValue #%d got: %s want: %s", i, s, want) - } -} diff --git a/vendor/github.com/davecgh/go-spew/spew/spew_test.go b/vendor/github.com/davecgh/go-spew/spew/spew_test.go deleted file mode 100644 index b70466c..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/spew_test.go +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2013-2016 Dave Collins - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -package spew_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "testing" - - "github.com/davecgh/go-spew/spew" -) - -// spewFunc is used to identify which public function of the spew package or -// ConfigState a test applies to. -type spewFunc int - -const ( - fCSFdump spewFunc = iota - fCSFprint - fCSFprintf - fCSFprintln - fCSPrint - fCSPrintln - fCSSdump - fCSSprint - fCSSprintf - fCSSprintln - fCSErrorf - fCSNewFormatter - fErrorf - fFprint - fFprintln - fPrint - fPrintln - fSdump - fSprint - fSprintf - fSprintln -) - -// Map of spewFunc values to names for pretty printing. -var spewFuncStrings = map[spewFunc]string{ - fCSFdump: "ConfigState.Fdump", - fCSFprint: "ConfigState.Fprint", - fCSFprintf: "ConfigState.Fprintf", - fCSFprintln: "ConfigState.Fprintln", - fCSSdump: "ConfigState.Sdump", - fCSPrint: "ConfigState.Print", - fCSPrintln: "ConfigState.Println", - fCSSprint: "ConfigState.Sprint", - fCSSprintf: "ConfigState.Sprintf", - fCSSprintln: "ConfigState.Sprintln", - fCSErrorf: "ConfigState.Errorf", - fCSNewFormatter: "ConfigState.NewFormatter", - fErrorf: "spew.Errorf", - fFprint: "spew.Fprint", - fFprintln: "spew.Fprintln", - fPrint: "spew.Print", - fPrintln: "spew.Println", - fSdump: "spew.Sdump", - fSprint: "spew.Sprint", - fSprintf: "spew.Sprintf", - fSprintln: "spew.Sprintln", -} - -func (f spewFunc) String() string { - if s, ok := spewFuncStrings[f]; ok { - return s - } - return fmt.Sprintf("Unknown spewFunc (%d)", int(f)) -} - -// spewTest is used to describe a test to be performed against the public -// functions of the spew package or ConfigState. -type spewTest struct { - cs *spew.ConfigState - f spewFunc - format string - in interface{} - want string -} - -// spewTests houses the tests to be performed against the public functions of -// the spew package and ConfigState. -// -// These tests are only intended to ensure the public functions are exercised -// and are intentionally not exhaustive of types. The exhaustive type -// tests are handled in the dump and format tests. -var spewTests []spewTest - -// redirStdout is a helper function to return the standard output from f as a -// byte slice. -func redirStdout(f func()) ([]byte, error) { - tempFile, err := ioutil.TempFile("", "ss-test") - if err != nil { - return nil, err - } - fileName := tempFile.Name() - defer os.Remove(fileName) // Ignore error - - origStdout := os.Stdout - os.Stdout = tempFile - f() - os.Stdout = origStdout - tempFile.Close() - - return ioutil.ReadFile(fileName) -} - -func initSpewTests() { - // Config states with various settings. - scsDefault := spew.NewDefaultConfig() - scsNoMethods := &spew.ConfigState{Indent: " ", DisableMethods: true} - scsNoPmethods := &spew.ConfigState{Indent: " ", DisablePointerMethods: true} - scsMaxDepth := &spew.ConfigState{Indent: " ", MaxDepth: 1} - scsContinue := &spew.ConfigState{Indent: " ", ContinueOnMethod: true} - scsNoPtrAddr := &spew.ConfigState{DisablePointerAddresses: true} - scsNoCap := &spew.ConfigState{DisableCapacities: true} - - // Variables for tests on types which implement Stringer interface with and - // without a pointer receiver. - ts := stringer("test") - tps := pstringer("test") - - type ptrTester struct { - s *struct{} - } - tptr := &ptrTester{s: &struct{}{}} - - // depthTester is used to test max depth handling for structs, array, slices - // and maps. - type depthTester struct { - ic indirCir1 - arr [1]string - slice []string - m map[string]int - } - dt := depthTester{indirCir1{nil}, [1]string{"arr"}, []string{"slice"}, - map[string]int{"one": 1}} - - // Variable for tests on types which implement error interface. - te := customError(10) - - spewTests = []spewTest{ - {scsDefault, fCSFdump, "", int8(127), "(int8) 127\n"}, - {scsDefault, fCSFprint, "", int16(32767), "32767"}, - {scsDefault, fCSFprintf, "%v", int32(2147483647), "2147483647"}, - {scsDefault, fCSFprintln, "", int(2147483647), "2147483647\n"}, - {scsDefault, fCSPrint, "", int64(9223372036854775807), "9223372036854775807"}, - {scsDefault, fCSPrintln, "", uint8(255), "255\n"}, - {scsDefault, fCSSdump, "", uint8(64), "(uint8) 64\n"}, - {scsDefault, fCSSprint, "", complex(1, 2), "(1+2i)"}, - {scsDefault, fCSSprintf, "%v", complex(float32(3), 4), "(3+4i)"}, - {scsDefault, fCSSprintln, "", complex(float64(5), 6), "(5+6i)\n"}, - {scsDefault, fCSErrorf, "%#v", uint16(65535), "(uint16)65535"}, - {scsDefault, fCSNewFormatter, "%v", uint32(4294967295), "4294967295"}, - {scsDefault, fErrorf, "%v", uint64(18446744073709551615), "18446744073709551615"}, - {scsDefault, fFprint, "", float32(3.14), "3.14"}, - {scsDefault, fFprintln, "", float64(6.28), "6.28\n"}, - {scsDefault, fPrint, "", true, "true"}, - {scsDefault, fPrintln, "", false, "false\n"}, - {scsDefault, fSdump, "", complex(-10, -20), "(complex128) (-10-20i)\n"}, - {scsDefault, fSprint, "", complex(-1, -2), "(-1-2i)"}, - {scsDefault, fSprintf, "%v", complex(float32(-3), -4), "(-3-4i)"}, - {scsDefault, fSprintln, "", complex(float64(-5), -6), "(-5-6i)\n"}, - {scsNoMethods, fCSFprint, "", ts, "test"}, - {scsNoMethods, fCSFprint, "", &ts, "<*>test"}, - {scsNoMethods, fCSFprint, "", tps, "test"}, - {scsNoMethods, fCSFprint, "", &tps, "<*>test"}, - {scsNoPmethods, fCSFprint, "", ts, "stringer test"}, - {scsNoPmethods, fCSFprint, "", &ts, "<*>stringer test"}, - {scsNoPmethods, fCSFprint, "", tps, "test"}, - {scsNoPmethods, fCSFprint, "", &tps, "<*>stringer test"}, - {scsMaxDepth, fCSFprint, "", dt, "{{} [] [] map[]}"}, - {scsMaxDepth, fCSFdump, "", dt, "(spew_test.depthTester) {\n" + - " ic: (spew_test.indirCir1) {\n \n },\n" + - " arr: ([1]string) (len=1 cap=1) {\n \n },\n" + - " slice: ([]string) (len=1 cap=1) {\n \n },\n" + - " m: (map[string]int) (len=1) {\n \n }\n}\n"}, - {scsContinue, fCSFprint, "", ts, "(stringer test) test"}, - {scsContinue, fCSFdump, "", ts, "(spew_test.stringer) " + - "(len=4) (stringer test) \"test\"\n"}, - {scsContinue, fCSFprint, "", te, "(error: 10) 10"}, - {scsContinue, fCSFdump, "", te, "(spew_test.customError) " + - "(error: 10) 10\n"}, - {scsNoPtrAddr, fCSFprint, "", tptr, "<*>{<*>{}}"}, - {scsNoPtrAddr, fCSSdump, "", tptr, "(*spew_test.ptrTester)({\ns: (*struct {})({\n})\n})\n"}, - {scsNoCap, fCSSdump, "", make([]string, 0, 10), "([]string) {\n}\n"}, - {scsNoCap, fCSSdump, "", make([]string, 1, 10), "([]string) (len=1) {\n(string) \"\"\n}\n"}, - } -} - -// TestSpew executes all of the tests described by spewTests. -func TestSpew(t *testing.T) { - initSpewTests() - - t.Logf("Running %d tests", len(spewTests)) - for i, test := range spewTests { - buf := new(bytes.Buffer) - switch test.f { - case fCSFdump: - test.cs.Fdump(buf, test.in) - - case fCSFprint: - test.cs.Fprint(buf, test.in) - - case fCSFprintf: - test.cs.Fprintf(buf, test.format, test.in) - - case fCSFprintln: - test.cs.Fprintln(buf, test.in) - - case fCSPrint: - b, err := redirStdout(func() { test.cs.Print(test.in) }) - if err != nil { - t.Errorf("%v #%d %v", test.f, i, err) - continue - } - buf.Write(b) - - case fCSPrintln: - b, err := redirStdout(func() { test.cs.Println(test.in) }) - if err != nil { - t.Errorf("%v #%d %v", test.f, i, err) - continue - } - buf.Write(b) - - case fCSSdump: - str := test.cs.Sdump(test.in) - buf.WriteString(str) - - case fCSSprint: - str := test.cs.Sprint(test.in) - buf.WriteString(str) - - case fCSSprintf: - str := test.cs.Sprintf(test.format, test.in) - buf.WriteString(str) - - case fCSSprintln: - str := test.cs.Sprintln(test.in) - buf.WriteString(str) - - case fCSErrorf: - err := test.cs.Errorf(test.format, test.in) - buf.WriteString(err.Error()) - - case fCSNewFormatter: - fmt.Fprintf(buf, test.format, test.cs.NewFormatter(test.in)) - - case fErrorf: - err := spew.Errorf(test.format, test.in) - buf.WriteString(err.Error()) - - case fFprint: - spew.Fprint(buf, test.in) - - case fFprintln: - spew.Fprintln(buf, test.in) - - case fPrint: - b, err := redirStdout(func() { spew.Print(test.in) }) - if err != nil { - t.Errorf("%v #%d %v", test.f, i, err) - continue - } - buf.Write(b) - - case fPrintln: - b, err := redirStdout(func() { spew.Println(test.in) }) - if err != nil { - t.Errorf("%v #%d %v", test.f, i, err) - continue - } - buf.Write(b) - - case fSdump: - str := spew.Sdump(test.in) - buf.WriteString(str) - - case fSprint: - str := spew.Sprint(test.in) - buf.WriteString(str) - - case fSprintf: - str := spew.Sprintf(test.format, test.in) - buf.WriteString(str) - - case fSprintln: - str := spew.Sprintln(test.in) - buf.WriteString(str) - - default: - t.Errorf("%v #%d unrecognized function", test.f, i) - continue - } - s := buf.String() - if test.want != s { - t.Errorf("ConfigState #%d\n got: %s want: %s", i, s, test.want) - continue - } - } -} diff --git a/vendor/github.com/davecgh/go-spew/test_coverage.txt b/vendor/github.com/davecgh/go-spew/test_coverage.txt deleted file mode 100644 index 2cd087a..0000000 --- a/vendor/github.com/davecgh/go-spew/test_coverage.txt +++ /dev/null @@ -1,61 +0,0 @@ - -github.com/davecgh/go-spew/spew/dump.go dumpState.dump 100.00% (88/88) -github.com/davecgh/go-spew/spew/format.go formatState.format 100.00% (82/82) -github.com/davecgh/go-spew/spew/format.go formatState.formatPtr 100.00% (52/52) -github.com/davecgh/go-spew/spew/dump.go dumpState.dumpPtr 100.00% (44/44) -github.com/davecgh/go-spew/spew/dump.go dumpState.dumpSlice 100.00% (39/39) -github.com/davecgh/go-spew/spew/common.go handleMethods 100.00% (30/30) -github.com/davecgh/go-spew/spew/common.go printHexPtr 100.00% (18/18) -github.com/davecgh/go-spew/spew/common.go unsafeReflectValue 100.00% (13/13) -github.com/davecgh/go-spew/spew/format.go formatState.constructOrigFormat 100.00% (12/12) -github.com/davecgh/go-spew/spew/dump.go fdump 100.00% (11/11) -github.com/davecgh/go-spew/spew/format.go formatState.Format 100.00% (11/11) -github.com/davecgh/go-spew/spew/common.go init 100.00% (10/10) -github.com/davecgh/go-spew/spew/common.go printComplex 100.00% (9/9) -github.com/davecgh/go-spew/spew/common.go valuesSorter.Less 100.00% (8/8) -github.com/davecgh/go-spew/spew/format.go formatState.buildDefaultFormat 100.00% (7/7) -github.com/davecgh/go-spew/spew/format.go formatState.unpackValue 100.00% (5/5) -github.com/davecgh/go-spew/spew/dump.go dumpState.indent 100.00% (4/4) -github.com/davecgh/go-spew/spew/common.go catchPanic 100.00% (4/4) -github.com/davecgh/go-spew/spew/config.go ConfigState.convertArgs 100.00% (4/4) -github.com/davecgh/go-spew/spew/spew.go convertArgs 100.00% (4/4) -github.com/davecgh/go-spew/spew/format.go newFormatter 100.00% (3/3) -github.com/davecgh/go-spew/spew/dump.go Sdump 100.00% (3/3) -github.com/davecgh/go-spew/spew/common.go printBool 100.00% (3/3) -github.com/davecgh/go-spew/spew/common.go sortValues 100.00% (3/3) -github.com/davecgh/go-spew/spew/config.go ConfigState.Sdump 100.00% (3/3) -github.com/davecgh/go-spew/spew/dump.go dumpState.unpackValue 100.00% (3/3) -github.com/davecgh/go-spew/spew/spew.go Printf 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Println 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Sprint 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Sprintf 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Sprintln 100.00% (1/1) -github.com/davecgh/go-spew/spew/common.go printFloat 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go NewDefaultConfig 100.00% (1/1) -github.com/davecgh/go-spew/spew/common.go printInt 100.00% (1/1) -github.com/davecgh/go-spew/spew/common.go printUint 100.00% (1/1) -github.com/davecgh/go-spew/spew/common.go valuesSorter.Len 100.00% (1/1) -github.com/davecgh/go-spew/spew/common.go valuesSorter.Swap 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Errorf 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Fprint 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Fprintf 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Fprintln 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Print 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Printf 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Println 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Sprint 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Sprintf 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Sprintln 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.NewFormatter 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Fdump 100.00% (1/1) -github.com/davecgh/go-spew/spew/config.go ConfigState.Dump 100.00% (1/1) -github.com/davecgh/go-spew/spew/dump.go Fdump 100.00% (1/1) -github.com/davecgh/go-spew/spew/dump.go Dump 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Fprintln 100.00% (1/1) -github.com/davecgh/go-spew/spew/format.go NewFormatter 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Errorf 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Fprint 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Fprintf 100.00% (1/1) -github.com/davecgh/go-spew/spew/spew.go Print 100.00% (1/1) -github.com/davecgh/go-spew/spew ------------------------------- 100.00% (505/505) - diff --git a/vendor/github.com/fluent/fluent-bit-go/README.md b/vendor/github.com/fluent/fluent-bit-go/README.md deleted file mode 100644 index 769b6e8..0000000 --- a/vendor/github.com/fluent/fluent-bit-go/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Fluent Bit Go! - -This repository contains Go packages that allows to create [Fluent Bit][fluent-bit] plugins. At the moment it only supports the creation of _Output_ plugins. - -## Requirements - -The code of this package is intended to be used with [Fluent Bit v1.1][fluent-bit-1-1] branch or higher. - -## Usage - -Fluent Bit Go packages are exposed on this repository: - -[github.com/fluent/fluent-bit-go][fluent-bit-go] - -When creating a Fluent Bit Output plugin, the _output_ package can be used as follows: - -```go -import "github.com/fluent/fluent-bit-go/output" -``` - -For a more practical example please refer to the [out\_multiinstance plugin][multiinstance] implementation located at: - -## Contact - -Feel free to join us on our Slack channel, Mailing List, IRC or Twitter: - - - Slack: http://slack.fluentd.org (#fluent-bit channel) - - Mailing List: https://groups.google.com/forum/#!forum/fluent-bit - - IRC: irc.freenode.net #fluent-bit - - Twitter: http://twitter.com/fluentbit - -## Authors - -[Fluent Bit Go][fluent-bit] is made and sponsored by [Treasure Data][treasure-data] among -other [contributors][contributors]. - -[fluent-bit]: http://fluentbit.io/ -[fluent-bit-1-1]: https://github.com/fluent/fluent-bit/tree/v1.1.0 -[multiinstance]: https://github.com/fluent/fluent-bit-go/tree/fc386d263885e50387dd0081a77adf4072e8e4b6/examples/out_multiinstance -[fluent-bit-go]: http://github.com/fluent/fluent-bit-go -[treasure-data]: http://treasuredata.com -[contributors]: https://github.com/fluent/fluent-bit-go/graphs/contributors diff --git a/vendor/github.com/fluent/fluent-bit-go/go.mod b/vendor/github.com/fluent/fluent-bit-go/go.mod deleted file mode 100644 index b7bdc90..0000000 --- a/vendor/github.com/fluent/fluent-bit-go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/fluent/fluent-bit-go - -require github.com/ugorji/go v1.1.4 diff --git a/vendor/github.com/fluent/fluent-bit-go/go.sum b/vendor/github.com/fluent/fluent-bit-go/go.sum deleted file mode 100644 index a307788..0000000 --- a/vendor/github.com/fluent/fluent-bit-go/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= diff --git a/vendor/github.com/go-kit/kit/.build.yml b/vendor/github.com/go-kit/kit/.build.yml deleted file mode 100644 index 558aa06..0000000 --- a/vendor/github.com/go-kit/kit/.build.yml +++ /dev/null @@ -1,15 +0,0 @@ -image: debian/stable -sources: - - https://github.com/go-kit/kit -tasks: - - go_toolchain: | - wget -q https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz - sudo tar -C /usr/local -xzf go1.12.6.linux-amd64.tar.gz - sudo ln -s /usr/local/go/bin/go /usr/bin/go - go env - - dependencies: | - mkdir -p $HOME/go/src/github.com/go-kit - mv kit $HOME/go/src/github.com/go-kit - go get -t github.com/go-kit/kit/... - - test: | - go test -race -v github.com/go-kit/kit/... diff --git a/vendor/github.com/go-kit/kit/.gitignore b/vendor/github.com/go-kit/kit/.gitignore deleted file mode 100644 index 6062401..0000000 --- a/vendor/github.com/go-kit/kit/.gitignore +++ /dev/null @@ -1,45 +0,0 @@ -examples/addsvc/addsvc -examples/addsvc/client/client -examples/apigateway/apigateway -examples/profilesvc/profilesvc -examples/stringsvc1/stringsvc1 -examples/stringsvc2/stringsvc2 -examples/stringsvc3/stringsvc3 -*.coverprofile - -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test -_old* - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -# https://github.com/github/gitignore/blob/master/Global/Vim.gitignore -# swap -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -# session -Session.vim -# temporary -.netrwhist -*~ -# auto-generated tag files -tags - diff --git a/vendor/github.com/go-kit/kit/.travis.yml b/vendor/github.com/go-kit/kit/.travis.yml deleted file mode 100644 index 7a26e65..0000000 --- a/vendor/github.com/go-kit/kit/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -env: - - COVERALLS_TOKEN=MYSkSqcsWXd6DmP6TnSeiDhtvuL4u6ndp - -before_install: - - go get github.com/mattn/goveralls - - go get github.com/modocache/gover - -script: - - go test -race -v ./... - - ./coveralls.bash - -go: - - 1.10.x - - 1.11.x - - tip diff --git a/vendor/github.com/go-kit/kit/CONTRIBUTING.md b/vendor/github.com/go-kit/kit/CONTRIBUTING.md deleted file mode 100644 index c0751f8..0000000 --- a/vendor/github.com/go-kit/kit/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -# Contributing - -First, thank you for contributing! We love and encourage pull requests from everyone. - -Before submitting major changes, here are a few guidelines to follow: - -1. Check the [open issues][issues] and [pull requests][prs] for existing discussions. -1. Open an [issue][issues] first, to discuss a new feature or enhancement. -1. Write tests, and make sure the test suite passes locally and on CI. -1. Open a pull request, and reference the relevant issue(s). -1. After receiving feedback, [squash your commits][squash] and add a [great commit message][message]. -1. Have fun! - -[issues]: https://github.com/go-kit/kit/issues -[prs]: https://github.com/go-kit/kit/pulls -[squash]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html -[message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html - diff --git a/vendor/github.com/go-kit/kit/LICENSE b/vendor/github.com/go-kit/kit/LICENSE deleted file mode 100644 index 9d83342..0000000 --- a/vendor/github.com/go-kit/kit/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Peter Bourgon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/go-kit/kit/README.md b/vendor/github.com/go-kit/kit/README.md deleted file mode 100644 index a147bbd..0000000 --- a/vendor/github.com/go-kit/kit/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# Go kit
[![Circle CI](https://circleci.com/gh/go-kit/kit.svg?style=shield)](https://circleci.com/gh/go-kit/kit) [![Travis CI](https://travis-ci.org/go-kit/kit.svg?branch=master)](https://travis-ci.org/go-kit/kit) [![builds.sr.ht status](https://builds.sr.ht/~peterbourgon/kit.svg)](https://builds.sr.ht/~peterbourgon/kit?) [![GoDoc](https://godoc.org/github.com/go-kit/kit?status.svg)](https://godoc.org/github.com/go-kit/kit) [![Coverage Status](https://coveralls.io/repos/go-kit/kit/badge.svg?branch=master&service=github)](https://coveralls.io/github/go-kit/kit?branch=master) [![Go Report Card](https://goreportcard.com/badge/go-kit/kit)](https://goreportcard.com/report/go-kit/kit) [![Sourcegraph](https://sourcegraph.com/github.com/go-kit/kit/-/badge.svg)](https://sourcegraph.com/github.com/go-kit/kit?badge) - -**Go kit** is a **programming toolkit** for building microservices -(or elegant monoliths) in Go. We solve common problems in distributed -systems and application architecture so you can focus on delivering -business value. - -- Website: [gokit.io](https://gokit.io) -- Mailing list: [go-kit](https://groups.google.com/forum/#!forum/go-kit) -- Slack: [gophers.slack.com](https://gophers.slack.com) **#go-kit** ([invite](https://gophersinvite.herokuapp.com/)) - -## Motivation - -Go has emerged as the language of the server, but it remains underrepresented -in so-called "modern enterprise" companies like Facebook, Twitter, Netflix, and -SoundCloud. Many of these organizations have turned to JVM-based stacks for -their business logic, owing in large part to libraries and ecosystems that -directly support their microservice architectures. - -To reach its next level of success, Go needs more than simple primitives and -idioms. It needs a comprehensive toolkit, for coherent distributed programming -in the large. Go kit is a set of packages and best practices, which provide a -comprehensive, robust, and trustable way of building microservices for -organizations of any size. - -For more details, see - [the website](https://gokit.io), - [the motivating blog post](http://peter.bourgon.org/go-kit/) and - [the video of the talk](https://www.youtube.com/watch?v=iFR_7AKkJFU). -See also the - [Go kit talk at GopherCon 2015](https://www.youtube.com/watch?v=1AjaZi4QuGo). - -## Goals - -- Operate in a heterogeneous SOA — expect to interact with mostly non-Go-kit services -- RPC as the primary messaging pattern -- Pluggable serialization and transport — not just JSON over HTTP -- Operate within existing infrastructures — no mandates for specific tools or technologies - -## Non-goals - -- Supporting messaging patterns other than RPC (for now) — e.g. MPI, pub/sub, CQRS, etc. -- Re-implementing functionality that can be provided by adapting existing software -- Having opinions on operational concerns: deployment, configuration, process supervision, orchestration, etc. - -## Contributing - -Please see [CONTRIBUTING.md](/CONTRIBUTING.md). -Thank you, [contributors](https://github.com/go-kit/kit/graphs/contributors)! - -## Dependency management - -Go kit is a library, designed to be imported into a binary package. Vendoring -is currently the best way for binary package authors to ensure reliable, -reproducible builds. Therefore, we strongly recommend our users use vendoring -for all of their dependencies, including Go kit. To avoid compatibility and -availability issues, Go kit doesn't vendor its own dependencies, and -doesn't recommend use of third-party import proxies. - -There are several tools which make vendoring easier, including - [dep](https://github.com/golang/dep), - [gb](http://getgb.io), - [glide](https://github.com/Masterminds/glide), - [gvt](https://github.com/FiloSottile/gvt), and - [govendor](https://github.com/kardianos/govendor). -In addition, Go kit uses a variety of continuous integration providers - to find and fix compatibility problems as soon as they occur. - -## Related projects - -Projects with a ★ have had particular influence on Go kit's design (or vice-versa). - -### Service frameworks - -- [gizmo](https://github.com/nytimes/gizmo), a microservice toolkit from The New York Times ★ -- [go-micro](https://github.com/myodc/go-micro), a microservices client/server library ★ -- [gotalk](https://github.com/rsms/gotalk), async peer communication protocol & library -- [Kite](https://github.com/koding/kite), a micro-service framework -- [gocircuit](https://github.com/gocircuit/circuit), dynamic cloud orchestration - -### Individual components - -- [afex/hystrix-go](https://github.com/afex/hystrix-go), client-side latency and fault tolerance library -- [armon/go-metrics](https://github.com/armon/go-metrics), library for exporting performance and runtime metrics to external metrics systems -- [codahale/lunk](https://github.com/codahale/lunk), structured logging in the style of Google's Dapper or Twitter's Zipkin -- [eapache/go-resiliency](https://github.com/eapache/go-resiliency), resiliency patterns -- [sasbury/logging](https://github.com/sasbury/logging), a tagged style of logging -- [grpc/grpc-go](https://github.com/grpc/grpc-go), HTTP/2 based RPC -- [inconshreveable/log15](https://github.com/inconshreveable/log15), simple, powerful logging for Go ★ -- [mailgun/vulcand](https://github.com/vulcand/vulcand), programmatic load balancer backed by etcd -- [mattheath/phosphor](https://github.com/mondough/phosphor), distributed system tracing -- [pivotal-golang/lager](https://github.com/pivotal-golang/lager), an opinionated logging library -- [rubyist/circuitbreaker](https://github.com/rubyist/circuitbreaker), circuit breaker library -- [sirupsen/logrus](https://github.com/sirupsen/logrus), structured, pluggable logging for Go ★ -- [sourcegraph/appdash](https://github.com/sourcegraph/appdash), application tracing system based on Google's Dapper -- [spacemonkeygo/monitor](https://github.com/spacemonkeygo/monitor), data collection, monitoring, instrumentation, and Zipkin client library -- [streadway/handy](https://github.com/streadway/handy), net/http handler filters -- [vitess/rpcplus](https://godoc.org/github.com/youtube/vitess/go/rpcplus), package rpc + context.Context -- [gdamore/mangos](https://github.com/gdamore/mangos), nanomsg implementation in pure Go - -### Web frameworks - -- [Gorilla](http://www.gorillatoolkit.org) -- [Gin](https://gin-gonic.com/) -- [Negroni](https://github.com/codegangsta/negroni) -- [Goji](https://github.com/zenazn/goji) -- [Martini](https://github.com/go-martini/martini) -- [Beego](http://beego.me/) -- [Revel](https://revel.github.io/) (considered [harmful](https://github.com/go-kit/kit/issues/350)) -- [GoBuffalo](https://gobuffalo.io/) - -## Additional reading - -- [Architecting for the Cloud](https://slideshare.net/stonse/architecting-for-the-cloud-using-netflixoss-codemash-workshop-29852233) — Netflix -- [Dapper, a Large-Scale Distributed Systems Tracing Infrastructure](http://research.google.com/pubs/pub36356.html) — Google -- [Your Server as a Function](http://monkey.org/~marius/funsrv.pdf) (PDF) — Twitter - ---- - -Development supported by [DigitalOcean](https://digitalocean.com). diff --git a/vendor/github.com/go-kit/kit/circle.yml b/vendor/github.com/go-kit/kit/circle.yml deleted file mode 100644 index 70b9caa..0000000 --- a/vendor/github.com/go-kit/kit/circle.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 - -jobs: - build: - machine: true - working_directory: /home/circleci/.go_workspace/src/github.com/go-kit/kit - environment: - ETCD_ADDR: http://localhost:2379 - CONSUL_ADDR: localhost:8500 - ZK_ADDR: localhost:2181 - EUREKA_ADDR: http://localhost:8761/eureka - steps: - - checkout - - run: wget -q https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz - - run: sudo rm -rf /usr/local/go - - run: sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz - - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate - - run: go get -t github.com/go-kit/kit/... - - run: go test -v -race -tags integration github.com/go-kit/kit/... diff --git a/vendor/github.com/go-kit/kit/coveralls.bash b/vendor/github.com/go-kit/kit/coveralls.bash deleted file mode 100755 index cf8fee9..0000000 --- a/vendor/github.com/go-kit/kit/coveralls.bash +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -if ! type -P gover -then - echo gover missing: go get github.com/modocache/gover - exit 1 -fi - -if ! type -P goveralls -then - echo goveralls missing: go get github.com/mattn/goveralls - exit 1 -fi - -if [[ "$COVERALLS_TOKEN" == "" ]] -then - echo COVERALLS_TOKEN not set - exit 1 -fi - -go list ./... | grep -v '/examples/' | cut -d'/' -f 4- | while read d -do - cd $d - go test -covermode count -coverprofile coverage.coverprofile - cd - -done - -gover -goveralls -coverprofile gover.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN -find . -name '*.coverprofile' -delete - diff --git a/vendor/github.com/go-kit/kit/docker-compose-integration.yml b/vendor/github.com/go-kit/kit/docker-compose-integration.yml deleted file mode 100644 index 287d97d..0000000 --- a/vendor/github.com/go-kit/kit/docker-compose-integration.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '2' -services: - etcd: - image: quay.io/coreos/etcd - ports: - - "2379:2379" - command: /usr/local/bin/etcd -advertise-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -listen-client-urls "http://0.0.0.0:2379,http://0.0.0.0:4001" - consul: - image: progrium/consul - ports: - - "8500:8500" - command: -server -bootstrap - zk: - image: zookeeper - ports: - - "2181:2181" - eureka: - image: springcloud/eureka - environment: - eureka.server.responseCacheUpdateIntervalMs: 1000 - ports: - - "8761:8761" diff --git a/vendor/github.com/go-kit/kit/lint b/vendor/github.com/go-kit/kit/lint deleted file mode 100755 index 12e3072..0000000 --- a/vendor/github.com/go-kit/kit/lint +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -if [ ! $(command -v gometalinter) ] -then - go get github.com/alecthomas/gometalinter - gometalinter --update --install -fi - -time gometalinter \ - --exclude='error return value not checked.*(Close|Log|Print).*\(errcheck\)$' \ - --exclude='.*_test\.go:.*error return value not checked.*\(errcheck\)$' \ - --exclude='/thrift/' \ - --exclude='/pb/' \ - --exclude='no args in Log call \(vet\)' \ - --disable=dupl \ - --disable=aligncheck \ - --disable=gotype \ - --cyclo-over=20 \ - --tests \ - --concurrency=2 \ - --deadline=300s \ - ./... diff --git a/vendor/github.com/go-kit/kit/log/README.md b/vendor/github.com/go-kit/kit/log/README.md deleted file mode 100644 index a201a3d..0000000 --- a/vendor/github.com/go-kit/kit/log/README.md +++ /dev/null @@ -1,151 +0,0 @@ -# package log - -`package log` provides a minimal interface for structured logging in services. -It may be wrapped to encode conventions, enforce type-safety, provide leveled -logging, and so on. It can be used for both typical application log events, -and log-structured data streams. - -## Structured logging - -Structured logging is, basically, conceding to the reality that logs are -_data_, and warrant some level of schematic rigor. Using a stricter, -key/value-oriented message format for our logs, containing contextual and -semantic information, makes it much easier to get insight into the -operational activity of the systems we build. Consequently, `package log` is -of the strong belief that "[the benefits of structured logging outweigh the -minimal effort involved](https://www.thoughtworks.com/radar/techniques/structured-logging)". - -Migrating from unstructured to structured logging is probably a lot easier -than you'd expect. - -```go -// Unstructured -log.Printf("HTTP server listening on %s", addr) - -// Structured -logger.Log("transport", "HTTP", "addr", addr, "msg", "listening") -``` - -## Usage - -### Typical application logging - -```go -w := log.NewSyncWriter(os.Stderr) -logger := log.NewLogfmtLogger(w) -logger.Log("question", "what is the meaning of life?", "answer", 42) - -// Output: -// question="what is the meaning of life?" answer=42 -``` - -### Contextual Loggers - -```go -func main() { - var logger log.Logger - logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) - logger = log.With(logger, "instance_id", 123) - - logger.Log("msg", "starting") - NewWorker(log.With(logger, "component", "worker")).Run() - NewSlacker(log.With(logger, "component", "slacker")).Run() -} - -// Output: -// instance_id=123 msg=starting -// instance_id=123 component=worker msg=running -// instance_id=123 component=slacker msg=running -``` - -### Interact with stdlib logger - -Redirect stdlib logger to Go kit logger. - -```go -import ( - "os" - stdlog "log" - kitlog "github.com/go-kit/kit/log" -) - -func main() { - logger := kitlog.NewJSONLogger(kitlog.NewSyncWriter(os.Stdout)) - stdlog.SetOutput(kitlog.NewStdlibAdapter(logger)) - stdlog.Print("I sure like pie") -} - -// Output: -// {"msg":"I sure like pie","ts":"2016/01/01 12:34:56"} -``` - -Or, if, for legacy reasons, you need to pipe all of your logging through the -stdlib log package, you can redirect Go kit logger to the stdlib logger. - -```go -logger := kitlog.NewLogfmtLogger(kitlog.StdlibWriter{}) -logger.Log("legacy", true, "msg", "at least it's something") - -// Output: -// 2016/01/01 12:34:56 legacy=true msg="at least it's something" -``` - -### Timestamps and callers - -```go -var logger log.Logger -logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) -logger = log.With(logger, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) - -logger.Log("msg", "hello") - -// Output: -// ts=2016-01-01T12:34:56Z caller=main.go:15 msg=hello -``` - -## Levels - -Log levels are supported via the [level package](https://godoc.org/github.com/go-kit/kit/log/level). - -## Supported output formats - -- [Logfmt](https://brandur.org/logfmt) ([see also](https://blog.codeship.com/logfmt-a-log-format-thats-easy-to-read-and-write)) -- JSON - -## Enhancements - -`package log` is centered on the one-method Logger interface. - -```go -type Logger interface { - Log(keyvals ...interface{}) error -} -``` - -This interface, and its supporting code like is the product of much iteration -and evaluation. For more details on the evolution of the Logger interface, -see [The Hunt for a Logger Interface](http://go-talks.appspot.com/github.com/ChrisHines/talks/structured-logging/structured-logging.slide#1), -a talk by [Chris Hines](https://github.com/ChrisHines). -Also, please see -[#63](https://github.com/go-kit/kit/issues/63), -[#76](https://github.com/go-kit/kit/pull/76), -[#131](https://github.com/go-kit/kit/issues/131), -[#157](https://github.com/go-kit/kit/pull/157), -[#164](https://github.com/go-kit/kit/issues/164), and -[#252](https://github.com/go-kit/kit/pull/252) -to review historical conversations about package log and the Logger interface. - -Value-add packages and suggestions, -like improvements to [the leveled logger](https://godoc.org/github.com/go-kit/kit/log/level), -are of course welcome. Good proposals should - -- Be composable with [contextual loggers](https://godoc.org/github.com/go-kit/kit/log#With), -- Not break the behavior of [log.Caller](https://godoc.org/github.com/go-kit/kit/log#Caller) in any wrapped contextual loggers, and -- Be friendly to packages that accept only an unadorned log.Logger. - -## Benchmarks & comparisons - -There are a few Go logging benchmarks and comparisons that include Go kit's package log. - -- [imkira/go-loggers-bench](https://github.com/imkira/go-loggers-bench) includes kit/log -- [uber-common/zap](https://github.com/uber-common/zap), a zero-alloc logging library, includes a comparison with kit/log diff --git a/vendor/github.com/go-kit/kit/log/benchmark_test.go b/vendor/github.com/go-kit/kit/log/benchmark_test.go deleted file mode 100644 index 126bfa5..0000000 --- a/vendor/github.com/go-kit/kit/log/benchmark_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package log_test - -import ( - "testing" - - "github.com/go-kit/kit/log" -) - -func benchmarkRunner(b *testing.B, logger log.Logger, f func(log.Logger)) { - lc := log.With(logger, "common_key", "common_value") - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - f(lc) - } -} - -var ( - baseMessage = func(logger log.Logger) { logger.Log("foo_key", "foo_value") } - withMessage = func(logger log.Logger) { log.With(logger, "a", "b").Log("c", "d") } -) diff --git a/vendor/github.com/go-kit/kit/log/concurrency_test.go b/vendor/github.com/go-kit/kit/log/concurrency_test.go deleted file mode 100644 index 95a749e..0000000 --- a/vendor/github.com/go-kit/kit/log/concurrency_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package log_test - -import ( - "math" - "testing" - - "github.com/go-kit/kit/log" -) - -// These test are designed to be run with the race detector. - -func testConcurrency(t *testing.T, logger log.Logger, total int) { - n := int(math.Sqrt(float64(total))) - share := total / n - - errC := make(chan error, n) - - for i := 0; i < n; i++ { - go func() { - errC <- spam(logger, share) - }() - } - - for i := 0; i < n; i++ { - err := <-errC - if err != nil { - t.Fatalf("concurrent logging error: %v", err) - } - } -} - -func spam(logger log.Logger, count int) error { - for i := 0; i < count; i++ { - err := logger.Log("key", i) - if err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/go-kit/kit/log/doc.go b/vendor/github.com/go-kit/kit/log/doc.go deleted file mode 100644 index 918c0af..0000000 --- a/vendor/github.com/go-kit/kit/log/doc.go +++ /dev/null @@ -1,116 +0,0 @@ -// Package log provides a structured logger. -// -// Structured logging produces logs easily consumed later by humans or -// machines. Humans might be interested in debugging errors, or tracing -// specific requests. Machines might be interested in counting interesting -// events, or aggregating information for off-line processing. In both cases, -// it is important that the log messages are structured and actionable. -// Package log is designed to encourage both of these best practices. -// -// Basic Usage -// -// The fundamental interface is Logger. Loggers create log events from -// key/value data. The Logger interface has a single method, Log, which -// accepts a sequence of alternating key/value pairs, which this package names -// keyvals. -// -// type Logger interface { -// Log(keyvals ...interface{}) error -// } -// -// Here is an example of a function using a Logger to create log events. -// -// func RunTask(task Task, logger log.Logger) string { -// logger.Log("taskID", task.ID, "event", "starting task") -// ... -// logger.Log("taskID", task.ID, "event", "task complete") -// } -// -// The keys in the above example are "taskID" and "event". The values are -// task.ID, "starting task", and "task complete". Every key is followed -// immediately by its value. -// -// Keys are usually plain strings. Values may be any type that has a sensible -// encoding in the chosen log format. With structured logging it is a good -// idea to log simple values without formatting them. This practice allows -// the chosen logger to encode values in the most appropriate way. -// -// Contextual Loggers -// -// A contextual logger stores keyvals that it includes in all log events. -// Building appropriate contextual loggers reduces repetition and aids -// consistency in the resulting log output. With and WithPrefix add context to -// a logger. We can use With to improve the RunTask example. -// -// func RunTask(task Task, logger log.Logger) string { -// logger = log.With(logger, "taskID", task.ID) -// logger.Log("event", "starting task") -// ... -// taskHelper(task.Cmd, logger) -// ... -// logger.Log("event", "task complete") -// } -// -// The improved version emits the same log events as the original for the -// first and last calls to Log. Passing the contextual logger to taskHelper -// enables each log event created by taskHelper to include the task.ID even -// though taskHelper does not have access to that value. Using contextual -// loggers this way simplifies producing log output that enables tracing the -// life cycle of individual tasks. (See the Contextual example for the full -// code of the above snippet.) -// -// Dynamic Contextual Values -// -// A Valuer function stored in a contextual logger generates a new value each -// time an event is logged. The Valuer example demonstrates how this feature -// works. -// -// Valuers provide the basis for consistently logging timestamps and source -// code location. The log package defines several valuers for that purpose. -// See Timestamp, DefaultTimestamp, DefaultTimestampUTC, Caller, and -// DefaultCaller. A common logger initialization sequence that ensures all log -// entries contain a timestamp and source location looks like this: -// -// logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout)) -// logger = log.With(logger, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller) -// -// Concurrent Safety -// -// Applications with multiple goroutines want each log event written to the -// same logger to remain separate from other log events. Package log provides -// two simple solutions for concurrent safe logging. -// -// NewSyncWriter wraps an io.Writer and serializes each call to its Write -// method. Using a SyncWriter has the benefit that the smallest practical -// portion of the logging logic is performed within a mutex, but it requires -// the formatting Logger to make only one call to Write per log event. -// -// NewSyncLogger wraps any Logger and serializes each call to its Log method. -// Using a SyncLogger has the benefit that it guarantees each log event is -// handled atomically within the wrapped logger, but it typically serializes -// both the formatting and output logic. Use a SyncLogger if the formatting -// logger may perform multiple writes per log event. -// -// Error Handling -// -// This package relies on the practice of wrapping or decorating loggers with -// other loggers to provide composable pieces of functionality. It also means -// that Logger.Log must return an error because some -// implementations—especially those that output log data to an io.Writer—may -// encounter errors that cannot be handled locally. This in turn means that -// Loggers that wrap other loggers should return errors from the wrapped -// logger up the stack. -// -// Fortunately, the decorator pattern also provides a way to avoid the -// necessity to check for errors every time an application calls Logger.Log. -// An application required to panic whenever its Logger encounters -// an error could initialize its logger as follows. -// -// fmtlogger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout)) -// logger := log.LoggerFunc(func(keyvals ...interface{}) error { -// if err := fmtlogger.Log(keyvals...); err != nil { -// panic(err) -// } -// return nil -// }) -package log diff --git a/vendor/github.com/go-kit/kit/log/example_test.go b/vendor/github.com/go-kit/kit/log/example_test.go deleted file mode 100644 index 9766774..0000000 --- a/vendor/github.com/go-kit/kit/log/example_test.go +++ /dev/null @@ -1,137 +0,0 @@ -package log_test - -import ( - "math/rand" - "os" - "sync" - "time" - - "github.com/go-kit/kit/log" -) - -func Example_basic() { - logger := log.NewLogfmtLogger(os.Stdout) - - type Task struct { - ID int - } - - RunTask := func(task Task, logger log.Logger) { - logger.Log("taskID", task.ID, "event", "starting task") - - logger.Log("taskID", task.ID, "event", "task complete") - } - - RunTask(Task{ID: 1}, logger) - - // Output: - // taskID=1 event="starting task" - // taskID=1 event="task complete" -} - -func Example_contextual() { - logger := log.NewLogfmtLogger(os.Stdout) - - type Task struct { - ID int - Cmd string - } - - taskHelper := func(cmd string, logger log.Logger) { - // execute(cmd) - logger.Log("cmd", cmd, "dur", 42*time.Millisecond) - } - - RunTask := func(task Task, logger log.Logger) { - logger = log.With(logger, "taskID", task.ID) - logger.Log("event", "starting task") - - taskHelper(task.Cmd, logger) - - logger.Log("event", "task complete") - } - - RunTask(Task{ID: 1, Cmd: "echo Hello, world!"}, logger) - - // Output: - // taskID=1 event="starting task" - // taskID=1 cmd="echo Hello, world!" dur=42ms - // taskID=1 event="task complete" -} - -func Example_valuer() { - logger := log.NewLogfmtLogger(os.Stdout) - - count := 0 - counter := func() interface{} { - count++ - return count - } - - logger = log.With(logger, "count", log.Valuer(counter)) - - logger.Log("call", "first") - logger.Log("call", "second") - - // Output: - // count=1 call=first - // count=2 call=second -} - -func Example_debugInfo() { - logger := log.NewLogfmtLogger(os.Stdout) - - // make time predictable for this test - baseTime := time.Date(2015, time.February, 3, 10, 0, 0, 0, time.UTC) - mockTime := func() time.Time { - baseTime = baseTime.Add(time.Second) - return baseTime - } - - logger = log.With(logger, "time", log.Timestamp(mockTime), "caller", log.DefaultCaller) - - logger.Log("call", "first") - logger.Log("call", "second") - - // ... - - logger.Log("call", "third") - - // Output: - // time=2015-02-03T10:00:01Z caller=example_test.go:93 call=first - // time=2015-02-03T10:00:02Z caller=example_test.go:94 call=second - // time=2015-02-03T10:00:03Z caller=example_test.go:98 call=third -} - -func Example_syncWriter() { - w := log.NewSyncWriter(os.Stdout) - logger := log.NewLogfmtLogger(w) - - type Task struct { - ID int - } - - var wg sync.WaitGroup - - RunTask := func(task Task, logger log.Logger) { - logger.Log("taskID", task.ID, "event", "starting task") - - time.Sleep(time.Duration(rand.Intn(200)) * time.Millisecond) - - logger.Log("taskID", task.ID, "event", "task complete") - wg.Done() - } - - wg.Add(2) - - go RunTask(Task{ID: 1}, logger) - go RunTask(Task{ID: 2}, logger) - - wg.Wait() - - // Unordered output: - // taskID=1 event="starting task" - // taskID=2 event="starting task" - // taskID=1 event="task complete" - // taskID=2 event="task complete" -} diff --git a/vendor/github.com/go-kit/kit/log/json_logger.go b/vendor/github.com/go-kit/kit/log/json_logger.go deleted file mode 100644 index 66094b4..0000000 --- a/vendor/github.com/go-kit/kit/log/json_logger.go +++ /dev/null @@ -1,89 +0,0 @@ -package log - -import ( - "encoding" - "encoding/json" - "fmt" - "io" - "reflect" -) - -type jsonLogger struct { - io.Writer -} - -// NewJSONLogger returns a Logger that encodes keyvals to the Writer as a -// single JSON object. Each log event produces no more than one call to -// w.Write. The passed Writer must be safe for concurrent use by multiple -// goroutines if the returned Logger will be used concurrently. -func NewJSONLogger(w io.Writer) Logger { - return &jsonLogger{w} -} - -func (l *jsonLogger) Log(keyvals ...interface{}) error { - n := (len(keyvals) + 1) / 2 // +1 to handle case when len is odd - m := make(map[string]interface{}, n) - for i := 0; i < len(keyvals); i += 2 { - k := keyvals[i] - var v interface{} = ErrMissingValue - if i+1 < len(keyvals) { - v = keyvals[i+1] - } - merge(m, k, v) - } - return json.NewEncoder(l.Writer).Encode(m) -} - -func merge(dst map[string]interface{}, k, v interface{}) { - var key string - switch x := k.(type) { - case string: - key = x - case fmt.Stringer: - key = safeString(x) - default: - key = fmt.Sprint(x) - } - - // We want json.Marshaler and encoding.TextMarshaller to take priority over - // err.Error() and v.String(). But json.Marshall (called later) does that by - // default so we force a no-op if it's one of those 2 case. - switch x := v.(type) { - case json.Marshaler: - case encoding.TextMarshaler: - case error: - v = safeError(x) - case fmt.Stringer: - v = safeString(x) - } - - dst[key] = v -} - -func safeString(str fmt.Stringer) (s string) { - defer func() { - if panicVal := recover(); panicVal != nil { - if v := reflect.ValueOf(str); v.Kind() == reflect.Ptr && v.IsNil() { - s = "NULL" - } else { - panic(panicVal) - } - } - }() - s = str.String() - return -} - -func safeError(err error) (s interface{}) { - defer func() { - if panicVal := recover(); panicVal != nil { - if v := reflect.ValueOf(err); v.Kind() == reflect.Ptr && v.IsNil() { - s = nil - } else { - panic(panicVal) - } - } - }() - s = err.Error() - return -} diff --git a/vendor/github.com/go-kit/kit/log/json_logger_test.go b/vendor/github.com/go-kit/kit/log/json_logger_test.go deleted file mode 100644 index e3e3090..0000000 --- a/vendor/github.com/go-kit/kit/log/json_logger_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package log_test - -import ( - "bytes" - "errors" - "io/ioutil" - "testing" - - "github.com/go-kit/kit/log" -) - -func TestJSONLoggerCaller(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - logger = log.With(logger, "caller", log.DefaultCaller) - - if err := logger.Log(); err != nil { - t.Fatal(err) - } - if want, have := `{"caller":"json_logger_test.go:18"}`+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } -} - -func TestJSONLogger(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - if err := logger.Log("err", errors.New("err"), "m", map[string]int{"0": 0}, "a", []int{1, 2, 3}); err != nil { - t.Fatal(err) - } - if want, have := `{"a":[1,2,3],"err":"err","m":{"0":0}}`+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } -} - -func TestJSONLoggerMissingValue(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - if err := logger.Log("k"); err != nil { - t.Fatal(err) - } - if want, have := `{"k":"(MISSING)"}`+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } -} - -func TestJSONLoggerNilStringerKey(t *testing.T) { - t.Parallel() - - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - if err := logger.Log((*stringer)(nil), "v"); err != nil { - t.Fatal(err) - } - if want, have := `{"NULL":"v"}`+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } -} - -func TestJSONLoggerNilErrorValue(t *testing.T) { - t.Parallel() - - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - if err := logger.Log("err", (*stringError)(nil)); err != nil { - t.Fatal(err) - } - if want, have := `{"err":null}`+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } -} - -// aller implements json.Marshaler, encoding.TextMarshaler, and fmt.Stringer. -type aller struct{} - -func (aller) MarshalJSON() ([]byte, error) { - return []byte("\"json\""), nil -} - -func (aller) MarshalText() ([]byte, error) { - return []byte("text"), nil -} - -func (aller) String() string { - return "string" -} - -func (aller) Error() string { - return "error" -} - -// textstringer implements encoding.TextMarshaler and fmt.Stringer. -type textstringer struct{} - -func (textstringer) MarshalText() ([]byte, error) { - return []byte("text"), nil -} - -func (textstringer) String() string { - return "string" -} - -func TestJSONLoggerStringValue(t *testing.T) { - t.Parallel() - tests := []struct { - v interface{} - expected string - }{ - { - v: aller{}, - expected: `{"v":"json"}`, - }, - { - v: textstringer{}, - expected: `{"v":"text"}`, - }, - { - v: stringer("string"), - expected: `{"v":"string"}`, - }, - } - - for _, test := range tests { - buf := &bytes.Buffer{} - logger := log.NewJSONLogger(buf) - if err := logger.Log("v", test.v); err != nil { - t.Fatal(err) - } - - if want, have := test.expected+"\n", buf.String(); want != have { - t.Errorf("\nwant %#v\nhave %#v", want, have) - } - } -} - -type stringer string - -func (s stringer) String() string { - return string(s) -} - -type stringError string - -func (s stringError) Error() string { - return string(s) -} - -func BenchmarkJSONLoggerSimple(b *testing.B) { - benchmarkRunner(b, log.NewJSONLogger(ioutil.Discard), baseMessage) -} - -func BenchmarkJSONLoggerContextual(b *testing.B) { - benchmarkRunner(b, log.NewJSONLogger(ioutil.Discard), withMessage) -} - -func TestJSONLoggerConcurrency(t *testing.T) { - t.Parallel() - testConcurrency(t, log.NewJSONLogger(ioutil.Discard), 10000) -} diff --git a/vendor/github.com/go-kit/kit/log/level/benchmark_test.go b/vendor/github.com/go-kit/kit/log/level/benchmark_test.go deleted file mode 100644 index 4fca6f0..0000000 --- a/vendor/github.com/go-kit/kit/log/level/benchmark_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package level_test - -import ( - "io/ioutil" - "testing" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" -) - -func Benchmark(b *testing.B) { - contexts := []struct { - name string - context func(log.Logger) log.Logger - }{ - {"NoContext", func(l log.Logger) log.Logger { - return l - }}, - {"TimeContext", func(l log.Logger) log.Logger { - return log.With(l, "time", log.DefaultTimestampUTC) - }}, - {"CallerContext", func(l log.Logger) log.Logger { - return log.With(l, "caller", log.DefaultCaller) - }}, - {"TimeCallerReqIDContext", func(l log.Logger) log.Logger { - return log.With(l, "time", log.DefaultTimestampUTC, "caller", log.DefaultCaller, "reqID", 29) - }}, - } - - loggers := []struct { - name string - logger log.Logger - }{ - {"Nop", log.NewNopLogger()}, - {"Logfmt", log.NewLogfmtLogger(ioutil.Discard)}, - {"JSON", log.NewJSONLogger(ioutil.Discard)}, - } - - filters := []struct { - name string - filter func(log.Logger) log.Logger - }{ - {"Baseline", func(l log.Logger) log.Logger { - return l - }}, - {"DisallowedLevel", func(l log.Logger) log.Logger { - return level.NewFilter(l, level.AllowInfo()) - }}, - {"AllowedLevel", func(l log.Logger) log.Logger { - return level.NewFilter(l, level.AllowAll()) - }}, - } - - for _, c := range contexts { - b.Run(c.name, func(b *testing.B) { - for _, f := range filters { - b.Run(f.name, func(b *testing.B) { - for _, l := range loggers { - b.Run(l.name, func(b *testing.B) { - logger := c.context(f.filter(l.logger)) - b.ResetTimer() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - level.Debug(logger).Log("foo", "bar") - } - }) - } - }) - } - }) - } -} diff --git a/vendor/github.com/go-kit/kit/log/level/doc.go b/vendor/github.com/go-kit/kit/log/level/doc.go deleted file mode 100644 index 505d307..0000000 --- a/vendor/github.com/go-kit/kit/log/level/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Package level implements leveled logging on top of Go kit's log package. To -// use the level package, create a logger as per normal in your func main, and -// wrap it with level.NewFilter. -// -// var logger log.Logger -// logger = log.NewLogfmtLogger(os.Stderr) -// logger = level.NewFilter(logger, level.AllowInfo()) // <-- -// logger = log.With(logger, "ts", log.DefaultTimestampUTC) -// -// Then, at the callsites, use one of the level.Debug, Info, Warn, or Error -// helper methods to emit leveled log events. -// -// logger.Log("foo", "bar") // as normal, no level -// level.Debug(logger).Log("request_id", reqID, "trace_data", trace.Get()) -// if value > 100 { -// level.Error(logger).Log("value", value) -// } -// -// NewFilter allows precise control over what happens when a log event is -// emitted without a level key, or if a squelched level is used. Check the -// Option functions for details. -package level diff --git a/vendor/github.com/go-kit/kit/log/level/example_test.go b/vendor/github.com/go-kit/kit/log/level/example_test.go deleted file mode 100644 index 73cc752..0000000 --- a/vendor/github.com/go-kit/kit/log/level/example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package level_test - -import ( - "errors" - "os" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" -) - -func Example_basic() { - logger := log.NewLogfmtLogger(os.Stdout) - level.Debug(logger).Log("msg", "this message is at thte debug level") - level.Info(logger).Log("msg", "this message is at the info level") - level.Warn(logger).Log("msg", "this message is at the warn level") - level.Error(logger).Log("msg", "this message is at the error level") - - // Output: - // level=debug msg="this message is at thte debug level" - // level=info msg="this message is at the info level" - // level=warn msg="this message is at the warn level" - // level=error msg="this message is at the error level" -} - -func Example_filtered() { - // Set up logger with level filter. - logger := log.NewLogfmtLogger(os.Stdout) - logger = level.NewFilter(logger, level.AllowInfo()) - logger = log.With(logger, "caller", log.DefaultCaller) - - // Use level helpers to log at different levels. - level.Error(logger).Log("err", errors.New("bad data")) - level.Info(logger).Log("event", "data saved") - level.Debug(logger).Log("next item", 17) // filtered - - // Output: - // level=error caller=example_test.go:32 err="bad data" - // level=info caller=example_test.go:33 event="data saved" -} diff --git a/vendor/github.com/go-kit/kit/log/level/level.go b/vendor/github.com/go-kit/kit/log/level/level.go deleted file mode 100644 index fceafc4..0000000 --- a/vendor/github.com/go-kit/kit/log/level/level.go +++ /dev/null @@ -1,205 +0,0 @@ -package level - -import "github.com/go-kit/kit/log" - -// Error returns a logger that includes a Key/ErrorValue pair. -func Error(logger log.Logger) log.Logger { - return log.WithPrefix(logger, Key(), ErrorValue()) -} - -// Warn returns a logger that includes a Key/WarnValue pair. -func Warn(logger log.Logger) log.Logger { - return log.WithPrefix(logger, Key(), WarnValue()) -} - -// Info returns a logger that includes a Key/InfoValue pair. -func Info(logger log.Logger) log.Logger { - return log.WithPrefix(logger, Key(), InfoValue()) -} - -// Debug returns a logger that includes a Key/DebugValue pair. -func Debug(logger log.Logger) log.Logger { - return log.WithPrefix(logger, Key(), DebugValue()) -} - -// NewFilter wraps next and implements level filtering. See the commentary on -// the Option functions for a detailed description of how to configure levels. -// If no options are provided, all leveled log events created with Debug, -// Info, Warn or Error helper methods are squelched and non-leveled log -// events are passed to next unmodified. -func NewFilter(next log.Logger, options ...Option) log.Logger { - l := &logger{ - next: next, - } - for _, option := range options { - option(l) - } - return l -} - -type logger struct { - next log.Logger - allowed level - squelchNoLevel bool - errNotAllowed error - errNoLevel error -} - -func (l *logger) Log(keyvals ...interface{}) error { - var hasLevel, levelAllowed bool - for i := 1; i < len(keyvals); i += 2 { - if v, ok := keyvals[i].(*levelValue); ok { - hasLevel = true - levelAllowed = l.allowed&v.level != 0 - break - } - } - if !hasLevel && l.squelchNoLevel { - return l.errNoLevel - } - if hasLevel && !levelAllowed { - return l.errNotAllowed - } - return l.next.Log(keyvals...) -} - -// Option sets a parameter for the leveled logger. -type Option func(*logger) - -// AllowAll is an alias for AllowDebug. -func AllowAll() Option { - return AllowDebug() -} - -// AllowDebug allows error, warn, info and debug level log events to pass. -func AllowDebug() Option { - return allowed(levelError | levelWarn | levelInfo | levelDebug) -} - -// AllowInfo allows error, warn and info level log events to pass. -func AllowInfo() Option { - return allowed(levelError | levelWarn | levelInfo) -} - -// AllowWarn allows error and warn level log events to pass. -func AllowWarn() Option { - return allowed(levelError | levelWarn) -} - -// AllowError allows only error level log events to pass. -func AllowError() Option { - return allowed(levelError) -} - -// AllowNone allows no leveled log events to pass. -func AllowNone() Option { - return allowed(0) -} - -func allowed(allowed level) Option { - return func(l *logger) { l.allowed = allowed } -} - -// ErrNotAllowed sets the error to return from Log when it squelches a log -// event disallowed by the configured Allow[Level] option. By default, -// ErrNotAllowed is nil; in this case the log event is squelched with no -// error. -func ErrNotAllowed(err error) Option { - return func(l *logger) { l.errNotAllowed = err } -} - -// SquelchNoLevel instructs Log to squelch log events with no level, so that -// they don't proceed through to the wrapped logger. If SquelchNoLevel is set -// to true and a log event is squelched in this way, the error value -// configured with ErrNoLevel is returned to the caller. -func SquelchNoLevel(squelch bool) Option { - return func(l *logger) { l.squelchNoLevel = squelch } -} - -// ErrNoLevel sets the error to return from Log when it squelches a log event -// with no level. By default, ErrNoLevel is nil; in this case the log event is -// squelched with no error. -func ErrNoLevel(err error) Option { - return func(l *logger) { l.errNoLevel = err } -} - -// NewInjector wraps next and returns a logger that adds a Key/level pair to -// the beginning of log events that don't already contain a level. In effect, -// this gives a default level to logs without a level. -func NewInjector(next log.Logger, level Value) log.Logger { - return &injector{ - next: next, - level: level, - } -} - -type injector struct { - next log.Logger - level interface{} -} - -func (l *injector) Log(keyvals ...interface{}) error { - for i := 1; i < len(keyvals); i += 2 { - if _, ok := keyvals[i].(*levelValue); ok { - return l.next.Log(keyvals...) - } - } - kvs := make([]interface{}, len(keyvals)+2) - kvs[0], kvs[1] = key, l.level - copy(kvs[2:], keyvals) - return l.next.Log(kvs...) -} - -// Value is the interface that each of the canonical level values implement. -// It contains unexported methods that prevent types from other packages from -// implementing it and guaranteeing that NewFilter can distinguish the levels -// defined in this package from all other values. -type Value interface { - String() string - levelVal() -} - -// Key returns the unique key added to log events by the loggers in this -// package. -func Key() interface{} { return key } - -// ErrorValue returns the unique value added to log events by Error. -func ErrorValue() Value { return errorValue } - -// WarnValue returns the unique value added to log events by Warn. -func WarnValue() Value { return warnValue } - -// InfoValue returns the unique value added to log events by Info. -func InfoValue() Value { return infoValue } - -// DebugValue returns the unique value added to log events by Warn. -func DebugValue() Value { return debugValue } - -var ( - // key is of type interface{} so that it allocates once during package - // initialization and avoids allocating every time the value is added to a - // []interface{} later. - key interface{} = "level" - - errorValue = &levelValue{level: levelError, name: "error"} - warnValue = &levelValue{level: levelWarn, name: "warn"} - infoValue = &levelValue{level: levelInfo, name: "info"} - debugValue = &levelValue{level: levelDebug, name: "debug"} -) - -type level byte - -const ( - levelDebug level = 1 << iota - levelInfo - levelWarn - levelError -) - -type levelValue struct { - name string - level -} - -func (v *levelValue) String() string { return v.name } -func (v *levelValue) levelVal() {} diff --git a/vendor/github.com/go-kit/kit/log/level/level_test.go b/vendor/github.com/go-kit/kit/log/level/level_test.go deleted file mode 100644 index e362eff..0000000 --- a/vendor/github.com/go-kit/kit/log/level/level_test.go +++ /dev/null @@ -1,235 +0,0 @@ -package level_test - -import ( - "bytes" - "errors" - "io" - "strings" - "testing" - - "github.com/go-kit/kit/log" - "github.com/go-kit/kit/log/level" -) - -func TestVariousLevels(t *testing.T) { - testCases := []struct { - name string - allowed level.Option - want string - }{ - { - "AllowAll", - level.AllowAll(), - strings.Join([]string{ - `{"level":"debug","this is":"debug log"}`, - `{"level":"info","this is":"info log"}`, - `{"level":"warn","this is":"warn log"}`, - `{"level":"error","this is":"error log"}`, - }, "\n"), - }, - { - "AllowDebug", - level.AllowDebug(), - strings.Join([]string{ - `{"level":"debug","this is":"debug log"}`, - `{"level":"info","this is":"info log"}`, - `{"level":"warn","this is":"warn log"}`, - `{"level":"error","this is":"error log"}`, - }, "\n"), - }, - { - "AllowInfo", - level.AllowInfo(), - strings.Join([]string{ - `{"level":"info","this is":"info log"}`, - `{"level":"warn","this is":"warn log"}`, - `{"level":"error","this is":"error log"}`, - }, "\n"), - }, - { - "AllowWarn", - level.AllowWarn(), - strings.Join([]string{ - `{"level":"warn","this is":"warn log"}`, - `{"level":"error","this is":"error log"}`, - }, "\n"), - }, - { - "AllowError", - level.AllowError(), - strings.Join([]string{ - `{"level":"error","this is":"error log"}`, - }, "\n"), - }, - { - "AllowNone", - level.AllowNone(), - ``, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - var buf bytes.Buffer - logger := level.NewFilter(log.NewJSONLogger(&buf), tc.allowed) - - level.Debug(logger).Log("this is", "debug log") - level.Info(logger).Log("this is", "info log") - level.Warn(logger).Log("this is", "warn log") - level.Error(logger).Log("this is", "error log") - - if want, have := tc.want, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant:\n%s\nhave:\n%s", want, have) - } - }) - } -} - -func TestErrNotAllowed(t *testing.T) { - myError := errors.New("squelched!") - opts := []level.Option{ - level.AllowWarn(), - level.ErrNotAllowed(myError), - } - logger := level.NewFilter(log.NewNopLogger(), opts...) - - if want, have := myError, level.Info(logger).Log("foo", "bar"); want != have { - t.Errorf("want %#+v, have %#+v", want, have) - } - - if want, have := error(nil), level.Warn(logger).Log("foo", "bar"); want != have { - t.Errorf("want %#+v, have %#+v", want, have) - } -} - -func TestErrNoLevel(t *testing.T) { - myError := errors.New("no level specified") - - var buf bytes.Buffer - opts := []level.Option{ - level.SquelchNoLevel(true), - level.ErrNoLevel(myError), - } - logger := level.NewFilter(log.NewJSONLogger(&buf), opts...) - - if want, have := myError, logger.Log("foo", "bar"); want != have { - t.Errorf("want %v, have %v", want, have) - } - if want, have := ``, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant '%s'\nhave '%s'", want, have) - } -} - -func TestAllowNoLevel(t *testing.T) { - var buf bytes.Buffer - opts := []level.Option{ - level.SquelchNoLevel(false), - level.ErrNoLevel(errors.New("I should never be returned!")), - } - logger := level.NewFilter(log.NewJSONLogger(&buf), opts...) - - if want, have := error(nil), logger.Log("foo", "bar"); want != have { - t.Errorf("want %v, have %v", want, have) - } - if want, have := `{"foo":"bar"}`, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant '%s'\nhave '%s'", want, have) - } -} - -func TestLevelContext(t *testing.T) { - var buf bytes.Buffer - - // Wrapping the level logger with a context allows users to use - // log.DefaultCaller as per normal. - var logger log.Logger - logger = log.NewLogfmtLogger(&buf) - logger = level.NewFilter(logger, level.AllowAll()) - logger = log.With(logger, "caller", log.DefaultCaller) - - level.Info(logger).Log("foo", "bar") - if want, have := `level=info caller=level_test.go:149 foo=bar`, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant '%s'\nhave '%s'", want, have) - } -} - -func TestContextLevel(t *testing.T) { - var buf bytes.Buffer - - // Wrapping a context with the level logger still works, but requires users - // to specify a higher callstack depth value. - var logger log.Logger - logger = log.NewLogfmtLogger(&buf) - logger = log.With(logger, "caller", log.Caller(5)) - logger = level.NewFilter(logger, level.AllowAll()) - - level.Info(logger).Log("foo", "bar") - if want, have := `caller=level_test.go:165 level=info foo=bar`, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant '%s'\nhave '%s'", want, have) - } -} - -func TestLevelFormatting(t *testing.T) { - testCases := []struct { - name string - format func(io.Writer) log.Logger - output string - }{ - { - name: "logfmt", - format: log.NewLogfmtLogger, - output: `level=info foo=bar`, - }, - { - name: "JSON", - format: log.NewJSONLogger, - output: `{"foo":"bar","level":"info"}`, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - var buf bytes.Buffer - - logger := tc.format(&buf) - level.Info(logger).Log("foo", "bar") - if want, have := tc.output, strings.TrimSpace(buf.String()); want != have { - t.Errorf("\nwant: '%s'\nhave '%s'", want, have) - } - }) - } -} - -func TestInjector(t *testing.T) { - var ( - output []interface{} - logger log.Logger - ) - - logger = log.LoggerFunc(func(keyvals ...interface{}) error { - output = keyvals - return nil - }) - logger = level.NewInjector(logger, level.InfoValue()) - - logger.Log("foo", "bar") - if got, want := len(output), 4; got != want { - t.Errorf("missing level not injected: got len==%d, want len==%d", got, want) - } - if got, want := output[0], level.Key(); got != want { - t.Errorf("wrong level key: got %#v, want %#v", got, want) - } - if got, want := output[1], level.InfoValue(); got != want { - t.Errorf("wrong level value: got %#v, want %#v", got, want) - } - - level.Error(logger).Log("foo", "bar") - if got, want := len(output), 4; got != want { - t.Errorf("leveled record modified: got len==%d, want len==%d", got, want) - } - if got, want := output[0], level.Key(); got != want { - t.Errorf("wrong level key: got %#v, want %#v", got, want) - } - if got, want := output[1], level.ErrorValue(); got != want { - t.Errorf("wrong level value: got %#v, want %#v", got, want) - } -} diff --git a/vendor/github.com/go-kit/kit/log/log.go b/vendor/github.com/go-kit/kit/log/log.go deleted file mode 100644 index 66a9e2f..0000000 --- a/vendor/github.com/go-kit/kit/log/log.go +++ /dev/null @@ -1,135 +0,0 @@ -package log - -import "errors" - -// Logger is the fundamental interface for all log operations. Log creates a -// log event from keyvals, a variadic sequence of alternating keys and values. -// Implementations must be safe for concurrent use by multiple goroutines. In -// particular, any implementation of Logger that appends to keyvals or -// modifies or retains any of its elements must make a copy first. -type Logger interface { - Log(keyvals ...interface{}) error -} - -// ErrMissingValue is appended to keyvals slices with odd length to substitute -// the missing value. -var ErrMissingValue = errors.New("(MISSING)") - -// With returns a new contextual logger with keyvals prepended to those passed -// to calls to Log. If logger is also a contextual logger created by With or -// WithPrefix, keyvals is appended to the existing context. -// -// The returned Logger replaces all value elements (odd indexes) containing a -// Valuer with their generated value for each call to its Log method. -func With(logger Logger, keyvals ...interface{}) Logger { - if len(keyvals) == 0 { - return logger - } - l := newContext(logger) - kvs := append(l.keyvals, keyvals...) - if len(kvs)%2 != 0 { - kvs = append(kvs, ErrMissingValue) - } - return &context{ - logger: l.logger, - // Limiting the capacity of the stored keyvals ensures that a new - // backing array is created if the slice must grow in Log or With. - // Using the extra capacity without copying risks a data race that - // would violate the Logger interface contract. - keyvals: kvs[:len(kvs):len(kvs)], - hasValuer: l.hasValuer || containsValuer(keyvals), - } -} - -// WithPrefix returns a new contextual logger with keyvals prepended to those -// passed to calls to Log. If logger is also a contextual logger created by -// With or WithPrefix, keyvals is prepended to the existing context. -// -// The returned Logger replaces all value elements (odd indexes) containing a -// Valuer with their generated value for each call to its Log method. -func WithPrefix(logger Logger, keyvals ...interface{}) Logger { - if len(keyvals) == 0 { - return logger - } - l := newContext(logger) - // Limiting the capacity of the stored keyvals ensures that a new - // backing array is created if the slice must grow in Log or With. - // Using the extra capacity without copying risks a data race that - // would violate the Logger interface contract. - n := len(l.keyvals) + len(keyvals) - if len(keyvals)%2 != 0 { - n++ - } - kvs := make([]interface{}, 0, n) - kvs = append(kvs, keyvals...) - if len(kvs)%2 != 0 { - kvs = append(kvs, ErrMissingValue) - } - kvs = append(kvs, l.keyvals...) - return &context{ - logger: l.logger, - keyvals: kvs, - hasValuer: l.hasValuer || containsValuer(keyvals), - } -} - -// context is the Logger implementation returned by With and WithPrefix. It -// wraps a Logger and holds keyvals that it includes in all log events. Its -// Log method calls bindValues to generate values for each Valuer in the -// context keyvals. -// -// A context must always have the same number of stack frames between calls to -// its Log method and the eventual binding of Valuers to their value. This -// requirement comes from the functional requirement to allow a context to -// resolve application call site information for a Caller stored in the -// context. To do this we must be able to predict the number of logging -// functions on the stack when bindValues is called. -// -// Two implementation details provide the needed stack depth consistency. -// -// 1. newContext avoids introducing an additional layer when asked to -// wrap another context. -// 2. With and WithPrefix avoid introducing an additional layer by -// returning a newly constructed context with a merged keyvals rather -// than simply wrapping the existing context. -type context struct { - logger Logger - keyvals []interface{} - hasValuer bool -} - -func newContext(logger Logger) *context { - if c, ok := logger.(*context); ok { - return c - } - return &context{logger: logger} -} - -// Log replaces all value elements (odd indexes) containing a Valuer in the -// stored context with their generated value, appends keyvals, and passes the -// result to the wrapped Logger. -func (l *context) Log(keyvals ...interface{}) error { - kvs := append(l.keyvals, keyvals...) - if len(kvs)%2 != 0 { - kvs = append(kvs, ErrMissingValue) - } - if l.hasValuer { - // If no keyvals were appended above then we must copy l.keyvals so - // that future log events will reevaluate the stored Valuers. - if len(keyvals) == 0 { - kvs = append([]interface{}{}, l.keyvals...) - } - bindValues(kvs[:len(l.keyvals)]) - } - return l.logger.Log(kvs...) -} - -// LoggerFunc is an adapter to allow use of ordinary functions as Loggers. If -// f is a function with the appropriate signature, LoggerFunc(f) is a Logger -// object that calls f. -type LoggerFunc func(...interface{}) error - -// Log implements Logger by calling f(keyvals...). -func (f LoggerFunc) Log(keyvals ...interface{}) error { - return f(keyvals...) -} diff --git a/vendor/github.com/go-kit/kit/log/log_test.go b/vendor/github.com/go-kit/kit/log/log_test.go deleted file mode 100644 index 1bf2972..0000000 --- a/vendor/github.com/go-kit/kit/log/log_test.go +++ /dev/null @@ -1,191 +0,0 @@ -package log_test - -import ( - "bytes" - "fmt" - "sync" - "testing" - - "github.com/go-kit/kit/log" - "github.com/go-stack/stack" -) - -func TestContext(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - logger := log.NewLogfmtLogger(buf) - - kvs := []interface{}{"a", 123} - lc := log.With(logger, kvs...) - kvs[1] = 0 // With should copy its key values - - lc = log.With(lc, "b", "c") // With should stack - if err := lc.Log("msg", "message"); err != nil { - t.Fatal(err) - } - if want, have := "a=123 b=c msg=message\n", buf.String(); want != have { - t.Errorf("\nwant: %shave: %s", want, have) - } - - buf.Reset() - lc = log.WithPrefix(lc, "p", "first") - if err := lc.Log("msg", "message"); err != nil { - t.Fatal(err) - } - if want, have := "p=first a=123 b=c msg=message\n", buf.String(); want != have { - t.Errorf("\nwant: %shave: %s", want, have) - } -} - -func TestContextMissingValue(t *testing.T) { - t.Parallel() - var output []interface{} - logger := log.Logger(log.LoggerFunc(func(keyvals ...interface{}) error { - output = keyvals - return nil - })) - - log.WithPrefix(log.With(logger, "k1"), "k0").Log("k2") - if want, have := 6, len(output); want != have { - t.Errorf("want len(output) == %v, have %v", want, have) - } - for i := 1; i < 6; i += 2 { - if want, have := log.ErrMissingValue, output[i]; want != have { - t.Errorf("want output[%d] == %#v, have %#v", i, want, have) - } - } -} - -// Test that context.Log has a consistent function stack depth when binding -// Valuers, regardless of how many times With has been called. -func TestContextStackDepth(t *testing.T) { - t.Parallel() - fn := fmt.Sprintf("%n", stack.Caller(0)) - - var output []interface{} - - logger := log.Logger(log.LoggerFunc(func(keyvals ...interface{}) error { - output = keyvals - return nil - })) - - stackValuer := log.Valuer(func() interface{} { - for i, c := range stack.Trace() { - if fmt.Sprintf("%n", c) == fn { - return i - } - } - t.Fatal("Test function not found in stack trace.") - return nil - }) - - logger = log.With(logger, "stack", stackValuer) - - // Call through interface to get baseline. - logger.Log("k", "v") - want := output[1].(int) - - for len(output) < 10 { - logger.Log("k", "v") - if have := output[1]; have != want { - t.Errorf("%d Withs: have %v, want %v", len(output)/2-1, have, want) - } - - wrapped := log.With(logger) - wrapped.Log("k", "v") - if have := output[1]; have != want { - t.Errorf("%d Withs: have %v, want %v", len(output)/2-1, have, want) - } - - logger = log.With(logger, "k", "v") - } -} - -// Test that With returns a Logger safe for concurrent use. This test -// validates that the stored logging context does not get corrupted when -// multiple clients concurrently log additional keyvals. -// -// This test must be run with go test -cpu 2 (or more) to achieve its goal. -func TestWithConcurrent(t *testing.T) { - // Create some buckets to count how many events each goroutine logs. - const goroutines = 8 - counts := [goroutines]int{} - - // This logger extracts a goroutine id from the last value field and - // increments the referenced bucket. - logger := log.LoggerFunc(func(kv ...interface{}) error { - goroutine := kv[len(kv)-1].(int) - counts[goroutine]++ - return nil - }) - - // With must be careful about handling slices that can grow without - // copying the underlying array, so give it a challenge. - l := log.With(logger, make([]interface{}, 0, 2)...) - - // Start logging concurrently. Each goroutine logs its id so the logger - // can bucket the event counts. - var wg sync.WaitGroup - wg.Add(goroutines) - const n = 10000 - for i := 0; i < goroutines; i++ { - go func(idx int) { - defer wg.Done() - for j := 0; j < n; j++ { - l.Log("goroutineIdx", idx) - } - }(i) - } - wg.Wait() - - for bucket, have := range counts { - if want := n; want != have { - t.Errorf("bucket %d: want %d, have %d", bucket, want, have) // note Errorf - } - } -} - -func BenchmarkDiscard(b *testing.B) { - logger := log.NewNopLogger() - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - logger.Log("k", "v") - } -} - -func BenchmarkOneWith(b *testing.B) { - logger := log.NewNopLogger() - lc := log.With(logger, "k", "v") - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - lc.Log("k", "v") - } -} - -func BenchmarkTwoWith(b *testing.B) { - logger := log.NewNopLogger() - lc := log.With(logger, "k", "v") - for i := 1; i < 2; i++ { - lc = log.With(lc, "k", "v") - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - lc.Log("k", "v") - } -} - -func BenchmarkTenWith(b *testing.B) { - logger := log.NewNopLogger() - lc := log.With(logger, "k", "v") - for i := 1; i < 10; i++ { - lc = log.With(lc, "k", "v") - } - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - lc.Log("k", "v") - } -} diff --git a/vendor/github.com/go-kit/kit/log/logfmt_logger.go b/vendor/github.com/go-kit/kit/log/logfmt_logger.go deleted file mode 100644 index a003052..0000000 --- a/vendor/github.com/go-kit/kit/log/logfmt_logger.go +++ /dev/null @@ -1,62 +0,0 @@ -package log - -import ( - "bytes" - "io" - "sync" - - "github.com/go-logfmt/logfmt" -) - -type logfmtEncoder struct { - *logfmt.Encoder - buf bytes.Buffer -} - -func (l *logfmtEncoder) Reset() { - l.Encoder.Reset() - l.buf.Reset() -} - -var logfmtEncoderPool = sync.Pool{ - New: func() interface{} { - var enc logfmtEncoder - enc.Encoder = logfmt.NewEncoder(&enc.buf) - return &enc - }, -} - -type logfmtLogger struct { - w io.Writer -} - -// NewLogfmtLogger returns a logger that encodes keyvals to the Writer in -// logfmt format. Each log event produces no more than one call to w.Write. -// The passed Writer must be safe for concurrent use by multiple goroutines if -// the returned Logger will be used concurrently. -func NewLogfmtLogger(w io.Writer) Logger { - return &logfmtLogger{w} -} - -func (l logfmtLogger) Log(keyvals ...interface{}) error { - enc := logfmtEncoderPool.Get().(*logfmtEncoder) - enc.Reset() - defer logfmtEncoderPool.Put(enc) - - if err := enc.EncodeKeyvals(keyvals...); err != nil { - return err - } - - // Add newline to the end of the buffer - if err := enc.EndRecord(); err != nil { - return err - } - - // The Logger interface requires implementations to be safe for concurrent - // use by multiple goroutines. For this implementation that means making - // only one call to l.w.Write() for each call to Log. - if _, err := l.w.Write(enc.buf.Bytes()); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/go-kit/kit/log/logfmt_logger_test.go b/vendor/github.com/go-kit/kit/log/logfmt_logger_test.go deleted file mode 100644 index 91bbca1..0000000 --- a/vendor/github.com/go-kit/kit/log/logfmt_logger_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package log_test - -import ( - "bytes" - "errors" - "io/ioutil" - "testing" - - "github.com/go-kit/kit/log" - "github.com/go-logfmt/logfmt" -) - -func TestLogfmtLogger(t *testing.T) { - t.Parallel() - buf := &bytes.Buffer{} - logger := log.NewLogfmtLogger(buf) - - if err := logger.Log("hello", "world"); err != nil { - t.Fatal(err) - } - if want, have := "hello=world\n", buf.String(); want != have { - t.Errorf("want %#v, have %#v", want, have) - } - - buf.Reset() - if err := logger.Log("a", 1, "err", errors.New("error")); err != nil { - t.Fatal(err) - } - if want, have := "a=1 err=error\n", buf.String(); want != have { - t.Errorf("want %#v, have %#v", want, have) - } - - buf.Reset() - if err := logger.Log("std_map", map[int]int{1: 2}, "my_map", mymap{0: 0}); err != nil { - t.Fatal(err) - } - if want, have := "std_map=\""+logfmt.ErrUnsupportedValueType.Error()+"\" my_map=special_behavior\n", buf.String(); want != have { - t.Errorf("want %#v, have %#v", want, have) - } -} - -func BenchmarkLogfmtLoggerSimple(b *testing.B) { - benchmarkRunner(b, log.NewLogfmtLogger(ioutil.Discard), baseMessage) -} - -func BenchmarkLogfmtLoggerContextual(b *testing.B) { - benchmarkRunner(b, log.NewLogfmtLogger(ioutil.Discard), withMessage) -} - -func TestLogfmtLoggerConcurrency(t *testing.T) { - t.Parallel() - testConcurrency(t, log.NewLogfmtLogger(ioutil.Discard), 10000) -} - -type mymap map[int]int - -func (m mymap) String() string { return "special_behavior" } diff --git a/vendor/github.com/go-kit/kit/log/nop_logger.go b/vendor/github.com/go-kit/kit/log/nop_logger.go deleted file mode 100644 index 1047d62..0000000 --- a/vendor/github.com/go-kit/kit/log/nop_logger.go +++ /dev/null @@ -1,8 +0,0 @@ -package log - -type nopLogger struct{} - -// NewNopLogger returns a logger that doesn't do anything. -func NewNopLogger() Logger { return nopLogger{} } - -func (nopLogger) Log(...interface{}) error { return nil } diff --git a/vendor/github.com/go-kit/kit/log/nop_logger_test.go b/vendor/github.com/go-kit/kit/log/nop_logger_test.go deleted file mode 100644 index 908ddd8..0000000 --- a/vendor/github.com/go-kit/kit/log/nop_logger_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package log_test - -import ( - "testing" - - "github.com/go-kit/kit/log" -) - -func TestNopLogger(t *testing.T) { - t.Parallel() - logger := log.NewNopLogger() - if err := logger.Log("abc", 123); err != nil { - t.Error(err) - } - if err := log.With(logger, "def", "ghi").Log(); err != nil { - t.Error(err) - } -} - -func BenchmarkNopLoggerSimple(b *testing.B) { - benchmarkRunner(b, log.NewNopLogger(), baseMessage) -} - -func BenchmarkNopLoggerContextual(b *testing.B) { - benchmarkRunner(b, log.NewNopLogger(), withMessage) -} diff --git a/vendor/github.com/go-kit/kit/log/stdlib.go b/vendor/github.com/go-kit/kit/log/stdlib.go deleted file mode 100644 index ff96b5d..0000000 --- a/vendor/github.com/go-kit/kit/log/stdlib.go +++ /dev/null @@ -1,116 +0,0 @@ -package log - -import ( - "io" - "log" - "regexp" - "strings" -) - -// StdlibWriter implements io.Writer by invoking the stdlib log.Print. It's -// designed to be passed to a Go kit logger as the writer, for cases where -// it's necessary to redirect all Go kit log output to the stdlib logger. -// -// If you have any choice in the matter, you shouldn't use this. Prefer to -// redirect the stdlib log to the Go kit logger via NewStdlibAdapter. -type StdlibWriter struct{} - -// Write implements io.Writer. -func (w StdlibWriter) Write(p []byte) (int, error) { - log.Print(strings.TrimSpace(string(p))) - return len(p), nil -} - -// StdlibAdapter wraps a Logger and allows it to be passed to the stdlib -// logger's SetOutput. It will extract date/timestamps, filenames, and -// messages, and place them under relevant keys. -type StdlibAdapter struct { - Logger - timestampKey string - fileKey string - messageKey string -} - -// StdlibAdapterOption sets a parameter for the StdlibAdapter. -type StdlibAdapterOption func(*StdlibAdapter) - -// TimestampKey sets the key for the timestamp field. By default, it's "ts". -func TimestampKey(key string) StdlibAdapterOption { - return func(a *StdlibAdapter) { a.timestampKey = key } -} - -// FileKey sets the key for the file and line field. By default, it's "caller". -func FileKey(key string) StdlibAdapterOption { - return func(a *StdlibAdapter) { a.fileKey = key } -} - -// MessageKey sets the key for the actual log message. By default, it's "msg". -func MessageKey(key string) StdlibAdapterOption { - return func(a *StdlibAdapter) { a.messageKey = key } -} - -// NewStdlibAdapter returns a new StdlibAdapter wrapper around the passed -// logger. It's designed to be passed to log.SetOutput. -func NewStdlibAdapter(logger Logger, options ...StdlibAdapterOption) io.Writer { - a := StdlibAdapter{ - Logger: logger, - timestampKey: "ts", - fileKey: "caller", - messageKey: "msg", - } - for _, option := range options { - option(&a) - } - return a -} - -func (a StdlibAdapter) Write(p []byte) (int, error) { - result := subexps(p) - keyvals := []interface{}{} - var timestamp string - if date, ok := result["date"]; ok && date != "" { - timestamp = date - } - if time, ok := result["time"]; ok && time != "" { - if timestamp != "" { - timestamp += " " - } - timestamp += time - } - if timestamp != "" { - keyvals = append(keyvals, a.timestampKey, timestamp) - } - if file, ok := result["file"]; ok && file != "" { - keyvals = append(keyvals, a.fileKey, file) - } - if msg, ok := result["msg"]; ok { - keyvals = append(keyvals, a.messageKey, msg) - } - if err := a.Logger.Log(keyvals...); err != nil { - return 0, err - } - return len(p), nil -} - -const ( - logRegexpDate = `(?P[0-9]{4}/[0-9]{2}/[0-9]{2})?[ ]?` - logRegexpTime = `(?P